diff --git a/src/arm64/dom_parser_implementation.cpp b/src/arm64/dom_parser_implementation.cpp index 8a41c6f06..3ab89a299 100644 --- a/src/arm64/dom_parser_implementation.cpp +++ b/src/arm64/dom_parser_implementation.cpp @@ -77,6 +77,15 @@ really_inline simd8 must_be_continuation(simd8 prev1, simd8(buf, len, dst, dst_len); diff --git a/src/generic/stage1/json_string_scanner.h b/src/generic/stage1/json_string_scanner.h index 834943bf1..fb4c1ac1d 100644 --- a/src/generic/stage1/json_string_scanner.h +++ b/src/generic/stage1/json_string_scanner.h @@ -40,7 +40,9 @@ public: really_inline bool in_unclosed_string() { return prev_in_string; } private: + // Intended to be defined by the implementation really_inline uint64_t find_escaped(uint64_t escape); + really_inline uint64_t find_escaped_branchless(uint64_t escape); // Whether the last iteration was still inside a string (all 1's = true, all 0's = false). uint64_t prev_in_string = 0ULL; @@ -75,9 +77,7 @@ private: // desired | x | x x x x x x x x | // text | \\\ | \\\"\\\" \\\" \\"\\" | // -really_inline uint64_t json_string_scanner::find_escaped(uint64_t backslash) { - if (!backslash) { uint64_t escaped = prev_escaped; prev_escaped = 0; return escaped; } - +really_inline uint64_t json_string_scanner::find_escaped_branchless(uint64_t backslash) { // If there was overflow, pretend the first character isn't a backslash backslash &= ~prev_escaped; uint64_t follows_escape = backslash << 1 | prev_escaped; diff --git a/src/haswell/dom_parser_implementation.cpp b/src/haswell/dom_parser_implementation.cpp index b6145178b..e564e536f 100644 --- a/src/haswell/dom_parser_implementation.cpp +++ b/src/haswell/dom_parser_implementation.cpp @@ -65,6 +65,13 @@ really_inline simd8 must_be_continuation(simd8 prev1, simd8(buf, len, dst, dst_len); diff --git a/src/westmere/dom_parser_implementation.cpp b/src/westmere/dom_parser_implementation.cpp index 104005fc8..d2e928cc3 100644 --- a/src/westmere/dom_parser_implementation.cpp +++ b/src/westmere/dom_parser_implementation.cpp @@ -66,6 +66,13 @@ really_inline simd8 must_be_continuation(simd8 prev1, simd8(buf, len, dst, dst_len);