diff --git a/.github/workflows/unit_test-linux-x64.yml b/.github/workflows/unit_test-linux-x64.yml index 9931abb2..966eaa64 100644 --- a/.github/workflows/unit_test-linux-x64.yml +++ b/.github/workflows/unit_test-linux-x64.yml @@ -28,6 +28,16 @@ jobs: restore-keys: | ${{ runner.os }}-go- + - uses: actions/setup-python@v3 + with: + python-version: '3.10' + architecture: 'x64' + env: + AGENT_TOOLSDIRECTORY: /opt/hostedtoolcache + + - name: PCSP Test + run: python ./scripts/pcsp_test.py + - name: Unit Test run: | go test -race -covermode=atomic -coverprofile=coverage.txt ./... diff --git a/.gitignore b/.gitignore index 0d884470..21ca24a2 100644 --- a/.gitignore +++ b/.gitignore @@ -49,4 +49,7 @@ ast/bench.sh !testdata/*.json.gz fuzz/testdata -*__debug_bin \ No newline at end of file +*__debug_bin + +*.pprof +*coverage.txt diff --git a/internal/native/avx2/f32toa.go b/internal/native/avx2/f32toa.go index 0032b7a9..29cccc49 100644 --- a/internal/native/avx2/f32toa.go +++ b/internal/native/avx2/f32toa.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/avx2/f32toa_subr.go b/internal/native/avx2/f32toa_subr.go index 5ee068fc..5b0590cf 100644 --- a/internal/native/avx2/f32toa_subr.go +++ b/internal/native/avx2/f32toa_subr.go @@ -21,22 +21,22 @@ const ( var ( _pcsp__f32toa = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {3734, 64}, - {3738, 48}, - {3739, 40}, - {3741, 32}, - {3743, 24}, - {3745, 16}, - {3747, 8}, - {3751, 0}, - {3792, 64}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0xe9a, 64}, + {0xe9b, 48}, + {0xe9d, 40}, + {0xe9f, 32}, + {0xea1, 24}, + {0xea3, 16}, + {0xea4, 8}, + {0xea8, 0}, + {0xed0, 64}, } ) diff --git a/internal/native/avx2/f64toa.go b/internal/native/avx2/f64toa.go index ffd22bce..bb99c2f6 100644 --- a/internal/native/avx2/f64toa.go +++ b/internal/native/avx2/f64toa.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/avx2/f64toa_subr.go b/internal/native/avx2/f64toa_subr.go index 8c4a1b50..53fc5ae2 100644 --- a/internal/native/avx2/f64toa_subr.go +++ b/internal/native/avx2/f64toa_subr.go @@ -21,22 +21,22 @@ const ( var ( _pcsp__f64toa = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {4985, 72}, - {4989, 48}, - {4990, 40}, - {4992, 32}, - {4994, 24}, - {4996, 16}, - {4998, 8}, - {5002, 0}, - {5088, 72}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x137d, 72}, + {0x137e, 48}, + {0x1380, 40}, + {0x1382, 32}, + {0x1384, 24}, + {0x1386, 16}, + {0x1387, 8}, + {0x138b, 0}, + {0x13e0, 72}, } ) diff --git a/internal/native/avx2/fastfloat_test.go b/internal/native/avx2/fastfloat_test.go index 9da32ac8..d6df4de6 100644 --- a/internal/native/avx2/fastfloat_test.go +++ b/internal/native/avx2/fastfloat_test.go @@ -1,8 +1,6 @@ // +build amd64 -// Code generated by Makefile, DO NOT EDIT. - // Code generated by Makefile, DO NOT EDIT. /* diff --git a/internal/native/avx2/fastint_test.go b/internal/native/avx2/fastint_test.go index 99f8178a..fcc267d3 100644 --- a/internal/native/avx2/fastint_test.go +++ b/internal/native/avx2/fastint_test.go @@ -1,8 +1,6 @@ // +build amd64 -// Code generated by Makefile, DO NOT EDIT. - // Code generated by Makefile, DO NOT EDIT. /* diff --git a/internal/native/avx2/get_by_path.go b/internal/native/avx2/get_by_path.go index 0d2dc276..cb7ff686 100644 --- a/internal/native/avx2/get_by_path.go +++ b/internal/native/avx2/get_by_path.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/avx2/get_by_path_subr.go b/internal/native/avx2/get_by_path_subr.go index 61581211..a3711769 100644 --- a/internal/native/avx2/get_by_path_subr.go +++ b/internal/native/avx2/get_by_path_subr.go @@ -21,21 +21,22 @@ const ( var ( _pcsp__get_by_path = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {18972, 240}, - {18973, 232}, - {18975, 224}, - {18977, 216}, - {18979, 208}, - {18981, 200}, - {18985, 192}, - {21452, 240}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x14, 48}, + {0x4a1c, 240}, + {0x4a1d, 48}, + {0x4a1f, 40}, + {0x4a21, 32}, + {0x4a23, 24}, + {0x4a25, 16}, + {0x4a26, 8}, + {0x4a2a, 0}, + {0x53cc, 240}, } ) diff --git a/internal/native/avx2/html_escape.go b/internal/native/avx2/html_escape.go index 5d535a33..9ea82de4 100644 --- a/internal/native/avx2/html_escape.go +++ b/internal/native/avx2/html_escape.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/avx2/html_escape_subr.go b/internal/native/avx2/html_escape_subr.go index 5222d49d..fcb0f9bc 100644 --- a/internal/native/avx2/html_escape_subr.go +++ b/internal/native/avx2/html_escape_subr.go @@ -21,21 +21,21 @@ const ( var ( _pcsp__html_escape = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {2017, 72}, - {2021, 48}, - {2022, 40}, - {2024, 32}, - {2026, 24}, - {2028, 16}, - {2030, 8}, - {2048, 0}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x7e5, 72}, + {0x7e6, 48}, + {0x7e8, 40}, + {0x7ea, 32}, + {0x7ec, 24}, + {0x7ee, 16}, + {0x7ef, 8}, + {0x800, 0}, } ) diff --git a/internal/native/avx2/i64toa.go b/internal/native/avx2/i64toa.go index b41ec3b9..9b9333d8 100644 --- a/internal/native/avx2/i64toa.go +++ b/internal/native/avx2/i64toa.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/avx2/i64toa_subr.go b/internal/native/avx2/i64toa_subr.go index 573288be..bb6b3870 100644 --- a/internal/native/avx2/i64toa_subr.go +++ b/internal/native/avx2/i64toa_subr.go @@ -21,23 +21,23 @@ const ( var ( _pcsp__i64toa = [][2]uint32{ - {1, 0}, - {173, 8}, - {174, 0}, - {512, 8}, - {513, 0}, - {646, 8}, - {647, 0}, - {1109, 8}, - {1110, 0}, - {1249, 8}, - {1250, 0}, - {1551, 8}, - {1552, 0}, - {1904, 8}, - {1905, 0}, - {2264, 8}, - {2272, 0}, + {0x1, 0}, + {0xae, 8}, + {0xaf, 0}, + {0x201, 8}, + {0x202, 0}, + {0x287, 8}, + {0x288, 0}, + {0x456, 8}, + {0x457, 0}, + {0x4e2, 8}, + {0x4e3, 0}, + {0x610, 8}, + {0x611, 0}, + {0x771, 8}, + {0x772, 0}, + {0x8d9, 8}, + {0x8e0, 0}, } ) diff --git a/internal/native/avx2/lspace.go b/internal/native/avx2/lspace.go index 96819248..ac48dadf 100644 --- a/internal/native/avx2/lspace.go +++ b/internal/native/avx2/lspace.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * @@ -34,3 +32,4 @@ var S_lspace uintptr func lspace(sp *byte, nb int, off int) (ret int) { return F_lspace(rt.NoEscape(unsafe.Pointer(sp)), nb, off) } + diff --git a/internal/native/avx2/lspace_subr.go b/internal/native/avx2/lspace_subr.go index 506dd517..1802f842 100644 --- a/internal/native/avx2/lspace_subr.go +++ b/internal/native/avx2/lspace_subr.go @@ -21,14 +21,14 @@ const ( var ( _pcsp__lspace = [][2]uint32{ - {1, 0}, - {186, 8}, - {190, 0}, - {199, 8}, - {203, 0}, - {210, 8}, - {214, 0}, - {232, 8}, + {0x1, 0}, + {0xbb, 8}, + {0xbf, 0}, + {0xc8, 8}, + {0xcc, 0}, + {0xd3, 8}, + {0xd7, 0}, + {0xe8, 8}, } ) diff --git a/internal/native/avx2/native_export.go b/internal/native/avx2/native_export.go index e3d882b4..05eb32fc 100644 --- a/internal/native/avx2/native_export.go +++ b/internal/native/avx2/native_export.go @@ -1,3 +1,6 @@ + +// Code generated by Makefile, DO NOT EDIT. + /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/avx2/native_test.go b/internal/native/avx2/native_test.go index f22fe119..8fbe3b07 100644 --- a/internal/native/avx2/native_test.go +++ b/internal/native/avx2/native_test.go @@ -1,8 +1,6 @@ // +build amd64 -// Code generated by Makefile, DO NOT EDIT. - // Code generated by Makefile, DO NOT EDIT. /* diff --git a/internal/native/avx2/quote.go b/internal/native/avx2/quote.go index eba96c2e..78bb35d2 100644 --- a/internal/native/avx2/quote.go +++ b/internal/native/avx2/quote.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/avx2/quote_subr.go b/internal/native/avx2/quote_subr.go index 47f63964..75bc06b4 100644 --- a/internal/native/avx2/quote_subr.go +++ b/internal/native/avx2/quote_subr.go @@ -21,22 +21,22 @@ const ( var ( _pcsp__quote = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {2828, 72}, - {2832, 48}, - {2833, 40}, - {2835, 32}, - {2837, 24}, - {2839, 16}, - {2841, 8}, - {2845, 0}, - {2880, 72}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0xb10, 72}, + {0xb11, 48}, + {0xb13, 40}, + {0xb15, 32}, + {0xb17, 24}, + {0xb19, 16}, + {0xb1a, 8}, + {0xb1e, 0}, + {0xb40, 72}, } ) diff --git a/internal/native/avx2/recover_test.go b/internal/native/avx2/recover_test.go index 2e6a556a..6f15e88a 100644 --- a/internal/native/avx2/recover_test.go +++ b/internal/native/avx2/recover_test.go @@ -40,9 +40,9 @@ var ( debugAsyncGC = os.Getenv("SONIC_NO_ASYNC_GC") == "" ) + func TestMain(m *testing.M) { Use() - go func () { if !debugAsyncGC { return diff --git a/internal/native/avx2/skip_array.go b/internal/native/avx2/skip_array.go index df96e21c..b38be8c8 100644 --- a/internal/native/avx2/skip_array.go +++ b/internal/native/avx2/skip_array.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/avx2/skip_array_subr.go b/internal/native/avx2/skip_array_subr.go index 6b82bae2..8078d21f 100644 --- a/internal/native/avx2/skip_array_subr.go +++ b/internal/native/avx2/skip_array_subr.go @@ -21,22 +21,22 @@ const ( var ( _pcsp__skip_array = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {10225, 112}, - {10229, 48}, - {10230, 40}, - {10232, 32}, - {10234, 24}, - {10236, 16}, - {10238, 8}, - {10242, 0}, - {10664, 112}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x27f5, 112}, + {0x27f6, 48}, + {0x27f8, 40}, + {0x27fa, 32}, + {0x27fc, 24}, + {0x27fe, 16}, + {0x27ff, 8}, + {0x2803, 0}, + {0x29a8, 112}, } ) diff --git a/internal/native/avx2/skip_number.go b/internal/native/avx2/skip_number.go index f991daff..73ac9768 100644 --- a/internal/native/avx2/skip_number.go +++ b/internal/native/avx2/skip_number.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/avx2/skip_number_subr.go b/internal/native/avx2/skip_number_subr.go index dad85132..4c0c9d15 100644 --- a/internal/native/avx2/skip_number_subr.go +++ b/internal/native/avx2/skip_number_subr.go @@ -21,22 +21,22 @@ const ( var ( _pcsp__skip_number = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {1463, 88}, - {1467, 48}, - {1468, 40}, - {1470, 32}, - {1472, 24}, - {1474, 16}, - {1476, 8}, - {1480, 0}, - {1528, 88}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x5bb, 88}, + {0x5bc, 48}, + {0x5be, 40}, + {0x5c0, 32}, + {0x5c2, 24}, + {0x5c4, 16}, + {0x5c5, 8}, + {0x5c9, 0}, + {0x5f8, 88}, } ) diff --git a/internal/native/avx2/skip_object.go b/internal/native/avx2/skip_object.go index 207d69c0..6b14addb 100644 --- a/internal/native/avx2/skip_object.go +++ b/internal/native/avx2/skip_object.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/avx2/skip_object_subr.go b/internal/native/avx2/skip_object_subr.go index a118c2d8..d1f7b6b3 100644 --- a/internal/native/avx2/skip_object_subr.go +++ b/internal/native/avx2/skip_object_subr.go @@ -21,22 +21,22 @@ const ( var ( _pcsp__skip_object = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {10225, 112}, - {10229, 48}, - {10230, 40}, - {10232, 32}, - {10234, 24}, - {10236, 16}, - {10238, 8}, - {10242, 0}, - {10664, 112}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x27f5, 112}, + {0x27f6, 48}, + {0x27f8, 40}, + {0x27fa, 32}, + {0x27fc, 24}, + {0x27fe, 16}, + {0x27ff, 8}, + {0x2803, 0}, + {0x29a8, 112}, } ) diff --git a/internal/native/avx2/skip_one.go b/internal/native/avx2/skip_one.go index 3d02752f..050db6bd 100644 --- a/internal/native/avx2/skip_one.go +++ b/internal/native/avx2/skip_one.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/avx2/skip_one_fast.go b/internal/native/avx2/skip_one_fast.go index 3f814eab..5b0b1cbc 100644 --- a/internal/native/avx2/skip_one_fast.go +++ b/internal/native/avx2/skip_one_fast.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/avx2/skip_one_fast_subr.go b/internal/native/avx2/skip_one_fast_subr.go index 609517c1..8ac7e1af 100644 --- a/internal/native/avx2/skip_one_fast_subr.go +++ b/internal/native/avx2/skip_one_fast_subr.go @@ -21,21 +21,22 @@ const ( var ( _pcsp__skip_one_fast = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {812, 176}, - {813, 168}, - {815, 160}, - {817, 152}, - {819, 144}, - {821, 136}, - {825, 128}, - {2824, 176}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x14, 48}, + {0x32c, 176}, + {0x32d, 48}, + {0x32f, 40}, + {0x331, 32}, + {0x333, 24}, + {0x335, 16}, + {0x336, 8}, + {0x33a, 0}, + {0xb08, 176}, } ) diff --git a/internal/native/avx2/skip_one_subr.go b/internal/native/avx2/skip_one_subr.go index f83fb8b5..466c83f4 100644 --- a/internal/native/avx2/skip_one_subr.go +++ b/internal/native/avx2/skip_one_subr.go @@ -21,22 +21,22 @@ const ( var ( _pcsp__skip_one = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {10225, 112}, - {10229, 48}, - {10230, 40}, - {10232, 32}, - {10234, 24}, - {10236, 16}, - {10238, 8}, - {10242, 0}, - {10664, 112}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x27f5, 112}, + {0x27f6, 48}, + {0x27f8, 40}, + {0x27fa, 32}, + {0x27fc, 24}, + {0x27fe, 16}, + {0x27ff, 8}, + {0x2803, 0}, + {0x29a8, 112}, } ) diff --git a/internal/native/avx2/u64toa.go b/internal/native/avx2/u64toa.go index fa9da82e..684495d1 100644 --- a/internal/native/avx2/u64toa.go +++ b/internal/native/avx2/u64toa.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/avx2/u64toa_subr.go b/internal/native/avx2/u64toa_subr.go index 65f8b5e1..19e4f287 100644 --- a/internal/native/avx2/u64toa_subr.go +++ b/internal/native/avx2/u64toa_subr.go @@ -21,15 +21,15 @@ const ( var ( _pcsp__u64toa = [][2]uint32{ - {1, 0}, - {164, 8}, - {165, 0}, - {462, 8}, - {463, 0}, - {760, 8}, - {761, 0}, - {1206, 8}, - {1216, 0}, + {0x1, 0}, + {0xa5, 8}, + {0xa6, 0}, + {0x1cf, 8}, + {0x1d0, 0}, + {0x2f9, 8}, + {0x2fa, 0}, + {0x4b7, 8}, + {0x4c0, 0}, } ) diff --git a/internal/native/avx2/unquote.go b/internal/native/avx2/unquote.go index e4c9e410..d7f5e285 100644 --- a/internal/native/avx2/unquote.go +++ b/internal/native/avx2/unquote.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/avx2/unquote_subr.go b/internal/native/avx2/unquote_subr.go index dc62a4cb..b8df4cc7 100644 --- a/internal/native/avx2/unquote_subr.go +++ b/internal/native/avx2/unquote_subr.go @@ -21,22 +21,22 @@ const ( var ( _pcsp__unquote = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {1524, 80}, - {1528, 48}, - {1529, 40}, - {1531, 32}, - {1533, 24}, - {1535, 16}, - {1537, 8}, - {1541, 0}, - {2288, 80}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x5f8, 80}, + {0x5f9, 48}, + {0x5fb, 40}, + {0x5fd, 32}, + {0x5ff, 24}, + {0x601, 16}, + {0x602, 8}, + {0x606, 0}, + {0x8f0, 80}, } ) diff --git a/internal/native/avx2/validate_one.go b/internal/native/avx2/validate_one.go index 2ca6d833..3006e1fe 100644 --- a/internal/native/avx2/validate_one.go +++ b/internal/native/avx2/validate_one.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/avx2/validate_one_subr.go b/internal/native/avx2/validate_one_subr.go index 8ceccbd0..dd9336a3 100644 --- a/internal/native/avx2/validate_one_subr.go +++ b/internal/native/avx2/validate_one_subr.go @@ -21,22 +21,22 @@ const ( var ( _pcsp__validate_one = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {10225, 112}, - {10229, 48}, - {10230, 40}, - {10232, 32}, - {10234, 24}, - {10236, 16}, - {10238, 8}, - {10242, 0}, - {10664, 112}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x27f5, 112}, + {0x27f6, 48}, + {0x27f8, 40}, + {0x27fa, 32}, + {0x27fc, 24}, + {0x27fe, 16}, + {0x27ff, 8}, + {0x2803, 0}, + {0x29a8, 112}, } ) diff --git a/internal/native/avx2/validate_utf8.go b/internal/native/avx2/validate_utf8.go index e006f661..88b67e47 100644 --- a/internal/native/avx2/validate_utf8.go +++ b/internal/native/avx2/validate_utf8.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/avx2/validate_utf8_fast.go b/internal/native/avx2/validate_utf8_fast.go index efa79e41..c0d79f6d 100644 --- a/internal/native/avx2/validate_utf8_fast.go +++ b/internal/native/avx2/validate_utf8_fast.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/avx2/validate_utf8_fast_subr.go b/internal/native/avx2/validate_utf8_fast_subr.go index 8ab70f30..009afe6b 100644 --- a/internal/native/avx2/validate_utf8_fast_subr.go +++ b/internal/native/avx2/validate_utf8_fast_subr.go @@ -21,16 +21,18 @@ const ( var ( _pcsp__validate_utf8_fast = [][2]uint32{ - {1, 0}, - {4, 8}, - {5, 16}, - {1706, 176}, - {1707, 168}, - {1711, 160}, - {2003, 176}, - {2004, 168}, - {2008, 160}, - {2656, 176}, + {0x1, 0}, + {0x5, 8}, + {0xc, 16}, + {0x6aa, 176}, + {0x6ab, 16}, + {0x6ac, 8}, + {0x6b0, 0}, + {0x7d3, 176}, + {0x7d4, 16}, + {0x7d5, 8}, + {0x7d9, 0}, + {0xa60, 176}, } ) diff --git a/internal/native/avx2/validate_utf8_subr.go b/internal/native/avx2/validate_utf8_subr.go index 57d49af6..53be2051 100644 --- a/internal/native/avx2/validate_utf8_subr.go +++ b/internal/native/avx2/validate_utf8_subr.go @@ -21,20 +21,20 @@ const ( var ( _pcsp__validate_utf8 = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {11, 40}, - {639, 48}, - {643, 40}, - {644, 32}, - {646, 24}, - {648, 16}, - {650, 8}, - {651, 0}, - {684, 48}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xb, 32}, + {0xc, 40}, + {0x283, 48}, + {0x284, 40}, + {0x286, 32}, + {0x288, 24}, + {0x28a, 16}, + {0x28b, 8}, + {0x28c, 0}, + {0x2ac, 48}, } ) diff --git a/internal/native/avx2/value_subr.go b/internal/native/avx2/value_subr.go index 616d306a..fffa6bcd 100644 --- a/internal/native/avx2/value_subr.go +++ b/internal/native/avx2/value_subr.go @@ -21,22 +21,22 @@ const ( var ( _pcsp__value = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {4299, 128}, - {4303, 48}, - {4304, 40}, - {4306, 32}, - {4308, 24}, - {4310, 16}, - {4312, 8}, - {4316, 0}, - {12468, 128}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x10cf, 128}, + {0x10d0, 48}, + {0x10d2, 40}, + {0x10d4, 32}, + {0x10d6, 24}, + {0x10d8, 16}, + {0x10d9, 8}, + {0x10dd, 0}, + {0x30b4, 128}, } ) diff --git a/internal/native/avx2/vnumber_subr.go b/internal/native/avx2/vnumber_subr.go index b8558e96..f10895cd 100644 --- a/internal/native/avx2/vnumber_subr.go +++ b/internal/native/avx2/vnumber_subr.go @@ -21,21 +21,21 @@ const ( var ( _pcsp__vnumber = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {8475, 136}, - {8479, 48}, - {8480, 40}, - {8482, 32}, - {8484, 24}, - {8486, 16}, - {8488, 8}, - {8496, 0}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x211f, 136}, + {0x2120, 48}, + {0x2122, 40}, + {0x2124, 32}, + {0x2126, 24}, + {0x2128, 16}, + {0x2129, 8}, + {0x2130, 0}, } ) diff --git a/internal/native/avx2/vsigned_subr.go b/internal/native/avx2/vsigned_subr.go index 1db3aa33..cfb3b107 100644 --- a/internal/native/avx2/vsigned_subr.go +++ b/internal/native/avx2/vsigned_subr.go @@ -21,26 +21,26 @@ const ( var ( _pcsp__vsigned = [][2]uint32{ - {1, 0}, - {4, 8}, - {113, 16}, - {114, 8}, - {115, 0}, - {126, 16}, - {127, 8}, - {128, 0}, - {278, 16}, - {279, 8}, - {280, 0}, - {284, 16}, - {285, 8}, - {286, 0}, - {340, 16}, - {341, 8}, - {342, 0}, - {353, 16}, - {354, 8}, - {356, 0}, + {0x1, 0}, + {0x5, 8}, + {0x72, 16}, + {0x73, 8}, + {0x74, 0}, + {0x7f, 16}, + {0x80, 8}, + {0x81, 0}, + {0x117, 16}, + {0x118, 8}, + {0x119, 0}, + {0x11d, 16}, + {0x11e, 8}, + {0x11f, 0}, + {0x155, 16}, + {0x156, 8}, + {0x157, 0}, + {0x162, 16}, + {0x163, 8}, + {0x164, 0}, } ) diff --git a/internal/native/avx2/vstring_subr.go b/internal/native/avx2/vstring_subr.go index 4473ee31..33b4e964 100644 --- a/internal/native/avx2/vstring_subr.go +++ b/internal/native/avx2/vstring_subr.go @@ -21,22 +21,22 @@ const ( var ( _pcsp__vstring = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {1653, 72}, - {1657, 48}, - {1658, 40}, - {1660, 32}, - {1662, 24}, - {1664, 16}, - {1666, 8}, - {1670, 0}, - {1832, 72}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x679, 72}, + {0x67a, 48}, + {0x67c, 40}, + {0x67e, 32}, + {0x680, 24}, + {0x682, 16}, + {0x683, 8}, + {0x687, 0}, + {0x728, 72}, } ) diff --git a/internal/native/avx2/vunsigned_subr.go b/internal/native/avx2/vunsigned_subr.go index 94590e3d..6dc8c2f3 100644 --- a/internal/native/avx2/vunsigned_subr.go +++ b/internal/native/avx2/vunsigned_subr.go @@ -21,33 +21,33 @@ const ( var ( _pcsp__vunsigned = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {74, 24}, - {75, 16}, - {77, 8}, - {78, 0}, - {89, 24}, - {90, 16}, - {92, 8}, - {93, 0}, - {116, 24}, - {117, 16}, - {119, 8}, - {120, 0}, - {281, 24}, - {282, 16}, - {284, 8}, - {285, 0}, - {336, 24}, - {337, 16}, - {339, 8}, - {340, 0}, - {348, 24}, - {349, 16}, - {351, 8}, - {356, 0}, + {0x1, 0}, + {0x6, 8}, + {0x7, 16}, + {0x4b, 24}, + {0x4d, 16}, + {0x4e, 8}, + {0x4f, 0}, + {0x5a, 24}, + {0x5c, 16}, + {0x5d, 8}, + {0x5e, 0}, + {0x75, 24}, + {0x77, 16}, + {0x78, 8}, + {0x79, 0}, + {0x11a, 24}, + {0x11c, 16}, + {0x11d, 8}, + {0x11e, 0}, + {0x151, 24}, + {0x153, 16}, + {0x154, 8}, + {0x155, 0}, + {0x15d, 24}, + {0x15f, 16}, + {0x160, 8}, + {0x164, 0}, } ) diff --git a/internal/native/f32toa.tmpl b/internal/native/f32toa.tmpl index 7016dae4..200090d1 100644 --- a/internal/native/f32toa.tmpl +++ b/internal/native/f32toa.tmpl @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/f64toa.tmpl b/internal/native/f64toa.tmpl index 21fbdda4..074c6951 100644 --- a/internal/native/f64toa.tmpl +++ b/internal/native/f64toa.tmpl @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/fastfloat_test.tmpl b/internal/native/fastfloat_test.tmpl index deda744c..b5f24d23 100644 --- a/internal/native/fastfloat_test.tmpl +++ b/internal/native/fastfloat_test.tmpl @@ -1,8 +1,6 @@ // +build amd64 -// Code generated by Makefile, DO NOT EDIT. - // Code generated by Makefile, DO NOT EDIT. /* diff --git a/internal/native/fastint_test.tmpl b/internal/native/fastint_test.tmpl index 9fb3f4bb..c074cbe8 100644 --- a/internal/native/fastint_test.tmpl +++ b/internal/native/fastint_test.tmpl @@ -1,8 +1,6 @@ // +build amd64 -// Code generated by Makefile, DO NOT EDIT. - // Code generated by Makefile, DO NOT EDIT. /* diff --git a/internal/native/get_by_path.tmpl b/internal/native/get_by_path.tmpl index 79fa6bff..e77e7f77 100644 --- a/internal/native/get_by_path.tmpl +++ b/internal/native/get_by_path.tmpl @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/html_escape.tmpl b/internal/native/html_escape.tmpl index 7b1ddf5b..ad54e85f 100644 --- a/internal/native/html_escape.tmpl +++ b/internal/native/html_escape.tmpl @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/i64toa.tmpl b/internal/native/i64toa.tmpl index 77ec8bdb..0aeef00f 100644 --- a/internal/native/i64toa.tmpl +++ b/internal/native/i64toa.tmpl @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/lspace.tmpl b/internal/native/lspace.tmpl index 90cd7765..e599297a 100644 --- a/internal/native/lspace.tmpl +++ b/internal/native/lspace.tmpl @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * @@ -34,3 +32,4 @@ var S_lspace uintptr func lspace(sp *byte, nb int, off int) (ret int) { return F_lspace(rt.NoEscape(unsafe.Pointer(sp)), nb, off) } + diff --git a/internal/native/native_export.tmpl b/internal/native/native_export.tmpl index a6930c83..ab56d3c2 100644 --- a/internal/native/native_export.tmpl +++ b/internal/native/native_export.tmpl @@ -1,3 +1,6 @@ + +// Code generated by Makefile, DO NOT EDIT. + /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/native_test.tmpl b/internal/native/native_test.tmpl index f57337b8..cfa345f7 100644 --- a/internal/native/native_test.tmpl +++ b/internal/native/native_test.tmpl @@ -1,8 +1,6 @@ // +build amd64 -// Code generated by Makefile, DO NOT EDIT. - // Code generated by Makefile, DO NOT EDIT. /* diff --git a/internal/native/neon/f32toa_arm64.go b/internal/native/neon/f32toa_arm64.go index 67ef19e5..c7d323d1 100644 --- a/internal/native/neon/f32toa_arm64.go +++ b/internal/native/neon/f32toa_arm64.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/neon/f64toa_arm64.go b/internal/native/neon/f64toa_arm64.go index 169924be..65570eda 100644 --- a/internal/native/neon/f64toa_arm64.go +++ b/internal/native/neon/f64toa_arm64.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/neon/fastfloat_arm64_test.go b/internal/native/neon/fastfloat_arm64_test.go index dc00ec96..91357ee0 100644 --- a/internal/native/neon/fastfloat_arm64_test.go +++ b/internal/native/neon/fastfloat_arm64_test.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/neon/fastint_arm64_test.go b/internal/native/neon/fastint_arm64_test.go index d55fdfd2..f103a237 100644 --- a/internal/native/neon/fastint_arm64_test.go +++ b/internal/native/neon/fastint_arm64_test.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/neon/get_by_path_arm64.go b/internal/native/neon/get_by_path_arm64.go index 691a73e3..65414184 100644 --- a/internal/native/neon/get_by_path_arm64.go +++ b/internal/native/neon/get_by_path_arm64.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/neon/html_escape_arm64.go b/internal/native/neon/html_escape_arm64.go index 579af585..68a0a550 100644 --- a/internal/native/neon/html_escape_arm64.go +++ b/internal/native/neon/html_escape_arm64.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/neon/i64toa_arm64.go b/internal/native/neon/i64toa_arm64.go index d383b384..d26eefbc 100644 --- a/internal/native/neon/i64toa_arm64.go +++ b/internal/native/neon/i64toa_arm64.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/neon/lspace_arm64.go b/internal/native/neon/lspace_arm64.go index e6af9710..487fcaef 100644 --- a/internal/native/neon/lspace_arm64.go +++ b/internal/native/neon/lspace_arm64.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/neon/native_arm64_test.go b/internal/native/neon/native_arm64_test.go index 07644b51..de8a8d2b 100644 --- a/internal/native/neon/native_arm64_test.go +++ b/internal/native/neon/native_arm64_test.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/neon/quote_arm64.go b/internal/native/neon/quote_arm64.go index b6ca0b1e..9aca453b 100644 --- a/internal/native/neon/quote_arm64.go +++ b/internal/native/neon/quote_arm64.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/neon/skip_array_arm64.go b/internal/native/neon/skip_array_arm64.go index f6ce3152..2fd1c5ef 100644 --- a/internal/native/neon/skip_array_arm64.go +++ b/internal/native/neon/skip_array_arm64.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/neon/skip_number_arm64.go b/internal/native/neon/skip_number_arm64.go index b118ab11..09836a3a 100644 --- a/internal/native/neon/skip_number_arm64.go +++ b/internal/native/neon/skip_number_arm64.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/neon/skip_object_arm64.go b/internal/native/neon/skip_object_arm64.go index 8e3efa63..e97d8169 100644 --- a/internal/native/neon/skip_object_arm64.go +++ b/internal/native/neon/skip_object_arm64.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/neon/skip_one_arm64.go b/internal/native/neon/skip_one_arm64.go index cd4b64a2..bc580929 100644 --- a/internal/native/neon/skip_one_arm64.go +++ b/internal/native/neon/skip_one_arm64.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/neon/skip_one_fast_arm64.go b/internal/native/neon/skip_one_fast_arm64.go index 0e3a995f..ceaf1e04 100644 --- a/internal/native/neon/skip_one_fast_arm64.go +++ b/internal/native/neon/skip_one_fast_arm64.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/neon/u64toa_arm64.go b/internal/native/neon/u64toa_arm64.go index a3dcad89..98db57b6 100644 --- a/internal/native/neon/u64toa_arm64.go +++ b/internal/native/neon/u64toa_arm64.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/neon/unquote_arm64.go b/internal/native/neon/unquote_arm64.go index 204f95e6..4b25ebaf 100644 --- a/internal/native/neon/unquote_arm64.go +++ b/internal/native/neon/unquote_arm64.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/neon/validate_one_arm64.go b/internal/native/neon/validate_one_arm64.go index 14a6dad3..a6c79358 100644 --- a/internal/native/neon/validate_one_arm64.go +++ b/internal/native/neon/validate_one_arm64.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/neon/validate_utf8_arm64.go b/internal/native/neon/validate_utf8_arm64.go index 11b409a1..a4ebb59f 100644 --- a/internal/native/neon/validate_utf8_arm64.go +++ b/internal/native/neon/validate_utf8_arm64.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/neon/validate_utf8_fast_arm64.go b/internal/native/neon/validate_utf8_fast_arm64.go index dadcad5d..96ed4827 100644 --- a/internal/native/neon/validate_utf8_fast_arm64.go +++ b/internal/native/neon/validate_utf8_fast_arm64.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/quote.tmpl b/internal/native/quote.tmpl index 62af4616..0507f26f 100644 --- a/internal/native/quote.tmpl +++ b/internal/native/quote.tmpl @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/recover_test.tmpl b/internal/native/recover_test.tmpl index 9022dd02..e97d79f9 100644 --- a/internal/native/recover_test.tmpl +++ b/internal/native/recover_test.tmpl @@ -40,9 +40,9 @@ var ( debugAsyncGC = os.Getenv("SONIC_NO_ASYNC_GC") == "" ) + func TestMain(m *testing.M) { Use() - go func () { if !debugAsyncGC { return diff --git a/internal/native/skip_array.tmpl b/internal/native/skip_array.tmpl index 6b12a086..8a3fc27f 100644 --- a/internal/native/skip_array.tmpl +++ b/internal/native/skip_array.tmpl @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/skip_number.tmpl b/internal/native/skip_number.tmpl index 9a575339..f313f9d1 100644 --- a/internal/native/skip_number.tmpl +++ b/internal/native/skip_number.tmpl @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/skip_object.tmpl b/internal/native/skip_object.tmpl index dd776e47..59e24578 100644 --- a/internal/native/skip_object.tmpl +++ b/internal/native/skip_object.tmpl @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/skip_one.tmpl b/internal/native/skip_one.tmpl index fbeec3be..140eaa53 100644 --- a/internal/native/skip_one.tmpl +++ b/internal/native/skip_one.tmpl @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/skip_one_fast.tmpl b/internal/native/skip_one_fast.tmpl index 2f94b9ea..5c6bc514 100644 --- a/internal/native/skip_one_fast.tmpl +++ b/internal/native/skip_one_fast.tmpl @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/sse/f32toa.go b/internal/native/sse/f32toa.go index 40d31978..d7dcea70 100644 --- a/internal/native/sse/f32toa.go +++ b/internal/native/sse/f32toa.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/sse/f32toa_subr.go b/internal/native/sse/f32toa_subr.go index 8e8d9bad..bda60484 100644 --- a/internal/native/sse/f32toa_subr.go +++ b/internal/native/sse/f32toa_subr.go @@ -21,22 +21,22 @@ const ( var ( _pcsp__f32toa = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {3638, 64}, - {3642, 48}, - {3643, 40}, - {3645, 32}, - {3647, 24}, - {3649, 16}, - {3651, 8}, - {3652, 0}, - {3696, 64}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0xe3a, 64}, + {0xe3b, 48}, + {0xe3d, 40}, + {0xe3f, 32}, + {0xe41, 24}, + {0xe43, 16}, + {0xe44, 8}, + {0xe45, 0}, + {0xe70, 64}, } ) diff --git a/internal/native/sse/f64toa.go b/internal/native/sse/f64toa.go index 9cca7100..4435cd7e 100644 --- a/internal/native/sse/f64toa.go +++ b/internal/native/sse/f64toa.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/sse/f64toa_subr.go b/internal/native/sse/f64toa_subr.go index 108943e1..fef36046 100644 --- a/internal/native/sse/f64toa_subr.go +++ b/internal/native/sse/f64toa_subr.go @@ -21,22 +21,22 @@ const ( var ( _pcsp__f64toa = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {4889, 72}, - {4893, 48}, - {4894, 40}, - {4896, 32}, - {4898, 24}, - {4900, 16}, - {4902, 8}, - {4903, 0}, - {4992, 72}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x131d, 72}, + {0x131e, 48}, + {0x1320, 40}, + {0x1322, 32}, + {0x1324, 24}, + {0x1326, 16}, + {0x1327, 8}, + {0x1328, 0}, + {0x1380, 72}, } ) diff --git a/internal/native/sse/fastfloat_test.go b/internal/native/sse/fastfloat_test.go index c450783b..9490d73c 100644 --- a/internal/native/sse/fastfloat_test.go +++ b/internal/native/sse/fastfloat_test.go @@ -1,8 +1,6 @@ // +build amd64 -// Code generated by Makefile, DO NOT EDIT. - // Code generated by Makefile, DO NOT EDIT. /* diff --git a/internal/native/sse/fastint_test.go b/internal/native/sse/fastint_test.go index c8db6a1f..e736e64b 100644 --- a/internal/native/sse/fastint_test.go +++ b/internal/native/sse/fastint_test.go @@ -1,8 +1,6 @@ // +build amd64 -// Code generated by Makefile, DO NOT EDIT. - // Code generated by Makefile, DO NOT EDIT. /* diff --git a/internal/native/sse/get_by_path.go b/internal/native/sse/get_by_path.go index 0ec33b1f..a79dc130 100644 --- a/internal/native/sse/get_by_path.go +++ b/internal/native/sse/get_by_path.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/sse/get_by_path_subr.go b/internal/native/sse/get_by_path_subr.go index 60789146..8d76ae01 100644 --- a/internal/native/sse/get_by_path_subr.go +++ b/internal/native/sse/get_by_path_subr.go @@ -21,22 +21,22 @@ const ( var ( _pcsp__get_by_path = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {17761, 216}, - {17768, 48}, - {17769, 40}, - {17771, 32}, - {17773, 24}, - {17775, 16}, - {17777, 8}, - {17778, 0}, - {21416, 216}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x14, 48}, + {0x4568, 216}, + {0x4569, 48}, + {0x456b, 40}, + {0x456d, 32}, + {0x456f, 24}, + {0x4571, 16}, + {0x4572, 8}, + {0x4573, 0}, + {0x53a8, 216}, } ) diff --git a/internal/native/sse/html_escape.go b/internal/native/sse/html_escape.go index 9fe109c8..4056a473 100644 --- a/internal/native/sse/html_escape.go +++ b/internal/native/sse/html_escape.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/sse/html_escape_subr.go b/internal/native/sse/html_escape_subr.go index 6b29ccb0..c02681c8 100644 --- a/internal/native/sse/html_escape_subr.go +++ b/internal/native/sse/html_escape_subr.go @@ -21,21 +21,21 @@ const ( var ( _pcsp__html_escape = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {1281, 64}, - {1285, 48}, - {1286, 40}, - {1288, 32}, - {1290, 24}, - {1292, 16}, - {1294, 8}, - {1296, 0}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x505, 64}, + {0x506, 48}, + {0x508, 40}, + {0x50a, 32}, + {0x50c, 24}, + {0x50e, 16}, + {0x50f, 8}, + {0x510, 0}, } ) diff --git a/internal/native/sse/i64toa.go b/internal/native/sse/i64toa.go index e9d57337..00bc67da 100644 --- a/internal/native/sse/i64toa.go +++ b/internal/native/sse/i64toa.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/sse/i64toa_subr.go b/internal/native/sse/i64toa_subr.go index a51a1c5a..aee6371a 100644 --- a/internal/native/sse/i64toa_subr.go +++ b/internal/native/sse/i64toa_subr.go @@ -21,23 +21,23 @@ const ( var ( _pcsp__i64toa = [][2]uint32{ - {1, 0}, - {173, 8}, - {174, 0}, - {512, 8}, - {513, 0}, - {646, 8}, - {647, 0}, - {1123, 8}, - {1124, 0}, - {1263, 8}, - {1264, 0}, - {1579, 8}, - {1580, 0}, - {1942, 8}, - {1943, 0}, - {2312, 8}, - {2320, 0}, + {0x1, 0}, + {0xae, 8}, + {0xaf, 0}, + {0x201, 8}, + {0x202, 0}, + {0x287, 8}, + {0x288, 0}, + {0x464, 8}, + {0x465, 0}, + {0x4f0, 8}, + {0x4f1, 0}, + {0x62c, 8}, + {0x62d, 0}, + {0x797, 8}, + {0x798, 0}, + {0x909, 8}, + {0x910, 0}, } ) diff --git a/internal/native/sse/lspace.go b/internal/native/sse/lspace.go index d0067ed9..5bb3e319 100644 --- a/internal/native/sse/lspace.go +++ b/internal/native/sse/lspace.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * @@ -34,3 +32,4 @@ var S_lspace uintptr func lspace(sp *byte, nb int, off int) (ret int) { return F_lspace(rt.NoEscape(unsafe.Pointer(sp)), nb, off) } + diff --git a/internal/native/sse/lspace_subr.go b/internal/native/sse/lspace_subr.go index db15b85a..026e064f 100644 --- a/internal/native/sse/lspace_subr.go +++ b/internal/native/sse/lspace_subr.go @@ -21,9 +21,9 @@ const ( var ( _pcsp__lspace = [][2]uint32{ - {1, 0}, - {85, 8}, - {87, 0}, + {0x1, 0}, + {0x56, 8}, + {0x57, 0}, } ) diff --git a/internal/native/sse/native_export.go b/internal/native/sse/native_export.go index 8cd16101..f85208c7 100644 --- a/internal/native/sse/native_export.go +++ b/internal/native/sse/native_export.go @@ -1,3 +1,6 @@ + +// Code generated by Makefile, DO NOT EDIT. + /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/sse/native_test.go b/internal/native/sse/native_test.go index 7f2d766a..3295f295 100644 --- a/internal/native/sse/native_test.go +++ b/internal/native/sse/native_test.go @@ -1,8 +1,6 @@ // +build amd64 -// Code generated by Makefile, DO NOT EDIT. - // Code generated by Makefile, DO NOT EDIT. /* diff --git a/internal/native/sse/quote.go b/internal/native/sse/quote.go index debc7a20..d08eb233 100644 --- a/internal/native/sse/quote.go +++ b/internal/native/sse/quote.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/sse/quote_subr.go b/internal/native/sse/quote_subr.go index 6b550595..2aa25d66 100644 --- a/internal/native/sse/quote_subr.go +++ b/internal/native/sse/quote_subr.go @@ -21,22 +21,22 @@ const ( var ( _pcsp__quote = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {1701, 80}, - {1705, 48}, - {1706, 40}, - {1708, 32}, - {1710, 24}, - {1712, 16}, - {1714, 8}, - {1715, 0}, - {1760, 80}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x6a9, 80}, + {0x6aa, 48}, + {0x6ac, 40}, + {0x6ae, 32}, + {0x6b0, 24}, + {0x6b2, 16}, + {0x6b3, 8}, + {0x6b4, 0}, + {0x6e0, 80}, } ) diff --git a/internal/native/sse/recover_test.go b/internal/native/sse/recover_test.go index c3358f43..5416de53 100644 --- a/internal/native/sse/recover_test.go +++ b/internal/native/sse/recover_test.go @@ -40,9 +40,9 @@ var ( debugAsyncGC = os.Getenv("SONIC_NO_ASYNC_GC") == "" ) + func TestMain(m *testing.M) { Use() - go func () { if !debugAsyncGC { return diff --git a/internal/native/sse/skip_array.go b/internal/native/sse/skip_array.go index 0279a903..75849014 100644 --- a/internal/native/sse/skip_array.go +++ b/internal/native/sse/skip_array.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/sse/skip_array_subr.go b/internal/native/sse/skip_array_subr.go index e588e404..14688e87 100644 --- a/internal/native/sse/skip_array_subr.go +++ b/internal/native/sse/skip_array_subr.go @@ -21,22 +21,22 @@ const ( var ( _pcsp__skip_array = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {9907, 160}, - {9911, 48}, - {9912, 40}, - {9914, 32}, - {9916, 24}, - {9918, 16}, - {9920, 8}, - {9921, 0}, - {10428, 160}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x26b7, 160}, + {0x26b8, 48}, + {0x26ba, 40}, + {0x26bc, 32}, + {0x26be, 24}, + {0x26c0, 16}, + {0x26c1, 8}, + {0x26c2, 0}, + {0x28bc, 160}, } ) diff --git a/internal/native/sse/skip_number.go b/internal/native/sse/skip_number.go index 90075615..f01befa2 100644 --- a/internal/native/sse/skip_number.go +++ b/internal/native/sse/skip_number.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/sse/skip_number_subr.go b/internal/native/sse/skip_number_subr.go index 4387693e..784a5f61 100644 --- a/internal/native/sse/skip_number_subr.go +++ b/internal/native/sse/skip_number_subr.go @@ -21,22 +21,22 @@ const ( var ( _pcsp__skip_number = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {879, 72}, - {883, 48}, - {884, 40}, - {886, 32}, - {888, 24}, - {890, 16}, - {892, 8}, - {893, 0}, - {1060, 72}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x373, 72}, + {0x374, 48}, + {0x376, 40}, + {0x378, 32}, + {0x37a, 24}, + {0x37c, 16}, + {0x37d, 8}, + {0x37e, 0}, + {0x424, 72}, } ) diff --git a/internal/native/sse/skip_object.go b/internal/native/sse/skip_object.go index 8cdec045..1d6cb9be 100644 --- a/internal/native/sse/skip_object.go +++ b/internal/native/sse/skip_object.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/sse/skip_object_subr.go b/internal/native/sse/skip_object_subr.go index ef321db5..71cae6f5 100644 --- a/internal/native/sse/skip_object_subr.go +++ b/internal/native/sse/skip_object_subr.go @@ -21,22 +21,22 @@ const ( var ( _pcsp__skip_object = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {9907, 160}, - {9911, 48}, - {9912, 40}, - {9914, 32}, - {9916, 24}, - {9918, 16}, - {9920, 8}, - {9921, 0}, - {10428, 160}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x26b7, 160}, + {0x26b8, 48}, + {0x26ba, 40}, + {0x26bc, 32}, + {0x26be, 24}, + {0x26c0, 16}, + {0x26c1, 8}, + {0x26c2, 0}, + {0x28bc, 160}, } ) diff --git a/internal/native/sse/skip_one.go b/internal/native/sse/skip_one.go index fa8775d5..62833f6e 100644 --- a/internal/native/sse/skip_one.go +++ b/internal/native/sse/skip_one.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/sse/skip_one_fast.go b/internal/native/sse/skip_one_fast.go index 4e429056..9673ffd9 100644 --- a/internal/native/sse/skip_one_fast.go +++ b/internal/native/sse/skip_one_fast.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/sse/skip_one_fast_subr.go b/internal/native/sse/skip_one_fast_subr.go index 13da7f5a..bb2f481d 100644 --- a/internal/native/sse/skip_one_fast_subr.go +++ b/internal/native/sse/skip_one_fast_subr.go @@ -21,22 +21,22 @@ const ( var ( _pcsp__skip_one_fast = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {600, 136}, - {604, 48}, - {605, 40}, - {607, 32}, - {609, 24}, - {611, 16}, - {613, 8}, - {614, 0}, - {3348, 136}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x25c, 136}, + {0x25d, 48}, + {0x25f, 40}, + {0x261, 32}, + {0x263, 24}, + {0x265, 16}, + {0x266, 8}, + {0x267, 0}, + {0xd14, 136}, } ) diff --git a/internal/native/sse/skip_one_subr.go b/internal/native/sse/skip_one_subr.go index d35a1182..ef9901ed 100644 --- a/internal/native/sse/skip_one_subr.go +++ b/internal/native/sse/skip_one_subr.go @@ -21,22 +21,22 @@ const ( var ( _pcsp__skip_one = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {9907, 160}, - {9911, 48}, - {9912, 40}, - {9914, 32}, - {9916, 24}, - {9918, 16}, - {9920, 8}, - {9921, 0}, - {10428, 160}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x26b7, 160}, + {0x26b8, 48}, + {0x26ba, 40}, + {0x26bc, 32}, + {0x26be, 24}, + {0x26c0, 16}, + {0x26c1, 8}, + {0x26c2, 0}, + {0x28bc, 160}, } ) diff --git a/internal/native/sse/u64toa.go b/internal/native/sse/u64toa.go index a61ee7b0..8149027d 100644 --- a/internal/native/sse/u64toa.go +++ b/internal/native/sse/u64toa.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/sse/u64toa_subr.go b/internal/native/sse/u64toa_subr.go index 756a75d2..297cb9be 100644 --- a/internal/native/sse/u64toa_subr.go +++ b/internal/native/sse/u64toa_subr.go @@ -21,15 +21,15 @@ const ( var ( _pcsp__u64toa = [][2]uint32{ - {1, 0}, - {164, 8}, - {165, 0}, - {462, 8}, - {463, 0}, - {774, 8}, - {775, 0}, - {1230, 8}, - {1232, 0}, + {0x1, 0}, + {0xa5, 8}, + {0xa6, 0}, + {0x1cf, 8}, + {0x1d0, 0}, + {0x307, 8}, + {0x308, 0}, + {0x4cf, 8}, + {0x4d0, 0}, } ) diff --git a/internal/native/sse/unquote.go b/internal/native/sse/unquote.go index 31d41575..4249d892 100644 --- a/internal/native/sse/unquote.go +++ b/internal/native/sse/unquote.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/sse/unquote_subr.go b/internal/native/sse/unquote_subr.go index be138979..13b52b1f 100644 --- a/internal/native/sse/unquote_subr.go +++ b/internal/native/sse/unquote_subr.go @@ -21,22 +21,22 @@ const ( var ( _pcsp__unquote = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {1341, 80}, - {1345, 48}, - {1346, 40}, - {1348, 32}, - {1350, 24}, - {1352, 16}, - {1354, 8}, - {1355, 0}, - {2096, 80}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x541, 80}, + {0x542, 48}, + {0x544, 40}, + {0x546, 32}, + {0x548, 24}, + {0x54a, 16}, + {0x54b, 8}, + {0x54c, 0}, + {0x830, 80}, } ) diff --git a/internal/native/sse/validate_one.go b/internal/native/sse/validate_one.go index 44e93f5b..f5fdd663 100644 --- a/internal/native/sse/validate_one.go +++ b/internal/native/sse/validate_one.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/sse/validate_one_subr.go b/internal/native/sse/validate_one_subr.go index d3de7255..e2ee77c7 100644 --- a/internal/native/sse/validate_one_subr.go +++ b/internal/native/sse/validate_one_subr.go @@ -21,22 +21,22 @@ const ( var ( _pcsp__validate_one = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {9907, 160}, - {9911, 48}, - {9912, 40}, - {9914, 32}, - {9916, 24}, - {9918, 16}, - {9920, 8}, - {9921, 0}, - {10428, 160}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x26b7, 160}, + {0x26b8, 48}, + {0x26ba, 40}, + {0x26bc, 32}, + {0x26be, 24}, + {0x26c0, 16}, + {0x26c1, 8}, + {0x26c2, 0}, + {0x28bc, 160}, } ) diff --git a/internal/native/sse/validate_utf8.go b/internal/native/sse/validate_utf8.go index 158a547c..a4f8418e 100644 --- a/internal/native/sse/validate_utf8.go +++ b/internal/native/sse/validate_utf8.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/sse/validate_utf8_fast.go b/internal/native/sse/validate_utf8_fast.go index f96875a8..2b9b1049 100644 --- a/internal/native/sse/validate_utf8_fast.go +++ b/internal/native/sse/validate_utf8_fast.go @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/sse/validate_utf8_fast_subr.go b/internal/native/sse/validate_utf8_fast_subr.go index c310f6d0..a46e4088 100644 --- a/internal/native/sse/validate_utf8_fast_subr.go +++ b/internal/native/sse/validate_utf8_fast_subr.go @@ -21,17 +21,17 @@ const ( var ( _pcsp__validate_utf8_fast = [][2]uint32{ - {1, 0}, - {4, 8}, - {5, 16}, - {247, 24}, - {251, 16}, - {252, 8}, - {253, 0}, - {527, 24}, - {531, 16}, - {532, 8}, - {536, 0}, + {0x1, 0}, + {0x5, 8}, + {0x6, 16}, + {0xfb, 24}, + {0xfc, 16}, + {0xfd, 8}, + {0xfe, 0}, + {0x213, 24}, + {0x214, 16}, + {0x215, 8}, + {0x218, 0}, } ) diff --git a/internal/native/sse/validate_utf8_subr.go b/internal/native/sse/validate_utf8_subr.go index 8cce007f..0c051f8b 100644 --- a/internal/native/sse/validate_utf8_subr.go +++ b/internal/native/sse/validate_utf8_subr.go @@ -21,20 +21,20 @@ const ( var ( _pcsp__validate_utf8 = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {11, 40}, - {639, 48}, - {643, 40}, - {644, 32}, - {646, 24}, - {648, 16}, - {650, 8}, - {651, 0}, - {684, 48}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xb, 32}, + {0xc, 40}, + {0x283, 48}, + {0x284, 40}, + {0x286, 32}, + {0x288, 24}, + {0x28a, 16}, + {0x28b, 8}, + {0x28c, 0}, + {0x2ac, 48}, } ) diff --git a/internal/native/sse/value_subr.go b/internal/native/sse/value_subr.go index 94972e83..20cc86bb 100644 --- a/internal/native/sse/value_subr.go +++ b/internal/native/sse/value_subr.go @@ -21,22 +21,22 @@ const ( var ( _pcsp__value = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {518, 128}, - {522, 48}, - {523, 40}, - {525, 32}, - {527, 24}, - {529, 16}, - {531, 8}, - {532, 0}, - {11788, 128}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x20a, 128}, + {0x20b, 48}, + {0x20d, 40}, + {0x20f, 32}, + {0x211, 24}, + {0x213, 16}, + {0x214, 8}, + {0x215, 0}, + {0x2e0c, 128}, } ) diff --git a/internal/native/sse/vnumber_subr.go b/internal/native/sse/vnumber_subr.go index edcb999c..46a0d181 100644 --- a/internal/native/sse/vnumber_subr.go +++ b/internal/native/sse/vnumber_subr.go @@ -21,21 +21,21 @@ const ( var ( _pcsp__vnumber = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {7863, 136}, - {7867, 48}, - {7868, 40}, - {7870, 32}, - {7872, 24}, - {7874, 16}, - {7876, 8}, - {7880, 0}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x1ebb, 136}, + {0x1ebc, 48}, + {0x1ebe, 40}, + {0x1ec0, 32}, + {0x1ec2, 24}, + {0x1ec4, 16}, + {0x1ec5, 8}, + {0x1ec8, 0}, } ) diff --git a/internal/native/sse/vsigned_subr.go b/internal/native/sse/vsigned_subr.go index 824c404a..1b251476 100644 --- a/internal/native/sse/vsigned_subr.go +++ b/internal/native/sse/vsigned_subr.go @@ -21,26 +21,26 @@ const ( var ( _pcsp__vsigned = [][2]uint32{ - {1, 0}, - {4, 8}, - {111, 16}, - {112, 8}, - {113, 0}, - {124, 16}, - {125, 8}, - {126, 0}, - {278, 16}, - {279, 8}, - {280, 0}, - {284, 16}, - {285, 8}, - {286, 0}, - {340, 16}, - {341, 8}, - {342, 0}, - {353, 16}, - {354, 8}, - {356, 0}, + {0x1, 0}, + {0x5, 8}, + {0x70, 16}, + {0x71, 8}, + {0x72, 0}, + {0x7d, 16}, + {0x7e, 8}, + {0x7f, 0}, + {0x117, 16}, + {0x118, 8}, + {0x119, 0}, + {0x11d, 16}, + {0x11e, 8}, + {0x11f, 0}, + {0x155, 16}, + {0x156, 8}, + {0x157, 0}, + {0x162, 16}, + {0x163, 8}, + {0x164, 0}, } ) diff --git a/internal/native/sse/vstring_subr.go b/internal/native/sse/vstring_subr.go index 7a6e6718..ba4a588f 100644 --- a/internal/native/sse/vstring_subr.go +++ b/internal/native/sse/vstring_subr.go @@ -21,22 +21,22 @@ const ( var ( _pcsp__vstring = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {8, 24}, - {10, 32}, - {12, 40}, - {13, 48}, - {2221, 104}, - {2225, 48}, - {2226, 40}, - {2228, 32}, - {2230, 24}, - {2232, 16}, - {2234, 8}, - {2235, 0}, - {2396, 104}, + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x8b1, 104}, + {0x8b2, 48}, + {0x8b4, 40}, + {0x8b6, 32}, + {0x8b8, 24}, + {0x8ba, 16}, + {0x8bb, 8}, + {0x8bc, 0}, + {0x95c, 104}, } ) diff --git a/internal/native/sse/vunsigned_subr.go b/internal/native/sse/vunsigned_subr.go index bb213568..aa3cfc20 100644 --- a/internal/native/sse/vunsigned_subr.go +++ b/internal/native/sse/vunsigned_subr.go @@ -21,33 +21,33 @@ const ( var ( _pcsp__vunsigned = [][2]uint32{ - {1, 0}, - {4, 8}, - {6, 16}, - {72, 24}, - {73, 16}, - {75, 8}, - {76, 0}, - {87, 24}, - {88, 16}, - {90, 8}, - {91, 0}, - {114, 24}, - {115, 16}, - {117, 8}, - {118, 0}, - {281, 24}, - {282, 16}, - {284, 8}, - {285, 0}, - {336, 24}, - {337, 16}, - {339, 8}, - {340, 0}, - {348, 24}, - {349, 16}, - {351, 8}, - {356, 0}, + {0x1, 0}, + {0x6, 8}, + {0x7, 16}, + {0x49, 24}, + {0x4b, 16}, + {0x4c, 8}, + {0x4d, 0}, + {0x58, 24}, + {0x5a, 16}, + {0x5b, 8}, + {0x5c, 0}, + {0x73, 24}, + {0x75, 16}, + {0x76, 8}, + {0x77, 0}, + {0x11a, 24}, + {0x11c, 16}, + {0x11d, 8}, + {0x11e, 0}, + {0x151, 24}, + {0x153, 16}, + {0x154, 8}, + {0x155, 0}, + {0x15d, 24}, + {0x15f, 16}, + {0x160, 8}, + {0x164, 0}, } ) diff --git a/internal/native/traceback_test.mock_tmpl b/internal/native/traceback_test.mock_tmpl new file mode 100644 index 00000000..840924db --- /dev/null +++ b/internal/native/traceback_test.mock_tmpl @@ -0,0 +1,359 @@ + +// +build !race,amd64,go1.16,!go1.23 + +// Code generated by Makefile, DO NOT EDIT. + +/* + * Copyright 2021 ByteDance Inc. + * + * Licensed under the Apache License, Version 2.0 (the License ); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package {{PACKAGE}} + +import ( + "unsafe" + "testing" + + "github.com/bytedance/sonic/loader" +) + +// copied from g01.20.4 signal_linux_amd64.go +type sigctxt struct { + info unsafe.Pointer + ctxt unsafe.Pointer +} + +type stackt struct { + ss_sp *byte + ss_flags int32 + pad_cgo_0 [4]byte + ss_size uintptr +} + +type mcontext struct { + gregs [23]uint64 + fpregs unsafe.Pointer + __reserved1 [8]uint64 +} + +type sigcontext struct { + r8 uint64 + r9 uint64 + r10 uint64 + r11 uint64 + r12 uint64 + r13 uint64 + r14 uint64 + r15 uint64 + rdi uint64 + rsi uint64 + rbp uint64 + rbx uint64 + rdx uint64 + rax uint64 + rcx uint64 + rsp uint64 + rip uint64 + eflags uint64 + cs uint16 + gs uint16 + fs uint16 + __pad0 uint16 + err uint64 + trapno uint64 + oldmask uint64 + cr2 uint64 + fpstate unsafe.Pointer + __reserved1 [8]uint64 +} +type ucontext struct { + uc_flags uint64 + uc_link *ucontext + uc_stack stackt + uc_mcontext mcontext +} + +//go:nosplit +func (c *sigctxt) regs() *sigcontext { + return (*sigcontext)(unsafe.Pointer(&(*ucontext)(c.ctxt).uc_mcontext)) +} + +func (c *sigctxt) rsp() uint64 { return c.regs().rsp } + +//go:nosplit +func (c *sigctxt) sigpc() uintptr { return uintptr(c.rip()) } + +//go:nosplit +func (c *sigctxt) rip() uint64 { return c.regs().rip } +func (c *sigctxt) sigsp() uintptr { return uintptr(c.rsp()) } +func (c *sigctxt) siglr() uintptr { return 0 } + +// only used for test sonic trace +//go:linkname testSigtrap runtime.testSigtrap +var testSigtrap func(info unsafe.Pointer, c *sigctxt, gp unsafe.Pointer) bool + +func init() { + if testSigtrap == nil { + testSigtrap = sonicSigTrap + } +} + +//go:linkname traceback1 runtime.traceback1 +func traceback1(pc, sp, lr uintptr, gp unsafe.Pointer, flags uint); + +func sonicSigTrap(info unsafe.Pointer, c *sigctxt, gp unsafe.Pointer) bool { + pc := c.sigpc() + sp := c.sigsp() + lr := c.siglr() + traceback1(pc, sp, lr, gp, 0); + return true +} + + +// =================== register mocked functions =================== + +var F_mock_f32toa func() +var S_mock_f32toa uintptr + +//go:nosplit +func mock_f32toa() { + F_mock_f32toa() +} + +var F_mock_f64toa func() +var S_mock_f64toa uintptr + +//go:nosplit +func mock_f64toa() { + F_mock_f64toa() +} + +var F_mock_get_by_path func() +var S_mock_get_by_path uintptr + +//go:nosplit +func mock_get_by_path() { + F_mock_get_by_path() +} + +var F_mock_html_escape func() +var S_mock_html_escape uintptr + +//go:nosplit +func mock_html_escape() { + F_mock_html_escape() +} + +var F_mock_i64toa func() +var S_mock_i64toa uintptr + +//go:nosplit +func mock_i64toa() { + F_mock_i64toa() +} + +var F_mock_lspace func() +var S_mock_lspace uintptr + +//go:nosplit +func mock_lspace() { + F_mock_lspace() +} + +var F_mock_quote func() +var S_mock_quote uintptr + +//go:nosplit +func mock_quote() { + F_mock_quote() +} + +var F_mock_skip_array func() +var S_mock_skip_array uintptr + +//go:nosplit +func mock_skip_array() { + F_mock_skip_array() +} + +var F_mock_skip_number func() +var S_mock_skip_number uintptr + +//go:nosplit +func mock_skip_number() { + F_mock_skip_number() +} + +var F_mock_skip_one func() +var S_mock_skip_one uintptr + +//go:nosplit +func mock_skip_one() { + F_mock_skip_one() +} + +var F_mock_skip_object func() +var S_mock_skip_object uintptr + +//go:nosplit +func mock_skip_object() { + F_mock_skip_object() +} + +var F_mock_skip_one_fast func() +var S_mock_skip_one_fast uintptr + +//go:nosplit +func mock_skip_one_fast() { + F_mock_skip_one_fast() +} + +var F_mock_u64toa func() +var S_mock_u64toa uintptr + +//go:nosplit +func mock_u64toa() { + F_mock_u64toa() +} + +var F_mock_unquote func() +var S_mock_unquote uintptr + +//go:nosplit +func mock_unquote() { + F_mock_unquote() +} + +var F_mock_validate_one func() +var S_mock_validate_one uintptr + +//go:nosplit +func mock_validate_one() { + F_mock_validate_one() +} + +var F_mock_validate_utf8 func() +var S_mock_validate_utf8 uintptr + +//go:nosplit +func mock_validate_utf8() { + F_mock_validate_utf8() +} + +var F_mock_validate_utf8_fast func() +var S_mock_validate_utf8_fast uintptr + +//go:nosplit +func mock_validate_utf8_fast() { + F_mock_validate_utf8_fast() +} + +var F_mock_vnumber func() +var S_mock_vnumber uintptr + +//go:nosplit +func mock_vnumber() { + F_mock_vnumber() +} + +var F_mock_vsigned func() +var S_mock_vsigned uintptr + +//go:nosplit +func mock_vsigned() { + F_mock_vsigned() +} + +var F_mock_vunsigned func() +var S_mock_vunsigned uintptr + +//go:nosplit +func mock_vunsigned() { + F_mock_vunsigned() +} + +var F_mock_vstring func() +var S_mock_vstring uintptr + +//go:nosplit +func mock_vstring() { + F_mock_vstring() +} + +var F_mock_value func() +var S_mock_value uintptr + +//go:nosplit +func mock_value() { + F_mock_value() +} + +func init() { + Mock() +} + +func Mock() { + loader.WrapGoC(_mock_text_f64toa, _cfunc_f64toa, []loader.GoC{{"_f64toa", &S_mock_f64toa, &F_mock_f64toa}}, "{{PACKAGE}}", "{{PACKAGE}}/f64toa.c") + loader.WrapGoC(_mock_text_f32toa, _cfunc_f32toa, []loader.GoC{{"_f32toa", &S_mock_f32toa, &F_mock_f32toa}}, "{{PACKAGE}}", "{{PACKAGE}}/f32toa.c") + loader.WrapGoC(_mock_text_get_by_path, _cfunc_get_by_path, []loader.GoC{{"_get_by_path", &S_mock_get_by_path, &F_mock_get_by_path}}, "{{PACKAGE}}", "{{PACKAGE}}/get_by_path.c") + loader.WrapGoC(_mock_text_html_escape, _cfunc_html_escape, []loader.GoC{{"_html_escape", &S_mock_html_escape, &F_mock_html_escape}}, "{{PACKAGE}}", "{{PACKAGE}}/html_escape.c") + loader.WrapGoC(_mock_text_i64toa, _cfunc_i64toa, []loader.GoC{{"_i64toa", &S_mock_i64toa, &F_mock_i64toa}}, "{{PACKAGE}}", "{{PACKAGE}}/i64toa.c") + loader.WrapGoC(_mock_text_lspace, _cfunc_lspace, []loader.GoC{{"_lspace", &S_mock_lspace, &F_mock_lspace}}, "{{PACKAGE}}", "{{PACKAGE}}/lspace.c") + loader.WrapGoC(_mock_text_quote, _cfunc_quote, []loader.GoC{{"_quote", &S_mock_quote, &F_mock_quote}}, "{{PACKAGE}}", "{{PACKAGE}}/quote.c") + loader.WrapGoC(_mock_text_skip_array, _cfunc_skip_array, []loader.GoC{{"_skip_array", &S_mock_skip_array, &F_mock_skip_array}}, "{{PACKAGE}}", "{{PACKAGE}}/skip_array.c") + loader.WrapGoC(_mock_text_skip_number, _cfunc_skip_number, []loader.GoC{{"_skip_number", &S_mock_skip_number, &F_mock_skip_number}}, "{{PACKAGE}}", "{{PACKAGE}}/skip_number.c") + loader.WrapGoC(_mock_text_skip_one, _cfunc_skip_one, []loader.GoC{{"_skip_one", &S_mock_skip_one, &F_mock_skip_one}}, "{{PACKAGE}}", "{{PACKAGE}}/skip_one.c") + loader.WrapGoC(_mock_text_skip_object, _cfunc_skip_object, []loader.GoC{{"_skip_object", &S_mock_skip_object, &F_mock_skip_object}}, "{{PACKAGE}}", "{{PACKAGE}}/skip_object.c") + loader.WrapGoC(_mock_text_skip_one_fast, _cfunc_skip_one_fast, []loader.GoC{{"_skip_one_fast", &S_mock_skip_one_fast, &F_mock_skip_one_fast}}, "{{PACKAGE}}", "{{PACKAGE}}/skip_one_fast.c") + loader.WrapGoC(_mock_text_u64toa, _cfunc_u64toa, []loader.GoC{{"_u64toa", &S_mock_u64toa, &F_mock_u64toa}}, "{{PACKAGE}}", "{{PACKAGE}}/u64toa.c") + loader.WrapGoC(_mock_text_unquote, _cfunc_unquote, []loader.GoC{{"_unquote", &S_mock_unquote, &F_mock_unquote}}, "{{PACKAGE}}", "{{PACKAGE}}/unquote.c") + loader.WrapGoC(_mock_text_validate_one, _cfunc_validate_one, []loader.GoC{{"_validate_one", &S_mock_validate_one, &F_mock_validate_one}}, "{{PACKAGE}}", "{{PACKAGE}}/validate_one.c") + loader.WrapGoC(_mock_text_validate_utf8, _cfunc_validate_utf8, []loader.GoC{{"_validate_utf8", &S_mock_validate_utf8, &F_mock_validate_utf8}}, "{{PACKAGE}}", "{{PACKAGE}}/validate_utf8.c") + loader.WrapGoC(_mock_text_validate_utf8_fast, _cfunc_validate_utf8_fast, []loader.GoC{{"_validate_utf8_fast", &S_mock_validate_utf8_fast, &F_mock_validate_utf8_fast}}, "{{PACKAGE}}", "{{PACKAGE}}/validate_utf8_fast.c") + loader.WrapGoC(_mock_text_vnumber, _cfunc_vnumber, []loader.GoC{{"_vnumber", &S_mock_vnumber, &F_mock_vnumber}}, "{{PACKAGE}}", "{{PACKAGE}}/vnumber.c") + loader.WrapGoC(_mock_text_vsigned, _cfunc_vsigned, []loader.GoC{{"_vsigned", &S_mock_vsigned, &F_mock_vsigned}}, "{{PACKAGE}}", "{{PACKAGE}}/vsigned.c") + loader.WrapGoC(_mock_text_vunsigned, _cfunc_vunsigned, []loader.GoC{{"_vunsigned", &S_mock_vunsigned, &F_mock_vunsigned}}, "{{PACKAGE}}", "{{PACKAGE}}/vunsigned.c") + loader.WrapGoC(_mock_text_vstring, _cfunc_vstring, []loader.GoC{{"_vstring", &S_mock_vstring, &F_mock_vstring}}, "{{PACKAGE}}", "{{PACKAGE}}/vstring.c") + loader.WrapGoC(_mock_text_value, _cfunc_value, []loader.GoC{{"_value", &S_mock_value, &F_mock_value}}, "{{PACKAGE}}", "{{PACKAGE}}/value.c") +} + +func TestTraceback(t *testing.T) { + tests := []func() { + mock_lspace, + mock_f32toa, + mock_f64toa, + mock_html_escape, + mock_i64toa, + mock_quote, + mock_skip_array, + mock_skip_number, + mock_skip_one, + mock_get_by_path, + mock_skip_object, + mock_skip_one_fast, + mock_u64toa, + mock_unquote, + mock_validate_one, + mock_validate_utf8, + mock_validate_utf8_fast, + mock_vnumber, + mock_vsigned, + mock_vunsigned, + mock_vstring, + mock_value, + } + for _, f := range tests { + f() + } +} diff --git a/internal/native/u64toa.tmpl b/internal/native/u64toa.tmpl index 1c15b6b3..451276e9 100644 --- a/internal/native/u64toa.tmpl +++ b/internal/native/u64toa.tmpl @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/unquote.tmpl b/internal/native/unquote.tmpl index a8a155d2..d87ecd31 100644 --- a/internal/native/unquote.tmpl +++ b/internal/native/unquote.tmpl @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/validate_one.tmpl b/internal/native/validate_one.tmpl index 280d74f4..592065c4 100644 --- a/internal/native/validate_one.tmpl +++ b/internal/native/validate_one.tmpl @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/validate_utf8.tmpl b/internal/native/validate_utf8.tmpl index b091beb6..3bb6ffe2 100644 --- a/internal/native/validate_utf8.tmpl +++ b/internal/native/validate_utf8.tmpl @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/internal/native/validate_utf8_fast.tmpl b/internal/native/validate_utf8_fast.tmpl index 5d661c22..0d370f65 100644 --- a/internal/native/validate_utf8_fast.tmpl +++ b/internal/native/validate_utf8_fast.tmpl @@ -1,7 +1,5 @@ // Code generated by Makefile, DO NOT EDIT. -// Code generated by Makefile, DO NOT EDIT. - /* * Copyright 2021 ByteDance Inc. * diff --git a/scripts/build-x86.sh b/scripts/build-x86.sh index 78425ee8..a9800ce1 100755 --- a/scripts/build-x86.sh +++ b/scripts/build-x86.sh @@ -25,6 +25,7 @@ CLAGS=( ) i=0 + for arc in "${CPU_ARCS[@]}"; do # Create the output directory if it doesn't exist out_dir="$OUT_DIR/$arc" @@ -52,7 +53,6 @@ for arc in "${CPU_ARCS[@]}"; do # Execute asm2asm tool python3 $TOOL_DIR/asm2asm.py -r $out_dir/${base_name}.go $asm_file - done # should check the output assembly files diff --git a/scripts/test_pcsp.py b/scripts/test_pcsp.py new file mode 100755 index 00000000..ade51de6 --- /dev/null +++ b/scripts/test_pcsp.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import os +import glob +import re + +MOCKED_FILES=[] + +def make_output_file(stub_file: str) -> str: + fpath = os.path.splitext(stub_file)[0] + return fpath + '_text_amd64.go' + +def run_cmd(cmd :str): + print(cmd) + if os.system(cmd): + clear_files() + print ("Failed to run cmd: %s"%(cmd)) + exit(1) + +def make_mock_file(prefix :str) -> str: + asm = [] + # read the asm binary + with open(prefix + '_text_amd64.go') as fp: + asm.extend(fp.read().splitlines()) + + # dump the mocked function + fpath = prefix + '_mock_text_amd64_test.go' + with open(fpath, 'w') as fp: + for line in asm: + # replace stubr + if "var _text_" in line: + line = line.replace("var _text_", "var _mock_text_") + + # check all non-sp instructions + subsp = "subq" in line and ", %rsp" in line + addsp = "addq" in line and ", %rsp" in line + movbp = "movq" in line and ", %rbp" in line + popq = "popq" in line + pushq = "pushq" in line + ret = "retq" in line and "0xc3," in line + leaq = "leaq" in line and ", %rsp" in line + + # replace all non-sp instructions + if "//" in line and not subsp and not addsp and not popq and not pushq and not ret and not leaq and not movbp: + newline = re.sub(r"0x\w{2}", "0xcc", line.split("//")[0]) + "//" + line.split("//")[1] + else: + newline = line + print(newline, file = fp) + + print(f"Mocked text file generated: {fpath}") + return fpath + +def clear_files(): + for fpath in MOCKED_FILES: + run_cmd(f"rm -vrf {fpath}") + + run_cmd("rm -vrf ./internal/native/sse/traceback_test.go") + run_cmd("rm -vrf ./internal/native/avx2/traceback_test.go") + +def main(): + TRACE_TEST_FILE = "./internal/native/traceback_test.mock_tmpl" + pattern = "*_text_amd64.go" + + # generate mocked function files + global MOCKED_FILES + for dir in [ "./internal/native/avx2/", "./internal/native/sse/"]: + for filepath in glob.glob(os.path.join(dir, pattern)): + prefix = filepath.replace("_text_amd64.go", "") + print(prefix) + MOCKED_FILES.append(make_mock_file(prefix)) + + # generate mocked trace test file + run_cmd("sed -e 's/{{PACKAGE}}/sse/g' %s > ./internal/native/sse/traceback_test.go" %TRACE_TEST_FILE) + run_cmd("sed -e 's/{{PACKAGE}}/avx2/g' %s > ./internal/native/avx2/traceback_test.go" %TRACE_TEST_FILE) + + # test the pcsp with Golang + run_cmd("go version") + run_cmd("go test -v -run=TestTraceback ./... > test.log") + run_cmd("grep -q \"runtime: \" test.log && exit 1 || exit 0") + + clear_files() + + +if __name__ == '__main__': + main() diff --git a/tools/asm2asm b/tools/asm2asm index dc6e1ef7..8151d05a 160000 --- a/tools/asm2asm +++ b/tools/asm2asm @@ -1 +1 @@ -Subproject commit dc6e1ef7e7a666d8fd134224de392f4b4752270a +Subproject commit 8151d05a43d3afaa55738a40d9870e6e2cdf200a