Carry full source positions through the Rust bytecode source map so stack traces and other bytecode-backed source lookups can use them directly. This keeps exception-heavy paths from reconstructing line and column information through SourceCode::range_from_offsets(), which can spend a lot of time building SourceCode's position cache on first use. We're trading some space for time here, but I believe it's worth it at this tag, as this saves ~250ms of main thread time while loading https://x.com/ on my Linux machine. :^) Reading the stored Position out of the source map directly also exposed two things masked by the old range_from_offsets() path: a latent off-by-one in Lexer::new_at_offset() (its consume() bumped line_column past the character at offset; only synthesize_binding_pattern() hit it), and a (1,1) fallback in range_from_offsets() that fired whenever the queried range reached EOF. Fix the lexer, then rebaseline both the bytecode dump tests (no more spurious "1:1") and the destructuring AST tests (binding-pattern identifiers now report their real columns).
70 lines
2 KiB
Text
70 lines
2 KiB
Text
$c0e94b43 chained-member-call.js:12:1
|
|
Registers: 10
|
|
Blocks: 7
|
|
Constants:
|
|
[0] = Undefined
|
|
[1] = Int32(0)
|
|
|
|
block0:
|
|
[ 0] GetLexicalEnvironment dst:reg4
|
|
[ 8] Jump target:block3
|
|
|
|
block1:
|
|
[ 10] Catch dst:reg5
|
|
[ 18] SetLexicalEnvironment environment:reg4
|
|
[ 20] Mov2 dst1:reg6, src1:Undefined, dst2:reg7, src2:reg6
|
|
|
|
block2:
|
|
[ 38] Jump target:block6
|
|
|
|
block3:
|
|
[ 40] Mov dst:reg5, src:Undefined
|
|
[ 50] GetGlobal dst:reg8, `chained_computed_call`
|
|
[ 68] Call dst:reg6, callee:reg8, this_value:Undefined, chained_computed_call, arguments:[Int32(0), Int32(0), Int32(0)]
|
|
[ 98] Mov2 dst1:reg5, src1:reg6, dst2:reg6, src2:reg5
|
|
[ b0] Jump target:block2
|
|
|
|
block4:
|
|
[ b8] Catch dst:reg5
|
|
[ c0] SetLexicalEnvironment environment:reg4
|
|
[ c8] Mov2 dst1:reg7, src1:Undefined, dst2:reg8, src2:reg7
|
|
|
|
block5:
|
|
[ e0] End value:reg7
|
|
|
|
block6:
|
|
[ e8] Mov dst:reg5, src:Undefined
|
|
[ f8] GetGlobal dst:reg9, `chained_dot_call`
|
|
[ 110] Call dst:reg7, callee:reg9, this_value:Undefined, chained_dot_call, arguments:[Int32(0)]
|
|
[ 138] Mov2 dst1:reg5, src1:reg7, dst2:reg7, src2:reg5
|
|
[ 150] End value:reg7
|
|
|
|
Exception handlers:
|
|
[ 40 .. b8] => handler block1
|
|
[ e8 .. 158] => handler block4
|
|
|
|
|
|
chained_computed_call$df45ff7f chained-member-call.js:5:5
|
|
Registers: 8
|
|
Blocks: 1
|
|
|
|
block0:
|
|
[ 0] Mov dst:reg6, src:arg0
|
|
[ 10] GetByValue dst:reg7, base:reg6, property:arg1 (a[arg1])
|
|
[ 28] GetByValue dst:reg6, base:reg7, property:arg2 (a[j][arg2])
|
|
[ 40] GetById dst:reg7, base:reg6, `foo` (a[j][k].foo)
|
|
[ 60] Call dst:reg5, callee:reg7, this_value:reg6, a[j][k].foo
|
|
[ 80] Return value:reg5
|
|
|
|
|
|
chained_dot_call$9501e458 chained-member-call.js:9:5
|
|
Registers: 8
|
|
Blocks: 1
|
|
|
|
block0:
|
|
[ 0] Mov dst:reg6, src:arg0
|
|
[ 10] GetById dst:reg7, base:reg6, `b` (a.b)
|
|
[ 30] GetById dst:reg6, base:reg7, `c` (a.b.c)
|
|
[ 50] GetById dst:reg7, base:reg6, `bar` (a.b.c.bar)
|
|
[ 70] Call dst:reg5, callee:reg7, this_value:reg6, a.b.c.bar
|
|
[ 90] Return value:reg5
|