| Index: src/api.cc
|
| diff --git a/src/api.cc b/src/api.cc
|
| index 94ac90ddae2e2d5afc6f39bfe9a993faa77a7c57..d0947ae81d8d632854096acb99ffa261697ac2c6 100644
|
| --- a/src/api.cc
|
| +++ b/src/api.cc
|
| @@ -2223,15 +2223,18 @@ MaybeLocal<Script> ScriptCompiler::Compile(Local<Context> context,
|
| source->info->set_script(script);
|
| source->info->set_context(isolate->native_context());
|
|
|
| - // Create a canonical handle scope before internalizing parsed values if
|
| - // compiling bytecode. This is required for off-thread bytecode generation.
|
| - std::unique_ptr<i::CanonicalHandleScope> canonical;
|
| - if (i::FLAG_ignition) canonical.reset(new i::CanonicalHandleScope(isolate));
|
| -
|
| - // Do the parsing tasks which need to be done on the main thread. This will
|
| - // also handle parse errors.
|
| - source->parser->Internalize(isolate, script,
|
| - source->info->literal() == nullptr);
|
| + {
|
| + // Create a canonical handle scope if compiling ignition bytecode. This is
|
| + // required by the constant array builder to de-duplicate objects without
|
| + // dereferencing handles.
|
| + std::unique_ptr<i::CanonicalHandleScope> canonical;
|
| + if (i::FLAG_ignition) canonical.reset(new i::CanonicalHandleScope(isolate));
|
| +
|
| + // Do the parsing tasks which need to be done on the main thread. This will
|
| + // also handle parse errors.
|
| + source->parser->Internalize(isolate, script,
|
| + source->info->literal() == nullptr);
|
| + }
|
| source->parser->HandleSourceURLComments(isolate, script);
|
|
|
| i::Handle<i::SharedFunctionInfo> result;
|
|
|