From 914b08fc19e5c7268e7b04a216337e765d6a06e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 20 Feb 2023 21:45:34 +0100 Subject: build: add "include_js_files_for_snapshotting" Cargo feature (#17826) This allows to not include source code into the binary (because it will already be included in the V8 snapshot). Nothing changes for the embedders - everything should still build the same. This commit brings the binary size from 87Mb to 82Mb on M1. Alternative to https://github.com/denoland/deno/pull/17820 and https://github.com/denoland/deno/pull/17653 --------- Co-authored-by: Leo Kettmeir --- core/runtime.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'core/runtime.rs') diff --git a/core/runtime.rs b/core/runtime.rs index ae2b0489b..d098c25b1 100644 --- a/core/runtime.rs +++ b/core/runtime.rs @@ -21,7 +21,6 @@ use crate::source_map::SourceMapCache; use crate::source_map::SourceMapGetter; use crate::Extension; use crate::ExtensionFileSource; -use crate::ExtensionFileSourceCode; use crate::NoopModuleLoader; use crate::OpMiddlewareFn; use crate::OpResult; @@ -869,14 +868,11 @@ impl JsRuntime { { let js_files = ext.get_js_sources(); for file_source in js_files { - let ExtensionFileSourceCode::IncludedInBinary(code) = - file_source.code; - // TODO(@AaronO): use JsRuntime::execute_static() here to move src off heap realm.execute_script( self.v8_isolate(), &file_source.specifier, - code, + &file_source.code.load()?, )?; } } -- cgit v1.2.3