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

Unified Diff: src/crankshaft/hydrogen.cc

Issue 1775933005: Revert of Rework CallApi*Stubs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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/compiler/fast-accessor-assembler.cc ('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/crankshaft/hydrogen.cc
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc
index 3ecefe0a84cedff14aeb16f79bd3a47e47f9d9e0..162424f23d82a151b261bfcd3fbd324009f0bdf2 100644
--- a/src/crankshaft/hydrogen.cc
+++ b/src/crankshaft/hydrogen.cc
@@ -9241,10 +9241,6 @@
if (syntactic_tail_call_mode == TailCallMode::kAllow) {
return false;
}
- if (argc > CallApiCallbackStub::kArgMax) {
- return false;
- }
-
CallOptimization optimization(function);
if (!optimization.is_simple_api_call()) return false;
Handle<Map> holder_map;
@@ -9340,22 +9336,33 @@
api_function_address, nullptr};
HInstruction* call = nullptr;
- CHECK(argc <= CallApiCallbackStub::kArgMax);
if (!is_function) {
- CallApiCallbackStub stub(isolate(), is_store, call_data_undefined,
+ CallApiAccessorStub stub(isolate(), is_store, call_data_undefined,
!optimization.is_constant_call());
Handle<Code> code = stub.GetCode();
HConstant* code_value = Add<HConstant>(code);
+ ApiAccessorDescriptor descriptor(isolate());
call = New<HCallWithDescriptor>(
- code_value, argc + 1, stub.GetCallInterfaceDescriptor(),
+ code_value, argc + 1, descriptor,
Vector<HValue*>(op_vals, arraysize(op_vals) - 1));
- } else {
- CallApiCallbackStub stub(isolate(), argc, call_data_undefined);
+ } 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());
call = New<HCallWithDescriptor>(
- code_value, argc + 1, stub.GetCallInterfaceDescriptor(),
+ code_value, argc + 1, descriptor,
Vector<HValue*>(op_vals, arraysize(op_vals) - 1));
+ Drop(1); // Drop function.
+ } else {
+ op_vals[arraysize(op_vals) - 1] = Add<HConstant>(argc);
+ CallApiFunctionStub stub(isolate(), call_data_undefined);
+ Handle<Code> code = stub.GetCode();
+ HConstant* code_value = Add<HConstant>(code);
+ ApiFunctionDescriptor descriptor(isolate());
+ call =
+ New<HCallWithDescriptor>(code_value, argc + 1, descriptor,
+ Vector<HValue*>(op_vals, arraysize(op_vals)));
Drop(1); // Drop function.
}
« no previous file with comments | « src/compiler/fast-accessor-assembler.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698