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

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
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index d5fa0d0bc0fabf1bd920e75f93acfaeaff290dc7..39492cf24357877574dec1e3e18299a08c75b5ca 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();
}

Powered by Google App Engine
This is Rietveld 408576698