diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2023-11-15 04:25:55 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-15 13:25:55 +0100 |
commit | 7f3902b41f68edddbc50b01ea52c697827d8516f (patch) | |
tree | 4fae66aafc0d4c81e9fa39d7e2e2117f1afcf551 /runtime/js/99_main.js | |
parent | c67de43ff3221ae5554398095261d684b6d41dda (diff) |
perf: static bootstrap options in snapshot (#21213)
Closes https://github.com/denoland/deno/issues/21133
Diffstat (limited to 'runtime/js/99_main.js')
-rw-r--r-- | runtime/js/99_main.js | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index 76a279bbd..89296d632 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -450,6 +450,13 @@ const finalDenoNs = { ...denoNs, }; +const { + denoVersion, + tsVersion, + v8Version, + target, +} = ops.op_snapshot_options(); + function bootstrapMainRuntime(runtimeOptions) { if (hasBootstrapped) { throw new Error("Worker runtime already bootstrapped"); @@ -457,16 +464,12 @@ function bootstrapMainRuntime(runtimeOptions) { const nodeBootstrap = globalThis.nodeBootstrap; const { - 0: denoVersion, - 1: location_, - 2: tsVersion, - 3: unstableFlag, - 4: unstableFeatures, - 5: target, - 6: v8Version, - 7: inspectFlag, - 9: hasNodeModulesDir, - 10: maybeBinaryNpmCommandName, + 0: location_, + 1: unstableFlag, + 2: unstableFeatures, + 3: inspectFlag, + 5: hasNodeModulesDir, + 6: maybeBinaryNpmCommandName, } = runtimeOptions; performance.setTimeOrigin(DateNow()); @@ -583,16 +586,12 @@ function bootstrapWorkerRuntime( const nodeBootstrap = globalThis.nodeBootstrap; const { - 0: denoVersion, - 1: location_, - 2: tsVersion, - 3: unstableFlag, - 4: unstableFeatures, - 5: target, - 6: v8Version, - 8: enableTestingFeaturesFlag, - 9: hasNodeModulesDir, - 10: maybeBinaryNpmCommandName, + 0: location_, + 1: unstableFlag, + 2: unstableFeatures, + 4: enableTestingFeaturesFlag, + 5: hasNodeModulesDir, + 6: maybeBinaryNpmCommandName, } = runtimeOptions; performance.setTimeOrigin(DateNow()); |