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

Unified Diff: src/interpreter/interpreter.cc

Issue 1323463005: [Interpreter] Add support for JS calls. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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/interpreter.cc
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index 334f7d3eaf56bd9262d18b2551cf0ee20c4d8c01..f24bda0c19fb4c2d1d78c7cfb80e54233630b197 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -282,6 +282,24 @@ void Interpreter::DoMod(compiler::InterpreterAssembler* assembler) {
}
+// CallJS <first_arg_reg> <arg_count>
+//
+// Call a JS function with arguments in registers <first_arg_reg> to
+// <first_arg_reg + arg_count>. The JSfunction or Callable to call is in
+// the accumulator.
+void Interpreter::DoCallJS(compiler::InterpreterAssembler* assembler) {
+ Node* first_arg_reg_index = __ BytecodeOperandReg(0);
+ Node* first_arg = __ RegisterLocation(first_arg_reg_index);
+ Node* args_count = __ BytecodeOperandCount(1);
+ Node* args_size = __ WordShl(args_count, kPointerSizeLog2);
+ Node* last_arg = __ IntPtrSub(first_arg, args_size);
+ Node* function = __ GetAccumulator();
+ Node* result = __ CallJS(function, first_arg, last_arg);
+ __ SetAccumulator(result);
+ __ Dispatch();
+}
+
+
// Return
//
// Return the value in register 0.

Powered by Google App Engine
This is Rietveld 408576698