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

Unified Diff: src/hydrogen.cc

Issue 859783002: add stub for api function calls with known number of parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 5 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
« no previous file with comments | « src/code-stubs.h ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index a288dbde52fa6ea259846b52c6f8d2311de44513..cfdb3c89e5e5fc22687a5cfdac4946ce3ca162ab 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -8776,6 +8776,16 @@ bool HOptimizedGraphBuilder::TryInlineApiCall(Handle<JSFunction> function,
call = New<HCallWithDescriptor>(
code_value, argc + 1, descriptor,
Vector<HValue*>(op_vals, descriptor.GetEnvironmentLength()));
+ } else if (argc <= CallApiFunctionWithFixedArgsStub::kMaxFixedArgs) {
+ CallApiFunctionWithFixedArgsStub stub(isolate(), argc, call_data_undefined);
+ Handle<Code> code = stub.GetCode();
+ HConstant* code_value = Add<HConstant>(code);
+ ApiFunctionWithFixedArgsDescriptor descriptor(isolate());
+ DCHECK(arraysize(op_vals) - 1 == descriptor.GetEnvironmentLength());
+ call = New<HCallWithDescriptor>(
+ code_value, argc + 1, descriptor,
+ Vector<HValue*>(op_vals, descriptor.GetEnvironmentLength()));
+ Drop(1); // Drop function.
} else {
op_vals[arraysize(op_vals) - 1] = Add<HConstant>(argc);
CallApiFunctionStub stub(isolate(), call_data_undefined);
« no previous file with comments | « src/code-stubs.h ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698