diff options
author | Matt Mastracci <matthew@mastracci.com> | 2024-02-27 08:05:57 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-27 08:05:57 -0700 |
commit | 47c2a63d872886ae1d0576f3cbf630151c8ff129 (patch) | |
tree | 85ba7273598467de211fab37c4cb6dcbd87fc889 /runtime | |
parent | f1a691274e59d3f6a1aad19d1aec02a0ffaa51d2 (diff) |
chore: bump deno_core (#22596)
Migrations:
- snapshot code updated
- runtime stats API tweaks
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/snapshot.rs | 7 | ||||
-rw-r--r-- | runtime/web_worker.rs | 3 | ||||
-rw-r--r-- | runtime/worker.rs | 3 |
3 files changed, 6 insertions, 7 deletions
diff --git a/runtime/snapshot.rs b/runtime/snapshot.rs index 3a9d67086..e48af43ff 100644 --- a/runtime/snapshot.rs +++ b/runtime/snapshot.rs @@ -10,6 +10,7 @@ use deno_core::snapshot::*; use deno_core::v8; use deno_core::Extension; use deno_http::DefaultHttpPropertyExtractor; +use std::io::Write; use std::path::Path; use std::path::PathBuf; use std::sync::Arc; @@ -270,9 +271,6 @@ pub fn create_runtime_snapshot( cargo_manifest_dir: env!("CARGO_MANIFEST_DIR"), startup_snapshot: None, extensions, - serializer: Box::new(SnapshotFileSerializer::new( - std::fs::File::create(snapshot_path).unwrap(), - )), with_runtime_cb: Some(Box::new(|rt| { let isolate = rt.v8_isolate(); let scope = &mut v8::HandleScope::new(isolate); @@ -285,6 +283,9 @@ pub fn create_runtime_snapshot( None, ) .unwrap(); + let mut snapshot = std::fs::File::create(snapshot_path).unwrap(); + snapshot.write_all(&output.output).unwrap(); + for path in output.files_loaded_during_snapshot { println!("cargo:rerun-if-changed={}", path.display()); } diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs index a69c384ab..97b855c56 100644 --- a/runtime/web_worker.rs +++ b/runtime/web_worker.rs @@ -37,7 +37,6 @@ use deno_core::OpMetricsSummaryTracker; use deno_core::PollEventLoopOptions; use deno_core::RuntimeOptions; use deno_core::SharedArrayBufferStore; -use deno_core::Snapshot; use deno_core::SourceMapGetter; use deno_cron::local::LocalCronHandler; use deno_fs::FileSystem; @@ -336,7 +335,7 @@ pub struct WebWorker { pub struct WebWorkerOptions { pub bootstrap: BootstrapOptions, pub extensions: Vec<Extension>, - pub startup_snapshot: Option<Snapshot>, + pub startup_snapshot: Option<&'static [u8]>, pub unsafely_ignore_certificate_errors: Option<Vec<String>>, pub root_cert_store_provider: Option<Arc<dyn RootCertStoreProvider>>, pub seed: Option<u64>, diff --git a/runtime/worker.rs b/runtime/worker.rs index b6aff3c15..d19e520c9 100644 --- a/runtime/worker.rs +++ b/runtime/worker.rs @@ -32,7 +32,6 @@ use deno_core::OpMetricsSummaryTracker; use deno_core::PollEventLoopOptions; use deno_core::RuntimeOptions; use deno_core::SharedArrayBufferStore; -use deno_core::Snapshot; use deno_core::SourceMapGetter; use deno_cron::local::LocalCronHandler; use deno_fs::FileSystem; @@ -128,7 +127,7 @@ pub struct WorkerOptions { pub extensions: Vec<Extension>, /// V8 snapshot that should be loaded on startup. - pub startup_snapshot: Option<Snapshot>, + pub startup_snapshot: Option<&'static [u8]>, /// Should op registration be skipped? pub skip_op_registration: bool, |