mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
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).
63 lines
1.5 KiB
Plaintext
63 lines
1.5 KiB
Plaintext
$3a924082 this-base-identifier.js:16:1
|
|
Registers: 10
|
|
Blocks: 4
|
|
Constants:
|
|
[0] = Undefined
|
|
|
|
block0:
|
|
[ 0] GetLexicalEnvironment dst:reg4
|
|
[ 8] GetGlobal dst:reg6, `get_from_this`
|
|
[ 20] Call dst:reg5, callee:reg6, this_value:Undefined, get_from_this
|
|
[ 40] GetGlobal dst:reg7, `set_on_this`
|
|
[ 58] Call dst:reg6, callee:reg7, this_value:Undefined, set_on_this
|
|
[ 78] Jump target:block3
|
|
|
|
block1:
|
|
[ 80] Catch dst:reg5
|
|
[ 88] SetLexicalEnvironment environment:reg4
|
|
[ 90] Mov2 dst1:reg7, src1:Undefined, dst2:reg8, src2:reg7
|
|
|
|
block2:
|
|
[ a8] End value:reg7
|
|
|
|
block3:
|
|
[ b0] Mov dst:reg5, src:Undefined
|
|
[ c0] GetGlobal dst:reg9, `chained_this_access`
|
|
[ d8] Call dst:reg7, callee:reg9, this_value:Undefined, chained_this_access
|
|
[ f8] Mov2 dst1:reg5, src1:reg7, dst2:reg7, src2:reg5
|
|
[ 110] End value:reg7
|
|
|
|
Exception handlers:
|
|
[ b0 .. 118] => handler block1
|
|
|
|
|
|
get_from_this$4bb390c8 this-base-identifier.js:5:5
|
|
Registers: 6
|
|
Blocks: 1
|
|
|
|
block0:
|
|
[ 0] GetById dst:reg5, base:this, `foo` (this.foo)
|
|
[ 20] Return value:reg5
|
|
|
|
|
|
set_on_this$453a2d11 this-base-identifier.js:9:14
|
|
Registers: 5
|
|
Blocks: 1
|
|
Constants:
|
|
[0] = Int32(1)
|
|
[1] = Undefined
|
|
|
|
block0:
|
|
[ 0] PutById base:this, `bar`, src:Int32(1), kind:Normal (this.bar)
|
|
[ 28] End value:Undefined
|
|
|
|
|
|
chained_this_access$48ebed63 this-base-identifier.js:13:5
|
|
Registers: 7
|
|
Blocks: 1
|
|
|
|
block0:
|
|
[ 0] GetById dst:reg5, base:this, `a` (this.a)
|
|
[ 20] GetById dst:reg6, base:reg5, `b` (this.a.b)
|
|
[ 40] Return value:reg6
|