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

Unified Diff: src/interpreter/interpreter.cc

Issue 1568493002: [Interpreter] Add support for calling runtime functions which return a pair. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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 fce2a3a2a460fdb47cedbbfd3649664984abbe43..6a3297b7394245710ec69e905cd674815facbd23 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -1046,6 +1046,31 @@ void Interpreter::DoCallRuntime(compiler::InterpreterAssembler* assembler) {
}
+// CallRuntimePair <function_id> <first_arg> <arg_count> <first_return>
+//
+// Call the runtime function |function_id| which returns a pair, with the
+// first argument in register |first_arg| and |arg_count| arguments in
+// subsequent registers.
+void Interpreter::DoCallRuntimePair(compiler::InterpreterAssembler* assembler) {
+ // Call the runtime function.
+ Node* function_id = __ BytecodeOperandIdx(0);
+ Node* first_arg_reg = __ BytecodeOperandReg(1);
+ Node* first_arg = __ RegisterLocation(first_arg_reg);
+ Node* args_count = __ BytecodeOperandCount(2);
+ Node* result_pair = __ CallRuntimePair(function_id, first_arg, args_count);
+
+ // Store the results in <first_return> and <first_return + 1>
+ Node* first_return_reg = __ BytecodeOperandReg(3);
+ Node* second_return_reg = __ NextRegister(first_return_reg);
+ Node* result_0 = __ Projection(0, result_pair);
oth 2016/01/06 16:26:07 More widely used convention result0, result1, e.g.
rmcilroy 2016/01/07 17:21:43 Done.
+ Node* result_1 = __ Projection(1, result_pair);
+ __ StoreRegister(result_0, first_return_reg);
+ __ StoreRegister(result_1, second_return_reg);
+
+ __ Dispatch();
+}
+
+
// CallJSRuntime <context_index> <receiver> <arg_count>
//
// Call the JS runtime function that has the |context_index| with the receiver

Powered by Google App Engine
This is Rietveld 408576698