2024-01-01 14:58:21 -05:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2022-07-04 18:12:41 -04:00
|
|
|
use deno_core::Snapshot;
|
2023-03-08 10:44:04 -05:00
|
|
|
use log::debug;
|
2022-07-04 18:12:41 -04:00
|
|
|
|
2023-02-20 15:45:34 -05:00
|
|
|
#[cfg(not(feature = "dont_create_runtime_snapshot"))]
|
2023-03-16 23:19:46 -04:00
|
|
|
static RUNTIME_SNAPSHOT: &[u8] =
|
2023-02-20 15:45:34 -05:00
|
|
|
include_bytes!(concat!(env!("OUT_DIR"), "/RUNTIME_SNAPSHOT.bin"));
|
|
|
|
|
2023-08-05 19:47:15 -04:00
|
|
|
pub fn deno_isolate_init() -> Option<Snapshot> {
|
2023-03-08 10:44:04 -05:00
|
|
|
debug!("Deno isolate init with snapshots.");
|
2023-08-05 19:47:15 -04:00
|
|
|
#[cfg(not(feature = "dont_create_runtime_snapshot"))]
|
|
|
|
{
|
|
|
|
Some(Snapshot::Static(RUNTIME_SNAPSHOT))
|
|
|
|
}
|
|
|
|
#[cfg(feature = "dont_create_runtime_snapshot")]
|
|
|
|
{
|
|
|
|
None
|
|
|
|
}
|
2022-07-04 18:12:41 -04:00
|
|
|
}
|
2023-06-13 18:36:16 -04:00
|
|
|
|
2023-06-26 07:54:10 -04:00
|
|
|
#[cfg(not(feature = "include_js_files_for_snapshotting"))]
|
2023-06-13 18:36:16 -04:00
|
|
|
pub static SOURCE_CODE_FOR_99_MAIN_JS: &str = include_str!("js/99_main.js");
|
|
|
|
|
2023-06-26 07:54:10 -04:00
|
|
|
#[cfg(feature = "include_js_files_for_snapshotting")]
|
2023-06-13 18:36:16 -04:00
|
|
|
pub static PATH_FOR_99_MAIN_JS: &str =
|
|
|
|
concat!(env!("CARGO_MANIFEST_DIR"), "/js/99_main.js");
|