GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||
GeezerVison is showing github.com — Replay `Error.stack` and error messages by Andarist · Pull Request #137 · replayio/node Conversation
|
| // Chromium fork does. Node formats through its prepareStackTrace callback, | ||
| // whose result need not be a string, so whether one was recorded is recorded | ||
| // as well. | ||
| MaybeHandle<Object> ErrorUtils::FormatStackTrace(Isolate* isolate, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Why this wraps the whole function, unlike Chromium
Chromium records Error.stack only at the end of V8's built-in formatter. Both prepareStackTrace branches (the embedder callback and a user's Error.prepareStackTrace) return before that point and aren't recorded. That works in Chromium because Blink never installs a PrepareStackTraceCallback, so nearly every stack comes from the built-in formatter.
Node always installs that callback: prepareStackTrace in lib/internal/errors.js formats every stack, and calls a user's Error.prepareStackTrace when there is one. With Chromium's placement node would record nothing, so the port wraps the whole function and records all branches. A callback may return something that isn't a string, so it also records whether the result was a string.
prepareStackTrace considerations
Error.prepareStackTrace isn't recorded. Such callbacks usually return structured call sites, not a string, and would run again during replay regardless. So the only gap is a page callback that returns a string over frames that differ. It could be covered by recording at the same point as here
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // made of the recorded ones while replaying. Copying code units instead of | ||
| // converting to UTF-8 keeps NULs and unpaired surrogates intact, so the | ||
| // program sees the same string it would without being recorded. | ||
| Handle<String> RecordReplayStringContents(Isolate* isolate, const char* why, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This version is an improvement over the one we have in Chromium. It's supposed to handle certain characters better - I have verified the results between non-recording replay-node and the recording one. With a chromium-style patch we would actually fail to preserve those utf16 input~ correctly.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Port Chromium's feature-aware IsRecordingOrReplaying(feature, subfeature) and FeatureEnabled, backed by the driver's RecordReplayFeatureEnabled, and gate recording error stacks and messages on the same feature names Chromium uses, so RECORD_REPLAY_DISABLE_FEATURES turns them off in both.
Match the name and contract of Chromium's v8::replayio helper: overloads for Handle and MaybeHandle, returning the input unchanged when the feature named by why isn't recorded. It stays in messages.cc, its only user, as the node fork has no src/replay.
Put the recording wrapper where the original function was and move its body below as FormatStackTraceImpl, declared ahead in the anonymous namespace with the other helpers.
There was an error while loading. Please reload this page.
Node formats every stack through its prepareStackTrace callback, which can return any value, so record whether the result was a string and the string itself, then replay it verbatim. RecordReplayStringHandle copies UTF-16 code units rather than converting to UTF-8, so NULs and unpaired surrogates survive. Record MessageFormatter::Format the same way. While events are disallowed, don't cache the formatted stack back onto the error object, so inspecting an error during replay does not change the program's state. (PRO-1150, PRO-2368) From #137. Co-authored-by: Brian Hackett <[email protected]>
Add the v8::recordreplay public API class with methods for recording state, event control, pointer registration, ordered locks, and the C API bridge functions and driver symbol loading in api.cc. Add include/replayio.h with RAII helpers (AutoPassThroughEvents, AutoDisallowEvents with an optional label, AutoMarkReplayCode) and include/replayio-macros.h with REPLAY_ASSERT macros usable from C. Asserts are skipped when the driver disables them, warnings go through RecordReplayWarning, and progress notifications are ignored while events are disallowed. When JS progress asserts are enabled, progress data is handed to the recorder through its assert data callbacks. The driver can disable individual features at runtime, so IsRecordingOrReplaying() takes an optional feature name and FeatureEnabled() asks the driver, with the check skipped entirely when nothing is disabled. replayio-macros.h also declares RecordReplayWarningField, the driver's layout for one typed detail of a warning (a string, integer, double or bool under a key), and the V8RecordReplayWarning entry point that takes a warning kind plus an array of those fields. The scope helpers and the rest of the C++ surface live here too: AutoAssertMaybeEventsDisallowed, which asserts its message on entry and exit so the recording orders the scope unless events are disallowed, AutoOrderedLock, and AreEventsPassedThrough(), each defined next to the driver symbol it calls. Rebase note: these headers mirror the driver's ABI. Every driver function is looked up by name in api.cc, so a new recordreplay:: method needs its symbol loaded there, and RecordReplayWarningField's layout and the V8RecordReplay* signatures have to match the driver that REPLAY_BACKEND_REV pins. Includes later changes from #128, #129, #132, #137, #159, #161, #162, Co-authored-by: Domi <[email protected]> Co-authored-by: Mateusz Burzyński <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
Node formats every stack through its prepareStackTrace callback, which can return any value, so record whether the result was a string and the string itself, then replay it verbatim. RecordReplayStringHandle copies UTF-16 code units rather than converting to UTF-8, so NULs and unpaired surrogates survive. Record MessageFormatter::Format the same way. While events are disallowed, don't cache the formatted stack back onto the error object, so inspecting an error during replay does not change the program's state. (PRO-1150, PRO-2368) From #137. Co-authored-by: Brian Hackett <[email protected]>
Add the v8::recordreplay public API class with methods for recording state, event control, pointer registration, ordered locks, and the C API bridge functions and driver symbol loading in api.cc. Add include/replayio.h with RAII helpers (AutoPassThroughEvents, AutoDisallowEvents with an optional label, AutoMarkReplayCode) and include/replayio-macros.h with REPLAY_ASSERT macros usable from C. Asserts are skipped when the driver disables them, warnings go through RecordReplayWarning, and progress notifications are ignored while events are disallowed. When JS progress asserts are enabled, progress data is handed to the recorder through its assert data callbacks. The driver can disable individual features at runtime, so IsRecordingOrReplaying() takes an optional feature name and FeatureEnabled() asks the driver, with the check skipped entirely when nothing is disabled. replayio-macros.h also declares RecordReplayWarningField, the driver's layout for one typed detail of a warning (a string, integer, double or bool under a key), and the V8RecordReplayWarning entry point that takes a warning kind plus an array of those fields. The scope helpers and the rest of the C++ surface live here too: AutoAssertMaybeEventsDisallowed, which asserts its message on entry and exit so the recording orders the scope unless events are disallowed, AutoOrderedLock, and AreEventsPassedThrough(), each defined next to the driver symbol it calls. Rebase note: these headers mirror the driver's ABI. Every driver function is looked up by name in api.cc, so a new recordreplay:: method needs its symbol loaded there, and RecordReplayWarningField's layout and the V8RecordReplay* signatures have to match the driver that REPLAY_BACKEND_REV pins. Includes later changes from #128, #129, #132, #137, #159, #161, #162, #170, #173, #190, #191 and #202. Co-authored-by: Domi <[email protected]> Co-authored-by: Mateusz Burzyński <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
Node formats every stack through its prepareStackTrace callback, which can return any value, so record whether the result was a string and the string itself, then replay it verbatim. RecordReplayStringHandle copies UTF-16 code units rather than converting to UTF-8, so NULs and unpaired surrogates survive. Record MessageFormatter::Format the same way. While events are disallowed, don't cache the formatted stack back onto the error object, so inspecting an error during replay does not change the program's state. (PRO-1150, PRO-2368) From #137. Co-authored-by: Brian Hackett <[email protected]>
Add the v8::recordreplay public API class with methods for recording state, event control, pointer registration, ordered locks, and the C API bridge functions and driver symbol loading in api.cc. Add include/replayio.h with RAII helpers (AutoPassThroughEvents, AutoDisallowEvents with an optional label, AutoMarkReplayCode) and include/replayio-macros.h with REPLAY_ASSERT macros usable from C. Asserts are skipped when the driver disables them, warnings go through RecordReplayWarning, and progress notifications are ignored while events are disallowed. When JS progress asserts are enabled, progress data is handed to the recorder through its assert data callbacks. The driver can disable individual features at runtime, so IsRecordingOrReplaying() takes an optional feature name and FeatureEnabled() asks the driver, with the check skipped entirely when nothing is disabled. replayio-macros.h also declares RecordReplayWarningField, the driver's layout for one typed detail of a warning (a string, integer, double or bool under a key), and the V8RecordReplayWarning entry point that takes a warning kind plus an array of those fields. The scope helpers and the rest of the C++ surface live here too: AutoAssertMaybeEventsDisallowed, which asserts its message on entry and exit so the recording orders the scope unless events are disallowed, AutoOrderedLock, and AreEventsPassedThrough(), each defined next to the driver symbol it calls. Rebase note: these headers mirror the driver's ABI. Every driver function is looked up by name in api.cc, so a new recordreplay:: method needs its symbol loaded there, and RecordReplayWarningField's layout and the V8RecordReplay* signatures have to match the driver that REPLAY_BACKEND_REV pins. Includes later changes from #128, #129, #132, #137, #159, #161, #162, #170, #173, #190, #191 and #202. Co-authored-by: Domi <[email protected]> Co-authored-by: Mateusz Burzyński <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
Node formats every stack through its prepareStackTrace callback, which can return any value, so record whether the result was a string and the string itself, then replay it verbatim. RecordReplayStringHandle copies UTF-16 code units rather than converting to UTF-8, so NULs and unpaired surrogates survive. Record MessageFormatter::Format the same way. While events are disallowed, don't cache the formatted stack back onto the error object, so inspecting an error during replay does not change the program's state. (PRO-1150, PRO-2368) From #137. Co-authored-by: Brian Hackett <[email protected]>
Add the v8::recordreplay public API class with methods for recording state, event control, pointer registration, ordered locks, and the C API bridge functions and driver symbol loading in api.cc. Add include/replayio.h with RAII helpers (AutoPassThroughEvents, AutoDisallowEvents with an optional label, AutoMarkReplayCode) and include/replayio-macros.h with REPLAY_ASSERT macros usable from C. Asserts are skipped when the driver disables them, warnings go through RecordReplayWarning, and progress notifications are ignored while events are disallowed. When JS progress asserts are enabled, progress data is handed to the recorder through its assert data callbacks. The driver can disable individual features at runtime, so IsRecordingOrReplaying() takes an optional feature name and FeatureEnabled() asks the driver, with the check skipped entirely when nothing is disabled. replayio-macros.h also declares RecordReplayWarningField, the driver's layout for one typed detail of a warning (a string, integer, double or bool under a key), and the V8RecordReplayWarning entry point that takes a warning kind plus an array of those fields. The scope helpers and the rest of the C++ surface live here too: AutoAssertMaybeEventsDisallowed, which asserts its message on entry and exit so the recording orders the scope unless events are disallowed, AutoOrderedLock, and AreEventsPassedThrough(), each defined next to the driver symbol it calls. Rebase note: these headers mirror the driver's ABI. Every driver function is looked up by name in api.cc, so a new recordreplay:: method needs its symbol loaded there, and RecordReplayWarningField's layout and the V8RecordReplay* signatures have to match the driver that REPLAY_BACKEND_REV pins. Includes later changes from #128, #129, #132, #137, #159, #161, #162, Co-authored-by: Domi <[email protected]> Co-authored-by: Mateusz Burzyński <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
Add the v8::recordreplay public API class with methods for recording state, event control, pointer registration, ordered locks, and the C API bridge functions and driver symbol loading in api.cc. Add include/replayio.h with RAII helpers (AutoPassThroughEvents, AutoDisallowEvents with an optional label, AutoMarkReplayCode) and include/replayio-macros.h with REPLAY_ASSERT macros usable from C. Asserts are skipped when the driver disables them, warnings go through RecordReplayWarning, and progress notifications are ignored while events are disallowed. When JS progress asserts are enabled, progress data is handed to the recorder through its assert data callbacks. The driver can disable individual features at runtime, so IsRecordingOrReplaying() takes an optional feature name and FeatureEnabled() asks the driver, with the check skipped entirely when nothing is disabled. replayio-macros.h also declares RecordReplayWarningField, the driver's layout for one typed detail of a warning (a string, integer, double or bool under a key), and the V8RecordReplayWarning entry point that takes a warning kind plus an array of those fields. The scope helpers and the rest of the C++ surface live here too: AutoAssertMaybeEventsDisallowed, which asserts its message on entry and exit so the recording orders the scope unless events are disallowed, AutoOrderedLock, and AreEventsPassedThrough(), each defined next to the driver symbol it calls. Rebase note: these headers mirror the driver's ABI. Every driver function is looked up by name in api.cc, so a new recordreplay:: method needs its symbol loaded there, and RecordReplayWarningField's layout and the V8RecordReplay* signatures have to match the driver that REPLAY_BACKEND_REV pins. Includes later changes from #128, #129, #132, #137, #159, #161, #162, #170, #173, #190, #191 and #202. Co-authored-by: Domi <[email protected]> Co-authored-by: Mateusz Burzyński <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
Add the v8::recordreplay public API class with methods for recording state, event control, pointer registration, ordered locks, and the C API bridge functions and driver symbol loading in api.cc. Add include/replayio.h with RAII helpers (AutoPassThroughEvents, AutoDisallowEvents with an optional label, AutoMarkReplayCode) and include/replayio-macros.h with REPLAY_ASSERT macros usable from C. Asserts are skipped when the driver disables them, warnings go through RecordReplayWarning, and progress notifications are ignored while events are disallowed. When JS progress asserts are enabled, progress data is handed to the recorder through its assert data callbacks. The driver can disable individual features at runtime, so IsRecordingOrReplaying() takes an optional feature name and FeatureEnabled() asks the driver, with the check skipped entirely when nothing is disabled. replayio-macros.h also declares RecordReplayWarningField, the driver's layout for one typed detail of a warning (a string, integer, double or bool under a key), and the V8RecordReplayWarning entry point that takes a warning kind plus an array of those fields. The scope helpers and the rest of the C++ surface live here too: AutoAssertMaybeEventsDisallowed, which asserts its message on entry and exit so the recording orders the scope unless events are disallowed, AutoOrderedLock, and AreEventsPassedThrough(), each defined next to the driver symbol it calls. Rebase note: these headers mirror the driver's ABI. Every driver function is looked up by name in api.cc, so a new recordreplay:: method needs its symbol loaded there, and RecordReplayWarningField's layout and the V8RecordReplay* signatures have to match the driver that REPLAY_BACKEND_REV pins. Includes later changes from #128, #129, #132, #137, #159, #161, #162, #170, #173, #190, #191 and #202. Co-authored-by: Domi <[email protected]> Co-authored-by: Mateusz Burzyński <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
Node formats every stack through its prepareStackTrace callback, which can return any value, so record whether the result was a string and the string itself, then replay it verbatim. RecordReplayStringHandle copies UTF-16 code units rather than converting to UTF-8, so NULs and unpaired surrogates survive. Record MessageFormatter::Format the same way. While events are disallowed, don't cache the formatted stack back onto the error object, so inspecting an error during replay does not change the program's state. (PRO-1150, PRO-2368) From #137. Co-authored-by: Brian Hackett <[email protected]>
Node formats every stack through its prepareStackTrace callback, which can return any value, so record whether the result was a string and the string itself, then replay it verbatim. RecordReplayStringHandle copies UTF-16 code units rather than converting to UTF-8, so NULs and unpaired surrogates survive. Record MessageFormatter::Format the same way. While events are disallowed, don't cache the formatted stack back onto the error object, so inspecting an error during replay does not change the program's state. (PRO-1150, PRO-2368) From #137. Co-authored-by: Brian Hackett <[email protected]>
Node formats every stack through its prepareStackTrace callback, which can return any value, so record whether the result was a string and the string itself, then replay it verbatim. RecordReplayStringHandle copies UTF-16 code units rather than converting to UTF-8, so NULs and unpaired surrogates survive. Record MessageFormatter::Format the same way. While events are disallowed, don't cache the formatted stack back onto the error object, so inspecting an error during replay does not change the program's state. (PRO-1150, PRO-2368) From #137. Co-authored-by: Brian Hackett <[email protected]>
Add the v8::recordreplay public API class with methods for recording state, event control, pointer registration, ordered locks, and the C API bridge functions and driver symbol loading in api.cc. Add include/replayio.h with RAII helpers (AutoPassThroughEvents, AutoDisallowEvents with an optional label, AutoMarkReplayCode) and include/replayio-macros.h with REPLAY_ASSERT macros usable from C. Asserts are skipped when the driver disables them, warnings go through RecordReplayWarning, and progress notifications are ignored while events are disallowed. When JS progress asserts are enabled, progress data is handed to the recorder through its assert data callbacks. The driver can disable individual features at runtime, so IsRecordingOrReplaying() takes an optional feature name and FeatureEnabled() asks the driver, with the check skipped entirely when nothing is disabled. replayio-macros.h also declares RecordReplayWarningField, the driver's layout for one typed detail of a warning (a string, integer, double or bool under a key), and the V8RecordReplayWarning entry point that takes a warning kind plus an array of those fields. The scope helpers and the rest of the C++ surface live here too: AutoAssertMaybeEventsDisallowed, which asserts its message on entry and exit so the recording orders the scope unless events are disallowed, AutoOrderedLock, and AreEventsPassedThrough(), each defined next to the driver symbol it calls. Rebase note: these headers mirror the driver's ABI. Every driver function is looked up by name in api.cc, so a new recordreplay:: method needs its symbol loaded there, and RecordReplayWarningField's layout and the V8RecordReplay* signatures have to match the driver that REPLAY_BACKEND_REV pins. Includes later changes from #128, #129, #132, #137, #159, #161, #162, Co-authored-by: Domi <[email protected]> Co-authored-by: Mateusz Burzyński <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
Node formats every stack through its prepareStackTrace callback, which can return any value, so record whether the result was a string and the string itself, then replay it verbatim. RecordReplayStringHandle copies UTF-16 code units rather than converting to UTF-8, so NULs and unpaired surrogates survive. Record MessageFormatter::Format the same way. While events are disallowed, don't cache the formatted stack back onto the error object, so inspecting an error during replay does not change the program's state. (PRO-1150, PRO-2368) From #137. Co-authored-by: Brian Hackett <[email protected]>
Add the v8::recordreplay public API class with methods for recording state, event control, pointer registration, ordered locks, and the C API bridge functions and driver symbol loading in api.cc. Add include/replayio.h with RAII helpers (AutoPassThroughEvents, AutoDisallowEvents with an optional label, AutoMarkReplayCode) and include/replayio-macros.h with REPLAY_ASSERT macros usable from C. Asserts are skipped when the driver disables them, warnings go through RecordReplayWarning, and progress notifications are ignored while events are disallowed. When JS progress asserts are enabled, progress data is handed to the recorder through its assert data callbacks. The driver can disable individual features at runtime, so IsRecordingOrReplaying() takes an optional feature name and FeatureEnabled() asks the driver, with the check skipped entirely when nothing is disabled. replayio-macros.h also declares RecordReplayWarningField, the driver's layout for one typed detail of a warning (a string, integer, double or bool under a key), and the V8RecordReplayWarning entry point that takes a warning kind plus an array of those fields. The scope helpers and the rest of the C++ surface live here too: AutoAssertMaybeEventsDisallowed, which asserts its message on entry and exit so the recording orders the scope unless events are disallowed, AutoOrderedLock, and AreEventsPassedThrough(), each defined next to the driver symbol it calls. Rebase note: these headers mirror the driver's ABI. Every driver function is looked up by name in api.cc, so a new recordreplay:: method needs its symbol loaded there, and RecordReplayWarningField's layout and the V8RecordReplay* signatures have to match the driver that REPLAY_BACKEND_REV pins. Includes later changes from #128, #129, #132, #137, #159, #161, #162, Co-authored-by: Domi <[email protected]> Co-authored-by: Mateusz Burzyński <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
Node formats every stack through its prepareStackTrace callback, which can return any value, so record whether the result was a string and the string itself, then replay it verbatim. RecordReplayStringHandle copies UTF-16 code units rather than converting to UTF-8, so NULs and unpaired surrogates survive. Record MessageFormatter::Format the same way. While events are disallowed, don't cache the formatted stack back onto the error object, so inspecting an error during replay does not change the program's state. (PRO-1150, PRO-2368) From #137. Co-authored-by: Brian Hackett <[email protected]>
Node formats every stack through its prepareStackTrace callback, which can return any value, so record whether the result was a string and the string itself, then replay it verbatim. RecordReplayStringHandle copies UTF-16 code units rather than converting to UTF-8, so NULs and unpaired surrogates survive. Record MessageFormatter::Format the same way. While events are disallowed, don't cache the formatted stack back onto the error object, so inspecting an error during replay does not change the program's state. (PRO-1150, PRO-2368) From #137. Co-authored-by: Brian Hackett <[email protected]>
Add the v8::recordreplay public API class with methods for recording state, event control, pointer registration, ordered locks, and the C API bridge functions and driver symbol loading in api.cc. Add include/replayio.h with RAII helpers (AutoPassThroughEvents, AutoDisallowEvents with an optional label, AutoMarkReplayCode) and include/replayio-macros.h with REPLAY_ASSERT macros usable from C. Asserts are skipped when the driver disables them, warnings go through RecordReplayWarning, and progress notifications are ignored while events are disallowed. When JS progress asserts are enabled, progress data is handed to the recorder through its assert data callbacks. The driver can disable individual features at runtime, so IsRecordingOrReplaying() takes an optional feature name and FeatureEnabled() asks the driver, with the check skipped entirely when nothing is disabled. replayio-macros.h also declares RecordReplayWarningField, the driver's layout for one typed detail of a warning (a string, integer, double or bool under a key), and the V8RecordReplayWarning entry point that takes a warning kind plus an array of those fields. The scope helpers and the rest of the C++ surface live here too: AutoAssertMaybeEventsDisallowed, which asserts its message on entry and exit so the recording orders the scope unless events are disallowed, AutoOrderedLock, and AreEventsPassedThrough(), each defined next to the driver symbol it calls. V8 11.3 gives Code::OptimizedCodeIterator a SafepointScope, and entering a safepoint samples the time to reach it, so walking the optimized code reads the clock where V8 10.2 walked the native contexts list and read nothing. RecordReplayChangeInstrument walks that code to deoptimize it and the driver only changes the instrumentation while replaying, so the walk runs with events disallowed, as Debug::DiscardBaselineCode already does for its own. Moving a pending exception aside to report it leaves any TryCatch the embedder installed alone: node 22's V8 reports through the embedder's handler, so clearing it there swallowed exceptions the embedder was waiting for. The progress counter's external reference is kept out of the nullptr slot: V8 13.6 CHECKs that external references are deduplicated when the snapshot is loaded, so a driver-filled pointer that is still null at that point collides with every other null one. Rebase note: these headers mirror the driver's ABI. Every driver function is looked up by name in api.cc, so a new recordreplay:: method needs its symbol loaded there, and RecordReplayWarningField's layout and the V8RecordReplay* signatures have to match the driver that REPLAY_BACKEND_REV pins. Includes later changes from #128, #129, #132, #137, #159, #161, #162, Co-authored-by: Domi <[email protected]> Co-authored-by: Mateusz Burzyński <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
Node formats every stack through its prepareStackTrace callback, which can return any value, so record whether the result was a string and the string itself, then replay it verbatim. RecordReplayStringHandle copies UTF-16 code units rather than converting to UTF-8, so NULs and unpaired surrogates survive. Record MessageFormatter::Format the same way. While events are disallowed, don't cache the formatted stack back onto the error object, so inspecting an error during replay does not change the program's state. (PRO-1150, PRO-2368) From #137. Co-authored-by: Brian Hackett <[email protected]>
Add the v8::recordreplay public API class with methods for recording state, event control, pointer registration, ordered locks, and the C API bridge functions and driver symbol loading in api.cc. Add include/replayio.h with RAII helpers (AutoPassThroughEvents, AutoDisallowEvents with an optional label, AutoMarkReplayCode) and include/replayio-macros.h with REPLAY_ASSERT macros usable from C. Asserts are skipped when the driver disables them, warnings go through RecordReplayWarning, and progress notifications are ignored while events are disallowed. When JS progress asserts are enabled, progress data is handed to the recorder through its assert data callbacks. The driver can disable individual features at runtime, so IsRecordingOrReplaying() takes an optional feature name and FeatureEnabled() asks the driver, with the check skipped entirely when nothing is disabled. replayio-macros.h also declares RecordReplayWarningField, the driver's layout for one typed detail of a warning (a string, integer, double or bool under a key), and the V8RecordReplayWarning entry point that takes a warning kind plus an array of those fields. The scope helpers and the rest of the C++ surface live here too: AutoAssertMaybeEventsDisallowed, which asserts its message on entry and exit so the recording orders the scope unless events are disallowed, AutoOrderedLock, and AreEventsPassedThrough(), each defined next to the driver symbol it calls. V8 11.3 gives Code::OptimizedCodeIterator a SafepointScope, and entering a safepoint samples the time to reach it, so walking the optimized code reads the clock where V8 10.2 walked the native contexts list and read nothing. RecordReplayChangeInstrument walks that code to deoptimize it and the driver only changes the instrumentation while replaying, so the walk runs with events disallowed, as Debug::DiscardBaselineCode already does for its own. Rebase note: these headers mirror the driver's ABI. Every driver function is looked up by name in api.cc, so a new recordreplay:: method needs its symbol loaded there, and RecordReplayWarningField's layout and the V8RecordReplay* signatures have to match the driver that REPLAY_BACKEND_REV pins. Includes later changes from #128, #129, #132, #137, #159, #161, #162, Co-authored-by: Domi <[email protected]> Co-authored-by: Mateusz Burzyński <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
Add the v8::recordreplay public API class with methods for recording state, event control, pointer registration, ordered locks, and the C API bridge functions and driver symbol loading in api.cc. Add include/replayio.h with RAII helpers (AutoPassThroughEvents, AutoDisallowEvents with an optional label, AutoMarkReplayCode) and include/replayio-macros.h with REPLAY_ASSERT macros usable from C. Asserts are skipped when the driver disables them, warnings go through RecordReplayWarning, and progress notifications are ignored while events are disallowed. When JS progress asserts are enabled, progress data is handed to the recorder through its assert data callbacks. The driver can disable individual features at runtime, so IsRecordingOrReplaying() takes an optional feature name and FeatureEnabled() asks the driver, with the check skipped entirely when nothing is disabled. replayio-macros.h also declares RecordReplayWarningField, the driver's layout for one typed detail of a warning (a string, integer, double or bool under a key), and the V8RecordReplayWarning entry point that takes a warning kind plus an array of those fields. The scope helpers and the rest of the C++ surface live here too: AutoAssertMaybeEventsDisallowed, which asserts its message on entry and exit so the recording orders the scope unless events are disallowed, AutoOrderedLock, and AreEventsPassedThrough(), each defined next to the driver symbol it calls. V8 11.3 gives Code::OptimizedCodeIterator a SafepointScope, and entering a safepoint samples the time to reach it, so walking the optimized code reads the clock where V8 10.2 walked the native contexts list and read nothing. RecordReplayChangeInstrument walks that code to deoptimize it and the driver only changes the instrumentation while replaying, so the walk runs with events disallowed, as Debug::DiscardBaselineCode already does for its own. Moving a pending exception aside to report it leaves any TryCatch the embedder installed alone: node 22's V8 reports through the embedder's handler, so clearing it there swallowed exceptions the embedder was waiting for. Rebase note: these headers mirror the driver's ABI. Every driver function is looked up by name in api.cc, so a new recordreplay:: method needs its symbol loaded there, and RecordReplayWarningField's layout and the V8RecordReplay* signatures have to match the driver that REPLAY_BACKEND_REV pins. Includes later changes from #128, #129, #132, #137, #159, #161, #162, Co-authored-by: Domi <[email protected]> Co-authored-by: Mateusz Burzyński <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
Add the v8::recordreplay public API class with methods for recording state, event control, pointer registration, ordered locks, and the C API bridge functions and driver symbol loading in api.cc. Add include/replayio.h with RAII helpers (AutoPassThroughEvents, AutoDisallowEvents with an optional label, AutoMarkReplayCode) and include/replayio-macros.h with REPLAY_ASSERT macros usable from C. Asserts are skipped when the driver disables them, warnings go through RecordReplayWarning, and progress notifications are ignored while events are disallowed. When JS progress asserts are enabled, progress data is handed to the recorder through its assert data callbacks. The driver can disable individual features at runtime, so IsRecordingOrReplaying() takes an optional feature name and FeatureEnabled() asks the driver, with the check skipped entirely when nothing is disabled. replayio-macros.h also declares RecordReplayWarningField, the driver's layout for one typed detail of a warning (a string, integer, double or bool under a key), and the V8RecordReplayWarning entry point that takes a warning kind plus an array of those fields. The scope helpers and the rest of the C++ surface live here too: AutoAssertMaybeEventsDisallowed, which asserts its message on entry and exit so the recording orders the scope unless events are disallowed, AutoOrderedLock, and AreEventsPassedThrough(), each defined next to the driver symbol it calls. V8 11.3 gives Code::OptimizedCodeIterator a SafepointScope, and entering a safepoint samples the time to reach it, so walking the optimized code reads the clock where V8 10.2 walked the native contexts list and read nothing. RecordReplayChangeInstrument walks that code to deoptimize it and the driver only changes the instrumentation while replaying, so the walk runs with events disallowed, as Debug::DiscardBaselineCode already does for its own. Moving a pending exception aside to report it leaves any TryCatch the embedder installed alone: node 22's V8 reports through the embedder's handler, so clearing it there swallowed exceptions the embedder was waiting for. The progress counter's external reference is kept out of the nullptr slot: V8 13.6 CHECKs that external references are deduplicated when the snapshot is loaded, so a driver-filled pointer that is still null at that point collides with every other null one. Rebase note: these headers mirror the driver's ABI. Every driver function is looked up by name in api.cc, so a new recordreplay:: method needs its symbol loaded there, and RecordReplayWarningField's layout and the V8RecordReplay* signatures have to match the driver that REPLAY_BACKEND_REV pins. Includes later changes from #128, #129, #132, #137, #159, #161, #162, Co-authored-by: Domi <[email protected]> Co-authored-by: Mateusz Burzyński <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
Add the v8::recordreplay public API class with methods for recording state, event control, pointer registration, ordered locks, and the C API bridge functions and driver symbol loading in api.cc. Add include/replayio.h with RAII helpers (AutoPassThroughEvents, AutoDisallowEvents with an optional label, AutoMarkReplayCode) and include/replayio-macros.h with REPLAY_ASSERT macros usable from C. Asserts are skipped when the driver disables them, warnings go through RecordReplayWarning, and progress notifications are ignored while events are disallowed. When JS progress asserts are enabled, progress data is handed to the recorder through its assert data callbacks. The driver can disable individual features at runtime, so IsRecordingOrReplaying() takes an optional feature name and FeatureEnabled() asks the driver, with the check skipped entirely when nothing is disabled. replayio-macros.h also declares RecordReplayWarningField, the driver's layout for one typed detail of a warning (a string, integer, double or bool under a key), and the V8RecordReplayWarning entry point that takes a warning kind plus an array of those fields. The scope helpers and the rest of the C++ surface live here too: AutoAssertMaybeEventsDisallowed, which asserts its message on entry and exit so the recording orders the scope unless events are disallowed, AutoOrderedLock, and AreEventsPassedThrough(), each defined next to the driver symbol it calls. V8 11.3 gives Code::OptimizedCodeIterator a SafepointScope, and entering a safepoint samples the time to reach it, so walking the optimized code reads the clock where V8 10.2 walked the native contexts list and read nothing. RecordReplayChangeInstrument walks that code to deoptimize it and the driver only changes the instrumentation while replaying, so the walk runs with events disallowed, as Debug::DiscardBaselineCode already does for its own. Moving a pending exception aside to report it leaves any TryCatch the embedder installed alone: node 22's V8 reports through the embedder's handler, so clearing it there swallowed exceptions the embedder was waiting for. The progress counter's external reference is kept out of the nullptr slot: V8 13.6 CHECKs that external references are deduplicated when the snapshot is loaded, so a driver-filled pointer that is still null at that point collides with every other null one. Rebase note: these headers mirror the driver's ABI. Every driver function is looked up by name in api.cc, so a new recordreplay:: method needs its symbol loaded there, and RecordReplayWarningField's layout and the V8RecordReplay* signatures have to match the driver that REPLAY_BACKEND_REV pins. Includes later changes from #128, #129, #132, #137, #159, #161, #162, Co-authored-by: Domi <[email protected]> Co-authored-by: Mateusz Burzyński <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
Node formats every stack through its prepareStackTrace callback, which can return any value, so record whether the result was a string and the string itself, then replay it verbatim. RecordReplayStringHandle copies UTF-16 code units rather than converting to UTF-8, so NULs and unpaired surrogates survive. Record MessageFormatter::Format the same way. While events are disallowed, don't cache the formatted stack back onto the error object, so inspecting an error during replay does not change the program's state. (PRO-1150, PRO-2368) From #137. Co-authored-by: Brian Hackett <[email protected]>
Node formats every stack through its prepareStackTrace callback, which can return any value, so record whether the result was a string and the string itself, then replay it verbatim. RecordReplayStringHandle copies UTF-16 code units rather than converting to UTF-8, so NULs and unpaired surrogates survive. Record MessageFormatter::Format the same way. While events are disallowed, don't cache the formatted stack back onto the error object, so inspecting an error during replay does not change the program's state. (PRO-1150, PRO-2368) From #137. Co-authored-by: Brian Hackett <[email protected]>
Node formats every stack through its prepareStackTrace callback, which can return any value, so record whether the result was a string and the string itself, then replay it verbatim. RecordReplayStringHandle copies UTF-16 code units rather than converting to UTF-8, so NULs and unpaired surrogates survive. Record MessageFormatter::Format the same way. While events are disallowed, don't cache the formatted stack back onto the error object, so inspecting an error during replay does not change the program's state. (PRO-1150, PRO-2368) From #137. Co-authored-by: Brian Hackett <[email protected]>
Node formats every stack through its prepareStackTrace callback, which can return any value, so record whether the result was a string and the string itself, then replay it verbatim. RecordReplayStringHandle copies UTF-16 code units rather than converting to UTF-8, so NULs and unpaired surrogates survive. Record MessageFormatter::Format the same way. While events are disallowed, don't cache the formatted stack back onto the error object, so inspecting an error during replay does not change the program's state. (PRO-1150, PRO-2368) From #137. Co-authored-by: Brian Hackett <[email protected]>
Add the v8::recordreplay public API class with methods for recording state, event control, pointer registration, ordered locks, and the C API bridge functions and driver symbol loading in api.cc. Add include/replayio.h with RAII helpers (AutoPassThroughEvents, AutoDisallowEvents with an optional label, AutoMarkReplayCode) and include/replayio-macros.h with REPLAY_ASSERT macros usable from C. Asserts are skipped when the driver disables them, warnings go through RecordReplayWarning, and progress notifications are ignored while events are disallowed. When JS progress asserts are enabled, progress data is handed to the recorder through its assert data callbacks. The driver can disable individual features at runtime, so IsRecordingOrReplaying() takes an optional feature name and FeatureEnabled() asks the driver, with the check skipped entirely when nothing is disabled. replayio-macros.h also declares RecordReplayWarningField, the driver's layout for one typed detail of a warning (a string, integer, double or bool under a key), and the V8RecordReplayWarning entry point that takes a warning kind plus an array of those fields. The scope helpers and the rest of the C++ surface live here too: AutoAssertMaybeEventsDisallowed, which asserts its message on entry and exit so the recording orders the scope unless events are disallowed, AutoOrderedLock, and AreEventsPassedThrough(), each defined next to the driver symbol it calls. V8 11.3 gives Code::OptimizedCodeIterator a SafepointScope, and entering a safepoint samples the time to reach it, so walking the optimized code reads the clock where V8 10.2 walked the native contexts list and read nothing. RecordReplayChangeInstrument walks that code to deoptimize it and the driver only changes the instrumentation while replaying, so the walk runs with events disallowed, as Debug::DiscardBaselineCode already does for its own. Moving a pending exception aside to report it leaves any TryCatch the embedder installed alone: node 22's V8 reports through the embedder's handler, so clearing it there swallowed exceptions the embedder was waiting for. The progress counter's external reference is kept out of the nullptr slot: V8 13.6 CHECKs that external references are deduplicated when the snapshot is loaded, so a driver-filled pointer that is still null at that point collides with every other null one. Rebase note: these headers mirror the driver's ABI. Every driver function is looked up by name in api.cc, so a new recordreplay:: method needs its symbol loaded there, and RecordReplayWarningField's layout and the V8RecordReplay* signatures have to match the driver that REPLAY_BACKEND_REV pins. Includes later changes from #128, #129, #132, #137, #159, #161, #162, Co-authored-by: Domi <[email protected]> Co-authored-by: Mateusz Burzyński <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
Node formats every stack through its prepareStackTrace callback, which can return any value, so record whether the result was a string and the string itself, then replay it verbatim. RecordReplayStringHandle copies UTF-16 code units rather than converting to UTF-8, so NULs and unpaired surrogates survive. Record MessageFormatter::Format the same way. While events are disallowed, don't cache the formatted stack back onto the error object, so inspecting an error during replay does not change the program's state. (PRO-1150, PRO-2368) From #137. Co-authored-by: Brian Hackett <[email protected]>
Add the v8::recordreplay public API class with methods for recording state, event control, pointer registration, ordered locks, and the C API bridge functions and driver symbol loading in api.cc. Add include/replayio.h with RAII helpers (AutoPassThroughEvents, AutoDisallowEvents with an optional label, AutoMarkReplayCode) and include/replayio-macros.h with REPLAY_ASSERT macros usable from C. Asserts are skipped when the driver disables them, warnings go through RecordReplayWarning, and progress notifications are ignored while events are disallowed. When JS progress asserts are enabled, progress data is handed to the recorder through its assert data callbacks. The driver can disable individual features at runtime, so IsRecordingOrReplaying() takes an optional feature name and FeatureEnabled() asks the driver, with the check skipped entirely when nothing is disabled. replayio-macros.h also declares RecordReplayWarningField, the driver's layout for one typed detail of a warning (a string, integer, double or bool under a key), and the V8RecordReplayWarning entry point that takes a warning kind plus an array of those fields. The scope helpers and the rest of the C++ surface live here too: AutoAssertMaybeEventsDisallowed, which asserts its message on entry and exit so the recording orders the scope unless events are disallowed, AutoOrderedLock, and AreEventsPassedThrough(), each defined next to the driver symbol it calls. V8 11.3 gives Code::OptimizedCodeIterator a SafepointScope, and entering a safepoint samples the time to reach it, so walking the optimized code reads the clock where V8 10.2 walked the native contexts list and read nothing. RecordReplayChangeInstrument walks that code to deoptimize it and the driver only changes the instrumentation while replaying, so the walk runs with events disallowed, as Debug::DiscardBaselineCode already does for its own. Moving a pending exception aside to report it leaves any TryCatch the embedder installed alone: node 22's V8 reports through the embedder's handler, so clearing it there swallowed exceptions the embedder was waiting for. The progress counter's external reference is kept out of the nullptr slot: V8 13.6 CHECKs that external references are deduplicated when the snapshot is loaded, so a driver-filled pointer that is still null at that point collides with every other null one. Rebase note: these headers mirror the driver's ABI. Every driver function is looked up by name in api.cc, so a new recordreplay:: method needs its symbol loaded there, and RecordReplayWarningField's layout and the V8RecordReplay* signatures have to match the driver that REPLAY_BACKEND_REV pins. Includes later changes from #128, #129, #132, #137, #159, #161, #162, Co-authored-by: Domi <[email protected]> Co-authored-by: Mateusz Burzyński <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
Node formats every stack through its prepareStackTrace callback, which can return any value, so record whether the result was a string and the string itself, then replay it verbatim. RecordReplayStringHandle copies UTF-16 code units rather than converting to UTF-8, so NULs and unpaired surrogates survive. Record MessageFormatter::Format the same way. While events are disallowed, don't cache the formatted stack back onto the error object, so inspecting an error during replay does not change the program's state. (PRO-1150, PRO-2368) From #137. Co-authored-by: Brian Hackett <[email protected]>
Add the v8::recordreplay public API class with methods for recording state, event control, pointer registration, ordered locks, and the C API bridge functions and driver symbol loading in api.cc. Add include/replayio.h with RAII helpers (AutoPassThroughEvents, AutoDisallowEvents with an optional label, AutoMarkReplayCode) and include/replayio-macros.h with REPLAY_ASSERT macros usable from C. Asserts are skipped when the driver disables them, warnings go through RecordReplayWarning, and progress notifications are ignored while events are disallowed. When JS progress asserts are enabled, progress data is handed to the recorder through its assert data callbacks. The driver can disable individual features at runtime, so IsRecordingOrReplaying() takes an optional feature name and FeatureEnabled() asks the driver, with the check skipped entirely when nothing is disabled. replayio-macros.h also declares RecordReplayWarningField, the driver's layout for one typed detail of a warning (a string, integer, double or bool under a key), and the V8RecordReplayWarning entry point that takes a warning kind plus an array of those fields. The scope helpers and the rest of the C++ surface live here too: AutoAssertMaybeEventsDisallowed, which asserts its message on entry and exit so the recording orders the scope unless events are disallowed, AutoOrderedLock, and AreEventsPassedThrough(), each defined next to the driver symbol it calls. V8 11.3 gives Code::OptimizedCodeIterator a SafepointScope, and entering a safepoint samples the time to reach it, so walking the optimized code reads the clock where V8 10.2 walked the native contexts list and read nothing. RecordReplayChangeInstrument walks that code to deoptimize it and the driver only changes the instrumentation while replaying, so the walk runs with events disallowed, as Debug::DiscardBaselineCode already does for its own. Moving a pending exception aside to report it leaves any TryCatch the embedder installed alone: node 22's V8 reports through the embedder's handler, so clearing it there swallowed exceptions the embedder was waiting for. The progress counter's external reference is kept out of the nullptr slot: V8 13.6 CHECKs that external references are deduplicated when the snapshot is loaded, so a driver-filled pointer that is still null at that point collides with every other null one. Rebase note: these headers mirror the driver's ABI. Every driver function is looked up by name in api.cc, so a new recordreplay:: method needs its symbol loaded there, and RecordReplayWarningField's layout and the V8RecordReplay* signatures have to match the driver that REPLAY_BACKEND_REV pins. Includes later changes from #128, #129, #132, #137, #159, #161, #162, Co-authored-by: Domi <[email protected]> Co-authored-by: Mateusz Burzyński <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
Node formats every stack through its prepareStackTrace callback, which can return any value, so record whether the result was a string and the string itself, then replay it verbatim. RecordReplayStringHandle copies UTF-16 code units rather than converting to UTF-8, so NULs and unpaired surrogates survive. Record MessageFormatter::Format the same way. While events are disallowed, don't cache the formatted stack back onto the error object, so inspecting an error during replay does not change the program's state. (PRO-1150, PRO-2368) From #137. Co-authored-by: Brian Hackett <[email protected]>
Add the v8::recordreplay public API class with methods for recording state, event control, pointer registration, ordered locks, and the C API bridge functions and driver symbol loading in api.cc. Add include/replayio.h with RAII helpers (AutoPassThroughEvents, AutoDisallowEvents with an optional label, AutoMarkReplayCode) and include/replayio-macros.h with REPLAY_ASSERT macros usable from C. Asserts are skipped when the driver disables them, warnings go through RecordReplayWarning, and progress notifications are ignored while events are disallowed. When JS progress asserts are enabled, progress data is handed to the recorder through its assert data callbacks. The driver can disable individual features at runtime, so IsRecordingOrReplaying() takes an optional feature name and FeatureEnabled() asks the driver, with the check skipped entirely when nothing is disabled. replayio-macros.h also declares RecordReplayWarningField, the driver's layout for one typed detail of a warning (a string, integer, double or bool under a key), and the V8RecordReplayWarning entry point that takes a warning kind plus an array of those fields. The scope helpers and the rest of the C++ surface live here too: AutoAssertMaybeEventsDisallowed, which asserts its message on entry and exit so the recording orders the scope unless events are disallowed, AutoOrderedLock, and AreEventsPassedThrough(), each defined next to the driver symbol it calls. V8 11.3 gives Code::OptimizedCodeIterator a SafepointScope, and entering a safepoint samples the time to reach it, so walking the optimized code reads the clock where V8 10.2 walked the native contexts list and read nothing. RecordReplayChangeInstrument walks that code to deoptimize it and the driver only changes the instrumentation while replaying, so the walk runs with events disallowed, as Debug::DiscardBaselineCode already does for its own. Rebase note: these headers mirror the driver's ABI. Every driver function is looked up by name in api.cc, so a new recordreplay:: method needs its symbol loaded there, and RecordReplayWarningField's layout and the V8RecordReplay* signatures have to match the driver that REPLAY_BACKEND_REV pins. Includes later changes from #128, #129, #132, #137, #159, #161, #162, Co-authored-by: Domi <[email protected]> Co-authored-by: Mateusz Burzyński <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
Add the v8::recordreplay public API class with methods for recording state, event control, pointer registration, ordered locks, and the C API bridge functions and driver symbol loading in api.cc. Add include/replayio.h with RAII helpers (AutoPassThroughEvents, AutoDisallowEvents with an optional label, AutoMarkReplayCode) and include/replayio-macros.h with REPLAY_ASSERT macros usable from C. Asserts are skipped when the driver disables them, warnings go through RecordReplayWarning, and progress notifications are ignored while events are disallowed. When JS progress asserts are enabled, progress data is handed to the recorder through its assert data callbacks. The driver can disable individual features at runtime, so IsRecordingOrReplaying() takes an optional feature name and FeatureEnabled() asks the driver, with the check skipped entirely when nothing is disabled. replayio-macros.h also declares RecordReplayWarningField, the driver's layout for one typed detail of a warning (a string, integer, double or bool under a key), and the V8RecordReplayWarning entry point that takes a warning kind plus an array of those fields. The scope helpers and the rest of the C++ surface live here too: AutoAssertMaybeEventsDisallowed, which asserts its message on entry and exit so the recording orders the scope unless events are disallowed, AutoOrderedLock, and AreEventsPassedThrough(), each defined next to the driver symbol it calls. V8 11.3 gives Code::OptimizedCodeIterator a SafepointScope, and entering a safepoint samples the time to reach it, so walking the optimized code reads the clock where V8 10.2 walked the native contexts list and read nothing. RecordReplayChangeInstrument walks that code to deoptimize it and the driver only changes the instrumentation while replaying, so the walk runs with events disallowed, as Debug::DiscardBaselineCode already does for its own. Moving a pending exception aside to report it leaves any TryCatch the embedder installed alone: node 22's V8 reports through the embedder's handler, so clearing it there swallowed exceptions the embedder was waiting for. Rebase note: these headers mirror the driver's ABI. Every driver function is looked up by name in api.cc, so a new recordreplay:: method needs its symbol loaded there, and RecordReplayWarningField's layout and the V8RecordReplay* signatures have to match the driver that REPLAY_BACKEND_REV pins. Includes later changes from #128, #129, #132, #137, #159, #161, #162, Co-authored-by: Domi <[email protected]> Co-authored-by: Mateusz Burzyński <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
Node formats every stack through its prepareStackTrace callback, which can return any value, so record whether the result was a string and the string itself, then replay it verbatim. RecordReplayStringHandle copies UTF-16 code units rather than converting to UTF-8, so NULs and unpaired surrogates survive. Record MessageFormatter::Format the same way. While events are disallowed, don't cache the formatted stack back onto the error object, so inspecting an error during replay does not change the program's state. (PRO-1150, PRO-2368) From #137. Co-authored-by: Brian Hackett <[email protected]>
Node formats every stack through its prepareStackTrace callback, which can return any value, so record whether the result was a string and the string itself, then replay it verbatim. RecordReplayStringHandle copies UTF-16 code units rather than converting to UTF-8, so NULs and unpaired surrogates survive. Record MessageFormatter::Format the same way. While events are disallowed, don't cache the formatted stack back onto the error object, so inspecting an error during replay does not change the program's state. (PRO-1150, PRO-2368) From #137. Co-authored-by: Brian Hackett <[email protected]>
Add the v8::recordreplay public API class with methods for recording state, event control, pointer registration, ordered locks, and the C API bridge functions and driver symbol loading in api.cc. Add include/replayio.h with RAII helpers (AutoPassThroughEvents, AutoDisallowEvents with an optional label, AutoMarkReplayCode) and include/replayio-macros.h with REPLAY_ASSERT macros usable from C. Asserts are skipped when the driver disables them, warnings go through RecordReplayWarning, and progress notifications are ignored while events are disallowed. When JS progress asserts are enabled, progress data is handed to the recorder through its assert data callbacks. The driver can disable individual features at runtime, so IsRecordingOrReplaying() takes an optional feature name and FeatureEnabled() asks the driver, with the check skipped entirely when nothing is disabled. replayio-macros.h also declares RecordReplayWarningField, the driver's layout for one typed detail of a warning (a string, integer, double or bool under a key), and the V8RecordReplayWarning entry point that takes a warning kind plus an array of those fields. The scope helpers and the rest of the C++ surface live here too: AutoAssertMaybeEventsDisallowed, which asserts its message on entry and exit so the recording orders the scope unless events are disallowed, AutoOrderedLock, and AreEventsPassedThrough(), each defined next to the driver symbol it calls. V8 11.3 gives Code::OptimizedCodeIterator a SafepointScope, and entering a safepoint samples the time to reach it, so walking the optimized code reads the clock where V8 10.2 walked the native contexts list and read nothing. RecordReplayChangeInstrument walks that code to deoptimize it and the driver only changes the instrumentation while replaying, so the walk runs with events disallowed, as Debug::DiscardBaselineCode already does for its own. Moving a pending exception aside to report it leaves any TryCatch the embedder installed alone: node 22's V8 reports through the embedder's handler, so clearing it there swallowed exceptions the embedder was waiting for. The progress counter's external reference is kept out of the nullptr slot: V8 13.6 CHECKs that external references are deduplicated when the snapshot is loaded, so a driver-filled pointer that is still null at that point collides with every other null one. Rebase note: these headers mirror the driver's ABI. Every driver function is looked up by name in api.cc, so a new recordreplay:: method needs its symbol loaded there, and RecordReplayWarningField's layout and the V8RecordReplay* signatures have to match the driver that REPLAY_BACKEND_REV pins. Includes later changes from #128, #129, #132, #137, #159, #161, #162, Co-authored-by: Domi <[email protected]> Co-authored-by: Mateusz Burzyński <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
Node formats every stack through its prepareStackTrace callback, which can return any value, so record whether the result was a string and the string itself, then replay it verbatim. RecordReplayStringHandle copies UTF-16 code units rather than converting to UTF-8, so NULs and unpaired surrogates survive. Record MessageFormatter::Format the same way. While events are disallowed, don't cache the formatted stack back onto the error object, so inspecting an error during replay does not change the program's state. (PRO-1150, PRO-2368) From #137. Co-authored-by: Brian Hackett <[email protected]>
Add the v8::recordreplay public API class with methods for recording state, event control, pointer registration, ordered locks, and the C API bridge functions and driver symbol loading in api.cc. Add include/replayio.h with RAII helpers (AutoPassThroughEvents, AutoDisallowEvents with an optional label, AutoMarkReplayCode) and include/replayio-macros.h with REPLAY_ASSERT macros usable from C. Asserts are skipped when the driver disables them, warnings go through RecordReplayWarning, and progress notifications are ignored while events are disallowed. When JS progress asserts are enabled, progress data is handed to the recorder through its assert data callbacks. The driver can disable individual features at runtime, so IsRecordingOrReplaying() takes an optional feature name and FeatureEnabled() asks the driver, with the check skipped entirely when nothing is disabled. replayio-macros.h also declares RecordReplayWarningField, the driver's layout for one typed detail of a warning (a string, integer, double or bool under a key), and the V8RecordReplayWarning entry point that takes a warning kind plus an array of those fields. The scope helpers and the rest of the C++ surface live here too: AutoAssertMaybeEventsDisallowed, which asserts its message on entry and exit so the recording orders the scope unless events are disallowed, AutoOrderedLock, and AreEventsPassedThrough(), each defined next to the driver symbol it calls. V8 11.3 gives Code::OptimizedCodeIterator a SafepointScope, and entering a safepoint samples the time to reach it, so walking the optimized code reads the clock where V8 10.2 walked the native contexts list and read nothing. RecordReplayChangeInstrument walks that code to deoptimize it and the driver only changes the instrumentation while replaying, so the walk runs with events disallowed, as Debug::DiscardBaselineCode already does for its own. Moving a pending exception aside to report it leaves any TryCatch the embedder installed alone: node 22's V8 reports through the embedder's handler, so clearing it there swallowed exceptions the embedder was waiting for. The progress counter's external reference is kept out of the nullptr slot: V8 13.6 CHECKs that external references are deduplicated when the snapshot is loaded, so a driver-filled pointer that is still null at that point collides with every other null one. Rebase note: these headers mirror the driver's ABI. Every driver function is looked up by name in api.cc, so a new recordreplay:: method needs its symbol loaded there, and RecordReplayWarningField's layout and the V8RecordReplay* signatures have to match the driver that REPLAY_BACKEND_REV pins. Includes later changes from #128, #129, #132, #137, #159, #161, #162, Co-authored-by: Domi <[email protected]> Co-authored-by: Mateusz Burzyński <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
Node formats every stack through its prepareStackTrace callback, which can return any value, so record whether the result was a string and the string itself, then replay it verbatim. RecordReplayStringHandle copies UTF-16 code units rather than converting to UTF-8, so NULs and unpaired surrogates survive. Record MessageFormatter::Format the same way. While events are disallowed, don't cache the formatted stack back onto the error object, so inspecting an error during replay does not change the program's state. (PRO-1150, PRO-2368) From #137. Co-authored-by: Brian Hackett <[email protected]>
Add the v8::recordreplay public API class with methods for recording state, event control, pointer registration, ordered locks, and the C API bridge functions and driver symbol loading in api.cc. Add include/replayio.h with RAII helpers (AutoPassThroughEvents, AutoDisallowEvents with an optional label, AutoMarkReplayCode) and include/replayio-macros.h with REPLAY_ASSERT macros usable from C. Asserts are skipped when the driver disables them, warnings go through RecordReplayWarning, and progress notifications are ignored while events are disallowed. When JS progress asserts are enabled, progress data is handed to the recorder through its assert data callbacks. The driver can disable individual features at runtime, so IsRecordingOrReplaying() takes an optional feature name and FeatureEnabled() asks the driver, with the check skipped entirely when nothing is disabled. replayio-macros.h also declares RecordReplayWarningField, the driver's layout for one typed detail of a warning (a string, integer, double or bool under a key), and the V8RecordReplayWarning entry point that takes a warning kind plus an array of those fields. The scope helpers and the rest of the C++ surface live here too: AutoAssertMaybeEventsDisallowed, which asserts its message on entry and exit so the recording orders the scope unless events are disallowed, AutoOrderedLock, and AreEventsPassedThrough(), each defined next to the driver symbol it calls. V8 11.3 gives Code::OptimizedCodeIterator a SafepointScope, and entering a safepoint samples the time to reach it, so walking the optimized code reads the clock where V8 10.2 walked the native contexts list and read nothing. RecordReplayChangeInstrument walks that code to deoptimize it and the driver only changes the instrumentation while replaying, so the walk runs with events disallowed, as Debug::DiscardBaselineCode already does for its own. Moving a pending exception aside to report it leaves any TryCatch the embedder installed alone: node 22's V8 reports through the embedder's handler, so clearing it there swallowed exceptions the embedder was waiting for. The progress counter's external reference is kept out of the nullptr slot: V8 13.6 CHECKs that external references are deduplicated when the snapshot is loaded, so a driver-filled pointer that is still null at that point collides with every other null one. Rebase note: these headers mirror the driver's ABI. Every driver function is looked up by name in api.cc, so a new recordreplay:: method needs its symbol loaded there, and RecordReplayWarningField's layout and the V8RecordReplay* signatures have to match the driver that REPLAY_BACKEND_REV pins. Includes later changes from #128, #129, #132, #137, #159, #161, #162, Co-authored-by: Domi <[email protected]> Co-authored-by: Mateusz Burzyński <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
Node formats every stack through its prepareStackTrace callback, which can return any value, so record whether the result was a string and the string itself, then replay it verbatim. RecordReplayStringHandle copies UTF-16 code units rather than converting to UTF-8, so NULs and unpaired surrogates survive. Record MessageFormatter::Format the same way. While events are disallowed, don't cache the formatted stack back onto the error object, so inspecting an error during replay does not change the program's state. (PRO-1150, PRO-2368) From #137. Co-authored-by: Brian Hackett <[email protected]>
Add the v8::recordreplay public API class with methods for recording state, event control, pointer registration, ordered locks, and the C API bridge functions and driver symbol loading in api.cc. Add include/replayio.h with RAII helpers (AutoPassThroughEvents, AutoDisallowEvents with an optional label, AutoMarkReplayCode) and include/replayio-macros.h with REPLAY_ASSERT macros usable from C. Asserts are skipped when the driver disables them, warnings go through RecordReplayWarning, and progress notifications are ignored while events are disallowed. When JS progress asserts are enabled, progress data is handed to the recorder through its assert data callbacks. The driver can disable individual features at runtime, so IsRecordingOrReplaying() takes an optional feature name and FeatureEnabled() asks the driver, with the check skipped entirely when nothing is disabled. replayio-macros.h also declares RecordReplayWarningField, the driver's layout for one typed detail of a warning (a string, integer, double or bool under a key), and the V8RecordReplayWarning entry point that takes a warning kind plus an array of those fields. The scope helpers and the rest of the C++ surface live here too: AutoAssertMaybeEventsDisallowed, which asserts its message on entry and exit so the recording orders the scope unless events are disallowed, AutoOrderedLock, and AreEventsPassedThrough(), each defined next to the driver symbol it calls. V8 11.3 gives Code::OptimizedCodeIterator a SafepointScope, and entering a safepoint samples the time to reach it, so walking the optimized code reads the clock where V8 10.2 walked the native contexts list and read nothing. RecordReplayChangeInstrument walks that code to deoptimize it and the driver only changes the instrumentation while replaying, so the walk runs with events disallowed, as Debug::DiscardBaselineCode already does for its own. Moving a pending exception aside to report it leaves any TryCatch the embedder installed alone: node 22's V8 reports through the embedder's handler, so clearing it there swallowed exceptions the embedder was waiting for. The progress counter's external reference is kept out of the nullptr slot: V8 13.6 CHECKs that external references are deduplicated when the snapshot is loaded, so a driver-filled pointer that is still null at that point collides with every other null one. Rebase note: these headers mirror the driver's ABI. Every driver function is looked up by name in api.cc, so a new recordreplay:: method needs its symbol loaded there, and RecordReplayWarningField's layout and the V8RecordReplay* signatures have to match the driver that REPLAY_BACKEND_REV pins. Includes later changes from #128, #129, #132, #137, #159, #161, #162, Co-authored-by: Domi <[email protected]> Co-authored-by: Mateusz Burzyński <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
Node formats every stack through its prepareStackTrace callback, which can return any value, so record whether the result was a string and the string itself, then replay it verbatim. RecordReplayStringHandle copies UTF-16 code units rather than converting to UTF-8, so NULs and unpaired surrogates survive. Record MessageFormatter::Format the same way. While events are disallowed, don't cache the formatted stack back onto the error object, so inspecting an error during replay does not change the program's state. (PRO-1150, PRO-2368) From #137. Co-authored-by: Brian Hackett <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.