mirror of
https://github.com/denoland/deno.git
synced 2025-01-21 04:52:26 -05:00
wire up a flag
This commit is contained in:
parent
cb1cfb8442
commit
3d41feaf41
5 changed files with 18 additions and 2 deletions
|
@ -646,6 +646,7 @@ pub struct Flags {
|
|||
pub code_cache_enabled: bool,
|
||||
pub permissions: PermissionFlags,
|
||||
pub allow_scripts: PackagesAllowedScripts,
|
||||
pub internal_use_lsc_cache: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Default, Serialize, Deserialize)]
|
||||
|
@ -3782,6 +3783,11 @@ fn runtime_misc_args(app: Command) -> Command {
|
|||
.arg(seed_arg())
|
||||
.arg(enable_testing_features_arg())
|
||||
.arg(strace_ops_arg())
|
||||
.arg(
|
||||
Arg::new("internal-use-lsc-cache")
|
||||
.long("internal-use-lsc-cache")
|
||||
.hide(true),
|
||||
)
|
||||
}
|
||||
|
||||
fn allow_import_arg() -> Arg {
|
||||
|
@ -5652,6 +5658,7 @@ fn runtime_args_parse(
|
|||
allow_scripts_arg_parse(flags, matches)?;
|
||||
}
|
||||
location_arg_parse(flags, matches);
|
||||
flags.internal_use_lsc_cache = matches.get_flag("internal-use-lsc-cache");
|
||||
v8_flags_arg_parse(flags, matches);
|
||||
seed_arg_parse(flags, matches);
|
||||
enable_testing_features_arg_parse(flags, matches);
|
||||
|
|
|
@ -1810,6 +1810,10 @@ impl CliOptions {
|
|||
&self.flags.v8_flags
|
||||
}
|
||||
|
||||
pub fn use_lsc_cache(&self) -> bool {
|
||||
self.flags.internal_use_lsc_cache
|
||||
}
|
||||
|
||||
pub fn code_cache_enabled(&self) -> bool {
|
||||
self.flags.code_cache_enabled
|
||||
}
|
||||
|
|
|
@ -1130,6 +1130,7 @@ impl CliFactory {
|
|||
pkg_json_resolver,
|
||||
self.root_cert_store_provider().clone(),
|
||||
cli_options.resolve_storage_key_resolver(),
|
||||
cli_options.use_lsc_cache(),
|
||||
self.sys(),
|
||||
self.create_lib_main_worker_options()?,
|
||||
);
|
||||
|
|
|
@ -173,6 +173,7 @@ struct LibWorkerFactorySharedState<TSys: DenoLibSys> {
|
|||
root_cert_store_provider: Arc<dyn RootCertStoreProvider>,
|
||||
shared_array_buffer_store: SharedArrayBufferStore,
|
||||
storage_key_resolver: StorageKeyResolver,
|
||||
use_lsc_cache: bool,
|
||||
sys: TSys,
|
||||
options: LibMainWorkerOptions,
|
||||
}
|
||||
|
@ -303,7 +304,7 @@ impl<TSys: DenoLibSys> LibWorkerFactorySharedState<TSys> {
|
|||
worker_type: args.worker_type,
|
||||
stdio: stdio.clone(),
|
||||
cache_storage_dir,
|
||||
use_lsc_cache: false,
|
||||
use_lsc_cache: shared.use_lsc_cache,
|
||||
strace_ops: shared.options.strace_ops.clone(),
|
||||
close_on_idle: args.close_on_idle,
|
||||
maybe_worker_metadata: args.maybe_worker_metadata,
|
||||
|
@ -335,6 +336,7 @@ impl<TSys: DenoLibSys> LibMainWorkerFactory<TSys> {
|
|||
pkg_json_resolver: Arc<node_resolver::PackageJsonResolver<TSys>>,
|
||||
root_cert_store_provider: Arc<dyn RootCertStoreProvider>,
|
||||
storage_key_resolver: StorageKeyResolver,
|
||||
use_lsc_cache: bool,
|
||||
sys: TSys,
|
||||
options: LibMainWorkerOptions,
|
||||
) -> Self {
|
||||
|
@ -354,6 +356,7 @@ impl<TSys: DenoLibSys> LibMainWorkerFactory<TSys> {
|
|||
root_cert_store_provider,
|
||||
shared_array_buffer_store: Default::default(),
|
||||
storage_key_resolver,
|
||||
use_lsc_cache,
|
||||
sys,
|
||||
options,
|
||||
}),
|
||||
|
@ -463,7 +466,7 @@ impl<TSys: DenoLibSys> LibMainWorkerFactory<TSys> {
|
|||
should_wait_for_inspector_session: shared.options.inspect_wait,
|
||||
strace_ops: shared.options.strace_ops.clone(),
|
||||
cache_storage_dir,
|
||||
use_lsc_cache: false,
|
||||
use_lsc_cache: shared.use_lsc_cache,
|
||||
origin_storage_dir,
|
||||
stdio,
|
||||
skip_op_registration: shared.options.skip_op_registration,
|
||||
|
|
|
@ -1006,6 +1006,7 @@ pub async fn run(
|
|||
pkg_json_resolver,
|
||||
root_cert_store_provider,
|
||||
StorageKeyResolver::empty(),
|
||||
false,
|
||||
sys.clone(),
|
||||
lib_main_worker_options,
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue