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

Unified Diff: src/compiler/raw-machine-assembler.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/compiler/raw-machine-assembler.cc
diff --git a/src/compiler/raw-machine-assembler.cc b/src/compiler/raw-machine-assembler.cc
index 623d5a2ed3bf84408c3d32db6184b4459bcb8c9e..f72380a318fbdb20eade8a8af6d544a240306b55 100644
--- a/src/compiler/raw-machine-assembler.cc
+++ b/src/compiler/raw-machine-assembler.cc
@@ -162,6 +162,30 @@ Node* RawMachineAssembler::TailCallN(CallDescriptor* desc, Node* function,
}
+Node* RawMachineAssembler::CallVarArgs(CallDescriptor* desc, Node* function,
+ Node** fixed_args, Node* first_var_arg,
+ Node* last_var_arg) {
+ DCHECK(desc->HasVarArgs());
+ int fixed_param_count =
+ static_cast<int>(desc->GetMachineSignature()->parameter_count());
+ int input_count = fixed_param_count + 5;
+ Node** buffer = zone()->NewArray<Node*>(input_count);
+ int index = 0;
+ buffer[index++] = function;
+ for (int i = 0; i < fixed_param_count; i++) {
+ buffer[index++] = fixed_args[i];
+ }
+ buffer[index++] = first_var_arg;
+ buffer[index++] = last_var_arg;
+ buffer[index++] = graph()->start();
+ buffer[index++] = graph()->start();
+ Node* call =
+ graph()->NewNode(common()->CallVarArgs(desc), input_count, buffer);
+ schedule()->AddNode(CurrentBlock(), call);
+ return call;
+}
+
+
Node* RawMachineAssembler::CallFunctionStub0(Node* function, Node* receiver,
Node* context, Node* frame_state,
CallFunctionFlags flags) {

Powered by Google App Engine
This is Rietveld 408576698