Index: src/x64/codegen-x64.cc |
diff --git a/src/x64/codegen-x64.cc b/src/x64/codegen-x64.cc |
index 3b03477c45ba06d69bde43b3021a7483204b7832..54c5b5c75af16e07c10eb7b10df70a4ecef46ccb 100644 |
--- a/src/x64/codegen-x64.cc |
+++ b/src/x64/codegen-x64.cc |
@@ -4140,6 +4140,22 @@ void CodeGenerator::GenerateNumberToString(ZoneList<Expression*>* args) { |
} |
+void CodeGenerator::GenerateCallFunction(ZoneList<Expression*>* args) { |
+ Comment cmnt(masm_, "[ GenerateCallFunction"); |
+ |
+ ASSERT(args->length() >= 2); |
+ |
+ int n_args = args->length() - 2; // for receiver and function. |
+ Load(args->at(0)); // receiver |
+ for (int i = 0; i < n_args; i++) { |
+ Load(args->at(i + 1)); |
+ } |
+ Load(args->at(n_args + 1)); // function |
+ Result result = frame_->CallJSFunction(n_args); |
+ frame_->Push(&result); |
+} |
+ |
+ |
void CodeGenerator::GenerateMathSin(ZoneList<Expression*>* args) { |
ASSERT_EQ(args->length(), 1); |
// Load the argument on the stack and jump to the runtime. |