You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"notes": "Context::new on snapshot-restored isolate gives a clone of the default context with bridge IIFE state. replace_bridge_fns() overwrites 38 stub globals with real session-local functions. inject_snapshot_defaults uses READ_ONLY only (no DONT_DELETE) so inject_globals_from_payload can override per-session. Session thread skips bridge_code on snapshot path (from_snapshot flag). Tests: Part 18 (replace + dispatch), Part 19 (_processConfig override), Part 20 (multi-restore isolation)."
- `Context::new()` on a snapshot-restored isolate clones the snapshot's default context with all state — use this instead of `get_current_context()` for fresh context per execution
59
+
- Snapshot defaults: use `READ_ONLY` only (no `DONT_DELETE`) so `inject_globals_from_payload` can redefine per-session; `DONT_DELETE` makes non-configurable
- Pre-existing SIGSEGV when running execution::tests AND snapshot::tests in the same process (V8 inter-test state issue) — run them separately: `cargo test execution::tests -- --test-threads=1` and `cargo test snapshot::tests -- --test-threads=1`
- Implemented context restore with bridge function replacement for V8 context snapshots
475
+
- Added `replace_bridge_fns()` convenience wrapper in `bridge.rs` — calls `register_sync_bridge_fns` + `register_async_bridge_fns` in one call, returning both stores
476
+
- Fixed `inject_snapshot_defaults()` in `snapshot.rs` — changed `_processConfig` and `_osConfig` from `READ_ONLY | DONT_DELETE` (non-configurable) to `READ_ONLY` only (configurable), so `inject_globals_from_payload` can redefine them per-session after restore
477
+
- Modified session thread in `session.rs`:
478
+
- Added `from_snapshot` flag tracking whether isolate was created from a snapshot
479
+
- On snapshot path: `Context::new()` on snapshot-restored isolate gives a clone of the snapshot's default context (bridge IIFE already executed), bridge functions replaced via `replace_bridge_fns()`, globals injected, bridge_code skipped (pass empty string)
480
+
- On fallback path: fresh context + full bridge code (existing behavior)
481
+
- Unified bridge function registration: both paths use `replace_bridge_fns()` (works for both initial registration and stub replacement)
482
+
- Added 3 new snapshot test parts:
483
+
- Part 18: Full restore flow — create snapshot with IIFE, restore, replace bridge functions, verify IIFE state preserved + replaced functions work + getter facade resolves to replaced functions
484
+
- Part 19: `_processConfig` override — verify configurable property can be overridden via `inject_globals_from_payload` after restore (cwd "/" → "/app", arch "x64" → "arm64")
485
+
- Part 20: Multi-restore isolation — verify user state from one restore doesn't leak to another
- `v8::Context::new(scope, Default::default())` on a snapshot-restored isolate gives a CLONE of the snapshot's default context — each call creates a fresh clone with the bridge IIFE state, no need for `get_current_context()`
489
+
- `get_current_context()` requires a `ContextScope` (not available on plain `HandleScope<()>`) — use `Context::new()` instead
490
+
- `define_own_property` with `READ_ONLY | DONT_DELETE` makes a property non-configurable — subsequent `define_own_property` calls fail silently. Use only `READ_ONLY` for snapshot defaults so they can be overridden
491
+
- `Object.freeze()` on the value object does NOT make the global PROPERTY non-configurable — it only freezes the object's own properties
492
+
- The `from_snapshot` flag is stable for the session lifetime — once set on isolate creation, all subsequent Executes on the same session use the same path
493
+
- Pre-existing test failures: `__name` conflict in runtime-driver/node tests, Python tests (PythonRuntime not a constructor), project-matrix tests — all unrelated to this story
0 commit comments