Skip to content

Commit 65f3b7e

Browse files
committed
wip
1 parent 7c966a6 commit 65f3b7e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ext/json/json_encoder.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ zend_result php_json_escape_string(
492492
static const uint32_t charmap[8] = {
493493
0xffffffff, 0x500080c4, 0x10000000, 0x00000000,
494494
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff};
495-
// printf("pos %d\n", pos);
495+
496496
#ifdef __SSE2__
497497
while (len >= sizeof(__m128i)) {
498498
const __m128i input = _mm_loadu_si128((__m128i *) (s + pos));
@@ -505,11 +505,12 @@ zend_result php_json_escape_string(
505505
//printf("\n");
506506

507507
// TODO: problem if the first UTF-8 char comes before the first escape char
508+
// and getting this right+performant is hard, so for now we just don't shift.
508509
int input_range_mask = _mm_movemask_epi8(input_range);
509510
if (input_range_mask != 0) {
510-
int shift = __builtin_ctz(input_range_mask);
511-
pos += shift;
512-
len -= shift;
511+
//int shift = __builtin_ctz(input_range_mask);
512+
//pos += shift;
513+
//len -= shift;
513514
break;
514515
}
515516

0 commit comments

Comments
 (0)