| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1102922 commit 37ca110
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1169,8 +1169,7 @@ int Start(int argc, char** argv) { | |||
| 1169 | 1169 | } | |
| 1170 | 1170 | ||
| 1171 | 1171 | { | |
| 1172 | - bool use_node_snapshot = | ||
| 1173 | - per_process::cli_options->per_isolate->node_snapshot; | ||
| 1172 | + bool use_node_snapshot = per_process::cli_options->node_snapshot; | ||
| 1174 | 1173 | const SnapshotData* snapshot_data = | |
| 1175 | 1174 | use_node_snapshot ? SnapshotBuilder::GetEmbeddedSnapshotData() | |
| 1176 | 1175 | : nullptr; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -650,10 +650,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser( | |||
| 650 | 650 | "track heap object allocations for heap snapshots", | |
| 651 | 651 | &PerIsolateOptions::track_heap_objects, | |
| 652 | 652 | kAllowedInEnvironment); | |
| 653 | - AddOption("--node-snapshot", | ||
| 654 | - "", // It's a debug-only option. | ||
| 655 | - &PerIsolateOptions::node_snapshot, | ||
| 656 | - kAllowedInEnvironment); | ||
| 657 | 653 | ||
| 658 | 654 | // Explicitly add some V8 flags to mark them as allowed in NODE_OPTIONS. | |
| 659 | 655 | AddOption("--abort-on-uncaught-exception", | |
@@ -755,7 +751,10 @@ PerProcessOptionsParser::PerProcessOptionsParser( | |||
| 755 | 751 | "Currently only supported in the node_mksnapshot binary.", | |
| 756 | 752 | &PerProcessOptions::build_snapshot, | |
| 757 | 753 | kDisallowedInEnvironment); | |
| 758 | - | ||
| 754 | + AddOption("--node-snapshot", | ||
| 755 | + "", // It's a debug-only option. | ||
| 756 | + &PerProcessOptions::node_snapshot, | ||
| 757 | + kAllowedInEnvironment); | ||
| 759 | 758 | // 12.x renamed this inadvertently, so alias it for consistency within the | |
| 760 | 759 | // release line, while using the original name for consistency with older | |
| 761 | 760 | // release lines. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -203,7 +203,6 @@ class PerIsolateOptions : public Options { | |||
| 203 | 203 | public: | |
| 204 | 204 | std::shared_ptr<EnvironmentOptions> per_env { new EnvironmentOptions() }; | |
| 205 | 205 | bool track_heap_objects = false; | |
| 206 | - bool node_snapshot = true; | ||
| 207 | 206 | bool report_uncaught_exception = false; | |
| 208 | 207 | bool report_on_signal = false; | |
| 209 | 208 | bool experimental_top_level_await = true; | |
@@ -231,7 +230,11 @@ class PerProcessOptions : public Options { | |||
| 231 | 230 | bool zero_fill_all_buffers = false; | |
| 232 | 231 | bool debug_arraybuffer_allocations = false; | |
| 233 | 232 | std::string disable_proto; | |
| 234 | - bool build_snapshot; | ||
| 233 | + bool build_snapshot = false; | ||
| 234 | + // We enable the shared read-only heap which currently requires that the | ||
| 235 | + // snapshot used in different isolates in the same process to be the same. | ||
| 236 | + // Therefore --node-snapshot is a per-process option. | ||
| 237 | + bool node_snapshot = true; | ||
| 235 | 238 | ||
| 236 | 239 | std::vector<std::string> security_reverts; | |
| 237 | 240 | bool print_bash_completion = false; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -147,14 +147,7 @@ class WorkerThreadData { | |||
| 147 | 147 | SetIsolateCreateParamsForNode(¶ms); | |
| 148 | 148 | params.array_buffer_allocator_shared = allocator; | |
| 149 | 149 | ||
| 150 | - bool use_node_snapshot = true; | ||
| 151 | - if (w_->per_isolate_opts_) { | ||
| 152 | - use_node_snapshot = w_->per_isolate_opts_->node_snapshot; | ||
| 153 | - } else { | ||
| 154 | - // IsolateData is created after the Isolate is created so we'll | ||
| 155 | - // inherit the option from the parent here. | ||
| 156 | - use_node_snapshot = per_process::cli_options->per_isolate->node_snapshot; | ||
| 157 | - } | ||
| 150 | + bool use_node_snapshot = per_process::cli_options->node_snapshot; | ||
| 158 | 151 | const SnapshotData* snapshot_data = | |
| 159 | 152 | use_node_snapshot ? SnapshotBuilder::GetEmbeddedSnapshotData() | |
| 160 | 153 | : nullptr; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments