| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 078efe3 commit 8480280
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -975,21 +975,8 @@ ExitCode BuildSnapshotWithoutCodeCache( | |||
| 975 | 975 | ExitCode BuildCodeCacheFromSnapshot(SnapshotData* out, | |
| 976 | 976 | const std::vector<std::string>& args, | |
| 977 | 977 | const std::vector<std::string>& exec_args) { | |
| 978 | - std::vector<std::string> errors; | ||
| 979 | - auto data_wrapper = out->AsEmbedderWrapper(); | ||
| 980 | - auto setup = CommonEnvironmentSetup::CreateFromSnapshot( | ||
| 981 | - per_process::v8_platform.Platform(), | ||
| 982 | - &errors, | ||
| 983 | - data_wrapper.get(), | ||
| 984 | - args, | ||
| 985 | - exec_args); | ||
| 986 | - if (!setup) { | ||
| 987 | - for (const auto& err : errors) | ||
| 988 | - fprintf(stderr, "%s: %s\n", args[0].c_str(), err.c_str()); | ||
| 989 | - return ExitCode::kBootstrapFailure; | ||
| 990 | - } | ||
| 991 | - | ||
| 992 | - Isolate* isolate = setup->isolate(); | ||
| 978 | + RAIIIsolate raii_isolate(out); | ||
| 979 | + Isolate* isolate = raii_isolate.get(); | ||
| 993 | 980 | v8::Locker locker(isolate); | |
| 994 | 981 | Isolate::Scope isolate_scope(isolate); | |
| 995 | 982 | HandleScope handle_scope(isolate); | |
@@ -1002,12 +989,14 @@ ExitCode BuildCodeCacheFromSnapshot(SnapshotData* out, | |||
| 1002 | 989 | } | |
| 1003 | 990 | }); | |
| 1004 | 991 | ||
| 1005 | - Environment* env = setup->env(); | ||
| 992 | + Local<Context> context = Context::New(isolate); | ||
| 993 | + Context::Scope context_scope(context); | ||
| 994 | + builtins::BuiltinLoader builtin_loader; | ||
| 1006 | 995 | // Regenerate all the code cache. | |
| 1007 | - if (!env->builtin_loader()->CompileAllBuiltins(setup->context())) { | ||
| 996 | + if (!builtin_loader.CompileAllBuiltins(context)) { | ||
| 1008 | 997 | return ExitCode::kGenericUserError; | |
| 1009 | 998 | } | |
| 1010 | - env->builtin_loader()->CopyCodeCache(&(out->code_cache)); | ||
| 999 | + builtin_loader.CopyCodeCache(&(out->code_cache)); | ||
| 1011 | 1000 | if (per_process::enabled_debug_list.enabled(DebugCategory::MKSNAPSHOT)) { | |
| 1012 | 1001 | for (const auto& item : out->code_cache) { | |
| 1013 | 1002 | std::string size_str = FormatSize(item.data.length); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments