diff --git a/.github/workflows/ci-job.yml b/.github/workflows/ci-job.yml index c2724780a..96c04c1f1 100644 --- a/.github/workflows/ci-job.yml +++ b/.github/workflows/ci-job.yml @@ -92,11 +92,15 @@ jobs: id: test if: inputs.job == 'test' uses: ./.github/workflows/ci-test + env: + V8_FORCE_DEBUG: ${{ inputs.label == "linux" && "1" : "0" }} - name: Test (ops) id: test-ops if: inputs.job == 'test-ops' uses: ./.github/workflows/ci-test-ops + env: + V8_FORCE_DEBUG: ${{ inputs.label == "linux" && "1" : "0" }} - name: Test (miri) id: test-miri diff --git a/core/modules/map.rs b/core/modules/map.rs index 038f36e78..2015b2914 100644 --- a/core/modules/map.rs +++ b/core/modules/map.rs @@ -139,6 +139,7 @@ pub(crate) struct ModuleMap { pending_code_cache_ready: Cell, module_waker: AtomicWaker, data: RefCell, + will_snapshot: bool, /// A counter used to delay our dynamic import deadlock detection by one spin /// of the event loop. @@ -202,8 +203,10 @@ impl ModuleMap { loader: Rc, exception_state: Rc, import_meta_resolve_cb: ImportMetaResolveCallback, + will_snapshot: bool, ) -> Self { Self { + will_snapshot, loader: loader.into(), exception_state, import_meta_resolve_cb, @@ -639,7 +642,9 @@ impl ModuleMap { let module = maybe_module.unwrap(); - if try_store_code_cache { + // V8 does not support creating code caches while also snapshotting, + // and it's not needed anyway, as the snapshot already contains it. + if try_store_code_cache && !self.will_snapshot { if let Some(code_cache_info) = code_cache_info.take() { let unbound_module_script = module.get_unbound_module_script(tc_scope); let code_cache = diff --git a/core/runtime/jsruntime.rs b/core/runtime/jsruntime.rs index 38e94cedf..8dc599ca7 100644 --- a/core/runtime/jsruntime.rs +++ b/core/runtime/jsruntime.rs @@ -899,6 +899,7 @@ impl JsRuntime { loader, exception_state.clone(), import_meta_resolve_cb, + will_snapshot, )); if let Some((snapshotted_data, mut data_store)) = snapshotted_data {