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

Unified Diff: src/interpreter/interpreter.cc

Issue 2260473003: [interpreter] Add CreateCatchContext bytecode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: group context bytecodes 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/interpreter/bytecodes.h ('k') | test/cctest/interpreter/bytecode_expectations/ForOf.golden » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/interpreter.cc
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index 15c0ce8a09b24cf151d19d44e9fd86a291b32486..dc9af07be843d5bafde4196341610d6ce6aad82c 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -1809,6 +1809,22 @@ void Interpreter::DoCreateBlockContext(InterpreterAssembler* assembler) {
__ Dispatch();
}
+// CreateCatchContext <exception> <index>
+//
+// Creates a new context for a catch block with the |exception| in a register,
+// the variable name at |index| and the closure in the accumulator.
+void Interpreter::DoCreateCatchContext(InterpreterAssembler* assembler) {
+ Node* exception_reg = __ BytecodeOperandReg(0);
+ Node* exception = __ LoadRegister(exception_reg);
+ Node* index = __ BytecodeOperandIdx(1);
+ Node* name = __ LoadConstantPoolEntry(index);
+ Node* closure = __ GetAccumulator();
+ Node* context = __ GetContext();
+ __ SetAccumulator(__ CallRuntime(Runtime::kPushCatchContext, context, name,
+ exception, closure));
+ __ Dispatch();
+}
+
// CreateFunctionContext <slots>
//
// Creates a new context with number of |slots| for the function closure.
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | test/cctest/interpreter/bytecode_expectations/ForOf.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698