Commit 6c744a97 authored by jochen's avatar jochen Committed by Commit bot

Don't create a handle scope when finalizing the bytecode

During finalization, we create SharedFunctionInfos which in turn
will create ScopeInfos for the Scopes in the AST. The Scopes then
cache a handle to the ScopeInfos. However, once the scope is closed,
all those handles get zapped, and it's no longer possible to access
the scopes (even though we actually still need the AST).

R=rmcilroy@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2278933002
Cr-Commit-Position: refs/heads/master@{#38898}
parent c2d2d4d1
......@@ -686,12 +686,9 @@ BytecodeGenerator::BytecodeGenerator(CompilationInfo* info)
}
Handle<BytecodeArray> BytecodeGenerator::FinalizeBytecode(Isolate* isolate) {
// Create an inner HandleScope to avoid unnecessarily canonicalizing handles
// created as part of bytecode finalization.
HandleScope scope(isolate);
AllocateDeferredConstants();
if (HasStackOverflow()) return Handle<BytecodeArray>();
return scope.CloseAndEscape(builder()->ToBytecodeArray(isolate));
return builder()->ToBytecodeArray(isolate);
}
void BytecodeGenerator::AllocateDeferredConstants() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment