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

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

Issue 2260473003: [interpreter] Add CreateCatchContext bytecode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
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
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index 9856f7a2774b8372294563978bfa92aaa4b9a765..1d3bcb8bfd0681e12463a197922fb7515ec3203c 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -3234,19 +3234,10 @@ void BytecodeGenerator::VisitNewLocalCatchContext(Variable* variable) {
AccumulatorResultScope accumulator_execution_result(this);
DCHECK(variable->IsContextSlot());
- // Allocate a new local block context.
- register_allocator()->PrepareForConsecutiveAllocations(3);
- Register name = register_allocator()->NextConsecutiveRegister();
- Register exception = register_allocator()->NextConsecutiveRegister();
- Register closure = register_allocator()->NextConsecutiveRegister();
-
- builder()
- ->StoreAccumulatorInRegister(exception)
- .LoadLiteral(variable->name())
- .StoreAccumulatorInRegister(name);
+ Register exception = register_allocator()->NewRegister();
+ builder()->StoreAccumulatorInRegister(exception);
VisitFunctionClosureForContext();
- builder()->StoreAccumulatorInRegister(closure).CallRuntime(
- Runtime::kPushCatchContext, name, 3);
+ builder()->CreateCatchContext(exception, variable->name());
execution_result()->SetResultInAccumulator();
}

Powered by Google App Engine
This is Rietveld 408576698