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

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

Issue 2302013002: Store the scope info in catch contexts (Closed)
Patch Set: updates Created 4 years, 3 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/interpreter/bytecode-generator.h ('k') | src/interpreter/bytecodes.h » ('j') | 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 7f3a3ac8f6132875fa7c3c7e0f1fa5af84f5d8fd..16ba1039ac04977277bdf0058bc82e085a75f556 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -1386,7 +1386,7 @@ void BytecodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) {
try_control_builder.EndTry();
// Create a catch scope that binds the exception.
- VisitNewLocalCatchContext(stmt->variable());
+ VisitNewLocalCatchContext(stmt->variable(), stmt->scope());
builder()->StoreAccumulatorInRegister(context);
// If requested, clear message object as we enter the catch block.
@@ -3210,14 +3210,16 @@ void BytecodeGenerator::VisitNewLocalWithContext() {
execution_result()->SetResultInAccumulator();
}
-void BytecodeGenerator::VisitNewLocalCatchContext(Variable* variable) {
+void BytecodeGenerator::VisitNewLocalCatchContext(Variable* variable,
+ Scope* scope) {
AccumulatorResultScope accumulator_execution_result(this);
DCHECK(variable->IsContextSlot());
Register exception = register_allocator()->NewRegister();
builder()->StoreAccumulatorInRegister(exception);
VisitFunctionClosureForContext();
- builder()->CreateCatchContext(exception, variable->name());
+ builder()->CreateCatchContext(exception, variable->name(),
+ scope->scope_info());
execution_result()->SetResultInAccumulator();
}
« no previous file with comments | « src/interpreter/bytecode-generator.h ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698