Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index dac6935e92b688c3e89852157ad034612af8dc12..dbf1493034d469f726229e160fb6a090e6f4985b 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -23618,13 +23618,36 @@ Local<Object> ApiCallOptimizationChecker::callee; |
int ApiCallOptimizationChecker::count = 0; |
-TEST(TestFunctionCallOptimization) { |
+TEST(FunctionCallOptimization) { |
i::FLAG_allow_natives_syntax = true; |
ApiCallOptimizationChecker checker; |
checker.RunAll(); |
} |
+static void EmptyCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {} |
+ |
+ |
+TEST(FunctionCallOptimizationMultipleArgs) { |
+ i::FLAG_allow_natives_syntax = true; |
+ LocalContext context; |
+ v8::Isolate* isolate = context->GetIsolate(); |
+ v8::HandleScope scope(isolate); |
+ Handle<Object> global = context->Global(); |
+ Local<v8::Function> function = Function::New(isolate, EmptyCallback); |
+ global->Set(v8_str("x"), function); |
+ CompileRun( |
+ "function x_wrap() {\n" |
+ " for (var i = 0; i < 5; i++) {\n" |
+ " x(1,2,3);\n" |
+ " }\n" |
+ "}\n" |
+ "x_wrap();\n" |
+ "%OptimizeFunctionOnNextCall(x_wrap);" |
+ "x_wrap();\n"); |
+} |
+ |
+ |
static const char* last_event_message; |
static int last_event_status; |
void StoringEventLoggerCallback(const char* message, int status) { |