GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Force context allocation of declared variables when replaying by Andarist · Pull Request #205 · replayio/node

Conversation

@Andarist

@Andarist Andarist commented Oct 28, 2026

Copy link
Copy Markdown
Member

Port of the force-variable-context-allocation feature (RUN-2604) from
Chromium's V8 (replayio/chromium-v8#191, replayio/chromium-v8#193): while
replaying, parameters and declared normal variables are context-allocated,
so frames inspected in a replay see their real values instead of registers
the bytecode no longer keeps alive. The feature is on by default and can be
disabled through the driver's feature list.

The first version of replayio/chromium-v8#191 marked every scope as having an
inner eval (replayio/chromium-v8@0c21ce8b9fa); it was replaced by these two
sites in replayio/chromium-v8@87e7cedff94 and is not ported.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Andarist added 2 commits October 28, 2026 20:32
@Andarist
Force context allocation of declared variables when replaying
5add763
Port of the force-variable-context-allocation feature (RUN-2604) from
Chromium's V8 (replayio/chromium-v8#191, replayio/chromium-v8#193): while
replaying, parameters and declared normal variables are context-allocated,
so frames inspected in a replay see their real values instead of registers
the bytecode no longer keeps alive. The feature is on by default and can be
disabled through the driver's feature list.

The first version of replayio/chromium-v8#191 marked every scope as having an
inner eval (replayio/chromium-v8@0c21ce8b9fa); it was replaced by these two
sites in replayio/chromium-v8@87e7cedff94 and is not ported.
@Andarist
Also force context allocation of sloppy block functions when replaying
0350335
A function declared in a block of sloppy-mode code is declared with kind
SLOPPY_BLOCK_FUNCTION_VARIABLE, which the replay's forced context allocation
skipped, so it could still sit in a register: an async function optimized at
one await and resumed unoptimized after the next restored V8's stale register
marker into that binding, which inspecting the frame then saw. V8 already
context-allocates these bindings whenever a sloppy direct eval is in scope,
so forcing it changes no semantics.
@Andarist
Andarist merged commit 4aaba1f into master Oct 28, 2026
2 of 3 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@Andarist
Andarist deleted the andarist/replay-force-context-allocation branch October 28, 2026 22:10
bhackett1024 added a commit that referenced this pull request Nov 5, 2026
@bhackett1024 @Andarist
Add V8 AST/parser instrumentation for recording
a806cd5
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 6, 2026
@bhackett1024 @Andarist
@Domiii @claude
Add V8 AST/parser instrumentation for recording
9179470
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 6, 2026
@bhackett1024 @Andarist
@Domiii @claude
Add V8 AST/parser instrumentation for recording
2161b62
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 6, 2026
@bhackett1024 @Andarist
@Domiii @claude
Add V8 AST/parser instrumentation for recording
d2ba90e
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist pushed a commit that referenced this pull request Nov 6, 2026
@bhackett1024 @Andarist
Add V8 AST/parser instrumentation for recording
52f3e2c
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist pushed a commit that referenced this pull request Nov 6, 2026
@bhackett1024 @Andarist
Add V8 AST/parser instrumentation for recording
ff9e412
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist pushed a commit that referenced this pull request Nov 6, 2026
@bhackett1024 @Andarist
Add V8 AST/parser instrumentation for recording
0b72667
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 6, 2026
@bhackett1024 @Andarist
@Domiii @claude
Add V8 AST/parser instrumentation for recording
806dbb5
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
@bhackett1024 @Andarist
Add V8 AST/parser instrumentation for recording
23ad92b
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
@bhackett1024 @Andarist
Add V8 AST/parser instrumentation for recording
40beed9
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
@bhackett1024 @Andarist
Add V8 AST/parser instrumentation for recording
c38697b
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 10, 2026
@bhackett1024 @Andarist
@Domiii @claude
Add V8 AST/parser instrumentation for recording
371d0ff
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

The optional chain flag is passed to NewCall again: node 24's parser grew a
parameter between the call's arguments and that flag, so the fork's call has
to name it or the flag was silently dropped.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 10, 2026
@bhackett1024 @Andarist
@Domiii @claude
Add V8 AST/parser instrumentation for recording
a56b1e6
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

The optional chain flag is passed to NewCall again: node 24's parser grew a
parameter between the call's arguments and that flag, so the fork's call has
to name it or the flag was silently dropped.

A variable the replay forces into the context is marked used, so that node
26's parser does not elide it as dead before the debugger can read it.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
@bhackett1024 @Andarist
Add V8 AST/parser instrumentation for recording
3659212
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
@bhackett1024 @Andarist
Add V8 AST/parser instrumentation for recording
0d428db
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
@bhackett1024 @Andarist
Add V8 AST/parser instrumentation for recording
a633298
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
@bhackett1024 @Andarist
Add V8 AST/parser instrumentation for recording
8f7af56
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

The optional chain flag is passed to NewCall again: node 24's parser grew a
parameter between the call's arguments and that flag, so the fork's call has
to name it or the flag was silently dropped.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
@bhackett1024 @Andarist
Add V8 AST/parser instrumentation for recording
97e986f
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

The optional chain flag is passed to NewCall again: node 24's parser grew a
parameter between the call's arguments and that flag, so the fork's call has
to name it or the flag was silently dropped.

A variable the replay forces into the context is marked used, so that node
26's parser does not elide it as dead before the debugger can read it.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
@bhackett1024 @Andarist
Add V8 AST/parser instrumentation for recording
3df2ddb
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
@bhackett1024 @Andarist
Add V8 AST/parser instrumentation for recording
5347a91
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
@bhackett1024 @Andarist
Add V8 AST/parser instrumentation for recording
7fbb3c0
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

The optional chain flag is passed to NewCall again: node 24's parser grew a
parameter between the call's arguments and that flag, so the fork's call has
to name it or the flag was silently dropped.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
@bhackett1024 @Andarist
Add V8 AST/parser instrumentation for recording
deaab14
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

The optional chain flag is passed to NewCall again: node 24's parser grew a
parameter between the call's arguments and that flag, so the fork's call has
to name it or the flag was silently dropped.

A variable the replay forces into the context is marked used, so that node
26's parser does not elide it as dead before the debugger can read it.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
@bhackett1024 @Andarist
Add V8 AST/parser instrumentation for recording
232a35b
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

The optional chain flag is passed to NewCall again: node 24's parser grew a
parameter between the call's arguments and that flag, so the fork's call has
to name it or the flag was silently dropped.

A variable the replay forces into the context is marked used, so that node
26's parser does not elide it as dead before the debugger can read it.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
@bhackett1024 @Andarist
Add V8 AST/parser instrumentation for recording
2c9cfb9
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

The optional chain flag is passed to NewCall again: node 24's parser grew a
parameter between the call's arguments and that flag, so the fork's call has
to name it or the flag was silently dropped.

A variable the replay forces into the context is marked used, so that node
26's parser does not elide it as dead before the debugger can read it.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
@bhackett1024 @Andarist
Add V8 AST/parser instrumentation for recording
5fce18a
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

Forcing flags the variable (Variable::RecordReplayIsForced) instead of
calling Scope::ForceContextAllocation, and the flag is applied where V8
decides allocation: MustAllocate marks a forced variable nothing
references used and tags it unreferenced, and MustAllocateInContext puts
it in the context, tagging it moved from the stack where a recording
would have kept it there. Since V8 13.6 MustAllocate CHECKs that a
context-allocated variable is used, forcing one nothing references -- a
`var unused;`, an unreferenced function declaration -- crashed the
replay. Both tags go into the ScopeInfo's context-local flags, which is
what lets a session other than Replay's own see the frame as a recording
had it. `var arguments;` is not forced, as allocating it would put
mapped parameters in the context too.

The optional chain flag is passed to NewCall again: node 24's parser grew a
parameter between the call's arguments and that flag, so the fork's call has
to name it or the flag was silently dropped.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.
The forced flag is applied only inside MustAllocate and
MustAllocateInContext, where upstream decides allocation, so a new
upstream allocation path keeps the tags correct.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
@bhackett1024 @Andarist
Add V8 AST/parser instrumentation for recording
fc4f4a8
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

Forcing flags the variable (Variable::RecordReplaySetForced) instead of
calling Scope::ForceContextAllocation, and the flag is applied where V8
decides allocation: MustAllocate marks a forced variable nothing
references used and tags it unreferenced, and MustAllocateInContext puts
it in the context, tagging it moved from the stack where a recording
would have kept it there. Both tags go into the ScopeInfo's context-local
flags, which is what lets a session other than Replay's own see the frame
as a recording had it: a variable nothing references does not exist, and
one moved into a context is still a stack local. On this V8 the
forced-but-unused case is only a DCHECK, so unlike node 24 -- where the
same assertion is a CHECK and an unreferenced declaration crashed the
replay -- the flags here are for that visibility distinction rather than
to avoid a crash. `var arguments;` is not forced, as allocating it would
put mapped parameters in the context too.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.
The forced flag is applied only inside MustAllocate and
MustAllocateInContext, where upstream decides allocation, so a new
upstream allocation path keeps the tags correct.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
@bhackett1024 @Andarist
Add V8 AST/parser instrumentation for recording
e99497a
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

Forcing flags the variable (Variable::RecordReplayIsForced) instead of
calling Scope::ForceContextAllocation, and the flag is applied where V8
decides allocation: MustAllocate marks a forced variable nothing
references used and tags it unreferenced, and MustAllocateInContext puts
it in the context, tagging it moved from the stack where a recording
would have kept it there. Since V8 13.6 MustAllocate CHECKs that a
context-allocated variable is used, forcing one nothing references -- a
`var unused;`, an unreferenced function declaration -- crashed the
replay. Both tags go into the ScopeInfo's context-local flags, which is
what lets a session other than Replay's own see the frame as a recording
had it. `var arguments;` is not forced, as allocating it would put
mapped parameters in the context too.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive.
The forced flag is applied only inside MustAllocate and
MustAllocateInContext, where upstream decides allocation, so a new
upstream allocation path keeps the tags correct.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist pushed a commit that referenced this pull request Nov 11, 2026
@bhackett1024 @Andarist
Add V8 AST/parser instrumentation for recording
95d57d9
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

The optional chain flag is passed to NewCall again: node 24's parser grew a
parameter between the call's arguments and that flag, so the fork's call has
to name it or the flag was silently dropped.

Forcing flags the variable (Variable::RecordReplaySetForced) instead of
calling Scope::ForceContextAllocation, and the flag is applied where V8
decides allocation: MustAllocate marks a forced variable nothing
references used and tags it unreferenced, and MustAllocateInContext puts
it in the context, tagging it moved from the stack where a recording
would have kept it there. V8 13.6's MustAllocate CHECKs that a
context-allocated variable is used, so forcing one nothing references --
a `var unused;`, an unreferenced function declaration -- crashed the
replay. A parameter is marked used at its declaration, where upstream did so
itself until node 26's V8: it is in the frame whether or not the
function mentions it, so MustAllocate must tag it moved from the stack
rather than unreferenced, or a session the program attached stops
seeing the CommonJS wrapper's own parameters and its reply -- a
recorded socket write -- diverges from the recording. Marking *every*
forced variable used instead, as this commit first did, compiles but
makes variables nothing references visible to such a session, which a
recording never had; the tags go into the
ScopeInfo's context-local flags so those sessions see the frame as a
recording had it. `var arguments;` is not forced, as allocating it would
put mapped parameters in the context too.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. record_replay_ignore must be set
for every compile the recorded main thread does not drive. The forced flag
is applied only inside MustAllocate and MustAllocateInContext, where
upstream decides allocation, so a new upstream allocation path keeps the
tags correct.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 11, 2026
@bhackett1024 @Andarist
@Domiii @claude
Add V8 AST/parser instrumentation for recording
206e7fa
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

The optional chain flag is passed to NewCall again: node 24's parser grew a
parameter between the call's arguments and that flag, so the fork's call has
to name it or the flag was silently dropped.

Forcing flags the variable (Variable::RecordReplaySetForced) instead of
calling Scope::ForceContextAllocation, and the flag is applied where V8
decides allocation: MustAllocate marks a forced variable nothing
references used and tags it unreferenced, and MustAllocateInContext puts
it in the context, tagging it moved from the stack where a recording
would have kept it there. V8 13.6's MustAllocate CHECKs that a
context-allocated variable is used, so forcing one nothing references --
a `var unused;`, an unreferenced function declaration -- crashed the
replay. A parameter is never one of those: the caller puts it in the
frame and AllocateParameter discards MustAllocate's result, so a
recording describes a parameter whether or not the function mentions it.
MustAllocate therefore excludes parameters from the unreferenced tag,
and must not mark them used instead: is_used() drives bytecode
generation, and node 26's V8 leaves a parameter the body never mentions
unused, so marking it used in the replay emits the store of a hoisted
function declaration shadowing that parameter which the recording never
ran. Either mistake shows a session the program attached something the
recording does not have -- the CommonJS wrapper's own parameters
missing, or that function where the recording has the argument -- and
the session's reply, a recorded socket write, diverges. Marking *every*
forced variable used, as this commit first did, compiles but makes
variables nothing references visible to such a session. The tags go into
the ScopeInfo's context-local flags, so those sessions see the frame as
a recording had it. `var arguments;` is not forced, as allocating it
would put mapped parameters in the context too.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. It must also leave is_used() as
the recording has it, which upstream reads while generating bytecode.
record_replay_ignore must be set for every compile the recorded main
thread does not drive. The forced flag is applied only inside
MustAllocate and MustAllocateInContext, where upstream decides
allocation, so a new upstream allocation path keeps the tags correct.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 11, 2026
@bhackett1024 @Andarist
@Domiii @claude
Add V8 AST/parser instrumentation for recording
5a57593
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

The optional chain flag is passed to NewCall again: node 24's parser grew a
parameter between the call's arguments and that flag, so the fork's call has
to name it or the flag was silently dropped.

Forcing flags the variable (Variable::RecordReplaySetForced) instead of
calling Scope::ForceContextAllocation, and the flag is applied where V8
decides allocation: MustAllocate marks a forced variable nothing
references used and tags it unreferenced, and MustAllocateInContext puts
it in the context, tagging it moved from the stack where a recording
would have kept it there. V8 13.6's MustAllocate CHECKs that a
context-allocated variable is used, so forcing one nothing references --
a `var unused;`, an unreferenced function declaration -- crashed the
replay. A parameter is never one of those: the caller puts it in the
frame and AllocateParameter discards MustAllocate's result, so a
recording describes a parameter whether or not the function mentions it.
MustAllocate therefore excludes parameters from the unreferenced tag,
and must not mark them used instead: is_used() drives bytecode
generation, and node 26's V8 leaves a parameter the body never mentions
unused, so marking it used in the replay emits the store of a hoisted
function declaration shadowing that parameter which the recording never
ran. Either mistake shows a session the program attached something the
recording does not have -- the CommonJS wrapper's own parameters
missing, or that function where the recording has the argument -- and
the session's reply, a recorded socket write, diverges. Marking *every*
forced variable used, as this commit first did, compiles but makes
variables nothing references visible to such a session. The tags go into
the ScopeInfo's context-local flags, so those sessions see the frame as
a recording had it. `var arguments;` is not forced, as allocating it
would put mapped parameters in the context too.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. It must also leave is_used() as
the recording has it, which upstream reads while generating bytecode.
record_replay_ignore must be set for every compile the recorded main
thread does not drive. The forced flag is applied only inside
MustAllocate and MustAllocateInContext, where upstream decides
allocation, so a new upstream allocation path keeps the tags correct.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 12, 2026
@bhackett1024 @Andarist
@Domiii @claude
Add V8 AST/parser instrumentation for recording
5ccdfcc
Track call head token positions on AST nodes, add AstRawString
to_string(), and add parse-info record_replay_ignore flag. Modify
parser and preparser to propagate positions for replay breakpoint
placement. Set record_replay_ignore for scripts whose URL the recorder
asks to ignore, and for any script or eval compiled off the main
thread, while events are disallowed, or from replay code.

While replaying, force parameters and declared variables into the
context, so frames inspected in a replay see their real values instead
of registers the bytecode no longer keeps alive (RUN-2604, Chromium
feature: force-variable-context-allocation). Sloppy block function
bindings are forced too: one could still sit in a register, where an
async function optimized at one await and resumed unoptimized after
the next restored V8's stale register marker into the binding, which
inspecting the frame then saw. V8 already context-allocates these
bindings whenever a sloppy direct eval is in scope, so forcing them
changes no semantics.

The optional chain flag is passed to NewCall again: node 24's parser grew a
parameter between the call's arguments and that flag, so the fork's call has
to name it or the flag was silently dropped.

Forcing flags the variable (Variable::RecordReplaySetForced) instead of
calling Scope::ForceContextAllocation, and the flag is applied where V8
decides allocation: MustAllocate marks a forced variable nothing
references used and tags it unreferenced, and MustAllocateInContext puts
it in the context, tagging it moved from the stack where a recording
would have kept it there. V8 13.6's MustAllocate CHECKs that a
context-allocated variable is used, so forcing one nothing references --
a `var unused;`, an unreferenced function declaration -- crashed the
replay. A parameter is never one of those: the caller puts it in the
frame and AllocateParameter discards MustAllocate's result, so a
recording describes a parameter whether or not the function mentions it.
MustAllocate therefore excludes parameters from the unreferenced tag,
and must not mark them used instead: is_used() drives bytecode
generation, and node 26's V8 leaves a parameter the body never mentions
unused, so marking it used in the replay emits the store of a hoisted
function declaration shadowing that parameter which the recording never
ran. Either mistake shows a session the program attached something the
recording does not have -- the CommonJS wrapper's own parameters
missing, or that function where the recording has the argument -- and
the session's reply, a recorded socket write, diverges. Marking *every*
forced variable used, as this commit first did, compiles but makes
variables nothing references visible to such a session. The tags go into
the ScopeInfo's context-local flags, so those sessions see the frame as
a recording had it. `var arguments;` is not forced, as allocating it
would put mapped parameters in the context too.

Rebase note: forced context allocation has to cover every variable
kind a replay can inspect, so check DeclareVariable's kinds when
upstream adds one, and it has to stay replay-only, since it changes
the bytecode a function compiles to. It must also leave is_used() as
the recording has it, which upstream reads while generating bytecode.
record_replay_ignore must be set for every compile the recorded main
thread does not drive. The forced flag is applied only inside
MustAllocate and MustAllocateInContext, where upstream decides
allocation, so a new upstream allocation path keeps the tags correct.

Includes later changes from #128, #132 and #205.

Co-authored-by: Mateusz Burzyński <[email protected]>
Co-authored-by: Domi <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@Andarist
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.