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

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: 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/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 ba1c701c556977e0f5a4d8a95d1fc2d733ff5470..a7e14f3fa18f6dd4bd7a67223830f788a22cfe83 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -1821,6 +1821,22 @@ void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) {
__ Dispatch();
}
+// CreateCatchContext <exception> <index>
+//
+// Creates a new context for a catch block with the |exception| in register and
+// the variable name at |index| for and the closure in the accumulator.
Michael Starzinger 2016/08/18 15:00:42 nit: Stray "for" in comment.
klaasb 2016/08/18 15:21:42 Done.
+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();
+}
+
// CreateMappedArguments
//
// Creates a new mapped arguments object.
« 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