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

Unified Diff: src/compiler/js-generic-lowering.cc

Issue 1410853007: [turbofan] Remove use of CallFunctionStub from TurboFan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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/ast-graph-builder.cc ('k') | src/compiler/js-intrinsic-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-generic-lowering.cc
diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc
index 7af86889bf946a9a6e8c6a29f367d81b0cf63848..7b75f0f4916360d3d8a023ba5edf379610e64419 100644
--- a/src/compiler/js-generic-lowering.cc
+++ b/src/compiler/js-generic-lowering.cc
@@ -520,6 +520,7 @@ void JSGenericLowering::LowerJSCreateScriptContext(Node* node) {
void JSGenericLowering::LowerJSCallConstruct(Node* node) {
+ // TODO(bmeurer): Use the Construct builtin here.
int arity = OpParameter<int>(node);
CallConstructStub stub(isolate(), SUPER_CONSTRUCTOR_CALL);
CallInterfaceDescriptor d = stub.GetCallInterfaceDescriptor();
@@ -540,18 +541,19 @@ void JSGenericLowering::LowerJSCallConstruct(Node* node) {
void JSGenericLowering::LowerJSCallFunction(Node* node) {
- const CallFunctionParameters& p = CallFunctionParametersOf(node->op());
- int arg_count = static_cast<int>(p.arity() - 2);
- CallFunctionStub stub(isolate(), arg_count, p.flags());
- CallInterfaceDescriptor d = stub.GetCallInterfaceDescriptor();
+ CallFunctionParameters const& p = CallFunctionParametersOf(node->op());
+ int const arg_count = static_cast<int>(p.arity() - 2);
+ Callable callable = CodeFactory::Call(isolate());
CallDescriptor::Flags flags = AdjustFrameStatesForCall(node);
- if (p.AllowTailCalls()) {
+ if (p.tail_call_mode() == TailCallMode::kAllow) {
flags |= CallDescriptor::kSupportsTailCalls;
}
CallDescriptor* desc = Linkage::GetStubCallDescriptor(
- isolate(), zone(), d, static_cast<int>(p.arity() - 1), flags);
- Node* stub_code = jsgraph()->HeapConstant(stub.GetCode());
+ isolate(), zone(), callable.descriptor(), arg_count + 1, flags);
+ Node* stub_code = jsgraph()->HeapConstant(callable.code());
+ Node* stub_arity = jsgraph()->Int32Constant(arg_count);
node->InsertInput(zone(), 0, stub_code);
+ node->InsertInput(zone(), 2, stub_arity);
NodeProperties::ChangeOp(node, common()->Call(desc));
}
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/compiler/js-intrinsic-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698