Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: src/interpreter/bytecode-generator.cc

Issue 2226923002: [Interpereter] Avoid Canonicalizing Handles created during bytecode finalization (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@clusterfuzz_stackoverflow
Patch Set: Rebase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index 1637fbb777a36a23e184d7ae74123cb1cbc6abc4..552d214de50fdebecbade382a158838d4cb656b8 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -627,12 +627,16 @@ BytecodeGenerator::BytecodeGenerator(CompilationInfo* info)
}
Handle<BytecodeArray> BytecodeGenerator::MakeBytecode() {
+ // Create an inner HandleScope to avoid unnecessarily canonicalizing handles
+ // created as part of bytecode finalization.
+ HandleScope scope(isolate());
+
GenerateBytecode();
FinalizeBytecode();
if (HasStackOverflow()) return Handle<BytecodeArray>();
- return builder()->ToBytecodeArray();
+ return scope.CloseAndEscape(builder()->ToBytecodeArray());
}
void BytecodeGenerator::FinalizeBytecode() {
« no previous file with comments | « src/compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698