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 — Write statement breakpoints after a class's block context push when replaying by Andarist · Pull Request #188 · replayio/node

Conversation

@Andarist

@Andarist Andarist commented Oct 23, 2026

Copy link
Copy Markdown
Member

V8 9.4's ScopeIterator treats a pause at the class token of var x = class { ... } as inside the class scope and takes the frame's context to be the class's block context. The fork wrote the statement's breakpoint instrumentation right away in SetStatementPosition, before CreateBlockContext/PushContext, so a replay paused there still had the enclosing context and the debugger read the enclosing scope's variables from its previous() context (the native context for a top-level function). Bindings came back with wrong values or none, which made createProtocolScope throw and the linker assert in GetScopeJSON.

Port replayio/chromium-v8#353: SetStatementPosition and ReplayExpressionShiftedSetStatementPosition queue their breakpoint instrumentation, which is written before anything else reaches the bytecode writer and before a source position is read. When recording or replaying, VisitClassLiteral takes a pending source position inside the class scope and its queued breakpoints and gives them back after the block context push (MaybePopSourcePosition/PushSourcePosition, backported from v8/v8@f74ea020d5d and v8/v8@6a8b90c303b).

Sorry, something went wrong.

Uh oh!

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

All reactions
Andarist added 2 commits October 23, 2026 08:32
@Andarist
Write statement breakpoints after a class's block context push when r…
d52342d
…eplaying

V8 9.4's ScopeIterator treats a pause at the class token of
`var x = class { ... }` as inside the class scope and takes the frame's
context to be the class's block context. The fork wrote the statement's
breakpoint instrumentation right away in SetStatementPosition, before
CreateBlockContext/PushContext, so a replay paused there still had the
enclosing context and the debugger read the enclosing scope's variables
from its previous() context (the native context for a top-level
function). Bindings came back with wrong values or none, which made
createProtocolScope throw and the linker assert in GetScopeJSON.

Port replayio/chromium-v8#353: SetStatementPosition and
ReplayExpressionShiftedSetStatementPosition queue their breakpoint
instrumentation, which is written before anything else reaches the
bytecode writer and before a source position is read. When recording or
replaying, VisitClassLiteral takes a pending source position inside the
class scope and its queued breakpoints and gives them back after the
block context push (MaybePopSourcePosition/PushSourcePosition, backported
from v8/v8@f74ea020d5d and v8/v8@6a8b90c303b).
@Andarist
Mark the class literal source position code as an upstream backport
2390aa1
Say which parts of MaybePopSourcePosition/PushSourcePosition and
VisitClassLiteral come from v8/v8@f74ea020d5d and v8/v8@6a8b90c303b and
which are the fork's breakpoint additions, keep upstream's VisitClassLiteral
comment verbatim, and say what to keep when rebasing onto a V8 that has
either commit.
@Andarist
Andarist merged commit 3a12220 into master Oct 23, 2026
2 of 3 checks passed

Uh oh!

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

bhackett1024 pushed a commit that referenced this pull request Nov 5, 2026
@Andarist
Number instrumentation sites per function and defer breakpoints
16d315d
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 6, 2026
@Andarist @bhackett1024 @claude
Number instrumentation sites per function and defer breakpoints
e4bcb6f
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 6, 2026
@Andarist @bhackett1024 @claude
Number instrumentation sites per function and defer breakpoints
b861ca2
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 6, 2026
@Andarist @bhackett1024 @claude
Number instrumentation sites per function and defer breakpoints
e04a005
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 6, 2026
@Andarist
Number instrumentation sites per function and defer breakpoints
5d2553e
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 6, 2026
@Andarist
Number instrumentation sites per function and defer breakpoints
4a2d47e
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 6, 2026
@Andarist
Number instrumentation sites per function and defer breakpoints
60f9a9e
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 6, 2026
@Andarist @bhackett1024 @claude
Number instrumentation sites per function and defer breakpoints
9f99241
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 10, 2026
@Andarist
Number instrumentation sites per function and defer breakpoints
5dc062a
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 10, 2026
@Andarist
Number instrumentation sites per function and defer breakpoints
be4ca6b
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 10, 2026
@Andarist
Number instrumentation sites per function and defer breakpoints
1083888
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 10, 2026
@Andarist
Number instrumentation sites per function and defer breakpoints
e79f502
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 10, 2026
@Andarist
Number instrumentation sites per function and defer breakpoints
66eede1
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 10, 2026
@Andarist
Number instrumentation sites per function and defer breakpoints
d9e10a7
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 10, 2026
@Andarist
Number instrumentation sites per function and defer breakpoints
48998db
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 10, 2026
@Andarist
Number instrumentation sites per function and defer breakpoints
f49ac1f
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 10, 2026
@Andarist
Number instrumentation sites per function and defer breakpoints
d83640e
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 10, 2026
@Andarist
Number instrumentation sites per function and defer breakpoints
92482d0
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 10, 2026
@Andarist
Number instrumentation sites per function and defer breakpoints
8a52cd0
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 10, 2026
@Andarist
Number instrumentation sites per function and defer breakpoints
74cfdf4
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 10, 2026
@Andarist
Number instrumentation sites per function and defer breakpoints
e846326
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 10, 2026
@Andarist
Number instrumentation sites per function and defer breakpoints
940dcfa
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 10, 2026
@Andarist
Number instrumentation sites per function and defer breakpoints
3ad2a45
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 10, 2026
@Andarist
Number instrumentation sites per function and defer breakpoints
14ced65
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 10, 2026
@Andarist
Number instrumentation sites per function and defer breakpoints
c9bb459
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 10, 2026
@Andarist
Number instrumentation sites per function and defer breakpoints
2b86ce7
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 10, 2026
@Andarist
Number instrumentation sites per function and defer breakpoints
bb4d4ac
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 11, 2026
@Andarist
Number instrumentation sites per function and defer breakpoints
f2a5930
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 11, 2026
@Andarist @bhackett1024 @claude
Number instrumentation sites per function and defer breakpoints
dbfcac9
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 11, 2026
@Andarist @bhackett1024 @claude
Number instrumentation sites per function and defer breakpoints
db7235f
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Andarist added a commit that referenced this pull request Nov 12, 2026
@Andarist @bhackett1024 @claude
Number instrumentation sites per function and defer breakpoints
a0af14a
The index reported for an instrumentation site (to
RecordReplayInstrument, RecordReplayAddPossibleBreakpoint and
Target.convertLocationToFunctionOffset) is now a per-function index from
a dedicated counter instead of a bytecode offset, matching Chromium's
V8, so sites that bypass the location-based deduplication, including
generator sites, still get unique indices; VisitCall compares the
counter to detect whether visiting a call's arguments added breakpoints.
Unknown script ids return early through MaybeGetScript instead of
CHECK-failing, and an unknown offset falls back to the position of the
function itself with a diagnostic instead of crashing.

SetStatementPosition now queues its breakpoint instrumentation, which is
written before anything else reaches the bytecode writer and before a
source position is read. When recording or replaying, VisitClassLiteral
takes the pending position inside the class scope and its queued
breakpoints and gives them back after the block context push
(MaybePopSourcePosition/PushSourcePosition, backported from
v8/v8@f74ea020d5d and v8/v8@6a8b90c303b), so a replay paused at the
class token of `var x = class {}` has the class's block context and
reads the enclosing scope's variables from the right context.

Rebase note: breakpoint indices must be unique within a function, so a
new site draws from record_replay_instrumentation_site_counter_, and
every path that writes bytecode, binds a label or handler, or reads a
source position must flush the pending breakpoint queue first. On a V8
that has upstream's MaybePopSourcePosition/PushSourcePosition, take
those and re-apply only the RecordReplay additions.

From #120, #159 and #188.

Co-authored-by: Brian Hackett <[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.