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

Unified Diff: src/interpreter/interpreter.cc

Issue 1362383002: [Interpreter] Add CallRuntime support to the interpreter. (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 f993724c3e1692a74513b6cc96b764a59b6cf8ad..2f341aaf75fc437923a334ad76f5beb71b916e98 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -343,10 +343,10 @@ void Interpreter::DoMod(compiler::InterpreterAssembler* assembler) {
}
-// Call <receiver> <arg_count>
+// Call <callable> <receiver> <arg_count>
//
-// Call a JS function with receiver and |arg_count| arguments in subsequent
-// registers. The JSfunction or Callable to call is in the accumulator.
+// Call a JSfunction or Callable in |callable| with receiver and |arg_count|
+// arguments in subsequent registers.
void Interpreter::DoCall(compiler::InterpreterAssembler* assembler) {
Node* function_reg = __ BytecodeOperandReg(0);
Node* function = __ LoadRegister(function_reg);
@@ -359,6 +359,21 @@ void Interpreter::DoCall(compiler::InterpreterAssembler* assembler) {
}
+// CallRuntime <function_id> <first_arg> <arg_count>
+//
+// Call the runtime function |function_id| with first argument in register
+// |first_arg| and |arg_count| arguments in subsequent registers.
+void Interpreter::DoCallRuntime(compiler::InterpreterAssembler* assembler) {
+ Node* function_id = __ BytecodeOperandIdx(0);
oth 2015/09/25 09:49:27 A TODO for the wider operand(s) discussed for func
rmcilroy 2015/09/28 16:20:47 Implemented as a wide operand now.
+ Node* first_arg_reg = __ BytecodeOperandReg(1);
+ Node* first_arg = __ RegisterLocation(first_arg_reg);
+ Node* args_count = __ BytecodeOperandCount(2);
+ Node* result = __ CallRuntime(function_id, first_arg, args_count);
+ __ SetAccumulator(result);
+ __ Dispatch();
+}
+
+
// TestEqual <src>
//
// Test if the value in the <src> register equals the accumulator.
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | src/snapshot/serialize.cc » ('j') | src/x64/builtins-x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698