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