Merge pull request #21367 from RetroDev256/faster-tokenizer

Update the zig tokenizer to use labeled switch statements
This commit is contained in:
Andrew Kelley 2024-09-10 19:59:43 -07:00 committed by GitHub
commit b81782366b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 477 additions and 585 deletions

File diff suppressed because it is too large Load diff

View file

@ -6544,6 +6544,12 @@ pub const FuncGen = struct {
const jmp_table: ?SwitchDispatchInfo.JmpTable = jmp_table: { const jmp_table: ?SwitchDispatchInfo.JmpTable = jmp_table: {
if (!is_dispatch_loop) break :jmp_table null; if (!is_dispatch_loop) break :jmp_table null;
// Workaround for:
// * https://github.com/llvm/llvm-project/blob/56905dab7da50bccfcceaeb496b206ff476127e1/llvm/lib/MC/WasmObjectWriter.cpp#L560
// * https://github.com/llvm/llvm-project/blob/56905dab7da50bccfcceaeb496b206ff476127e1/llvm/test/MC/WebAssembly/blockaddress.ll
if (zcu.comp.getTarget().isWasm()) break :jmp_table null;
// On a 64-bit target, 1024 pointers in our jump table is about 8K of pointers. This seems just // On a 64-bit target, 1024 pointers in our jump table is about 8K of pointers. This seems just
// about acceptable - it won't fill L1d cache on most CPUs. // about acceptable - it won't fill L1d cache on most CPUs.
const max_table_len = 1024; const max_table_len = 1024;

Binary file not shown.