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

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

Issue 1234023003: [turbofan] Build graphs for super constructor calls. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix compilation in release mode. Created 5 years, 5 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/ast-graph-builder.cc ('k') | no next file » | 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 1dbe382cfd29b26f4550d9ee3e6fd864a774f18f..85c5fb6bd8a806c8d0e1dbf66743529941e6e568 100644
--- a/src/compiler/js-generic-lowering.cc
+++ b/src/compiler/js-generic-lowering.cc
@@ -540,12 +540,16 @@ void JSGenericLowering::LowerJSCallConstruct(Node* node) {
CallInterfaceDescriptor d = stub.GetCallInterfaceDescriptor();
CallDescriptor::Flags flags = AdjustFrameStatesForCall(node);
CallDescriptor* desc =
- Linkage::GetStubCallDescriptor(isolate(), zone(), d, arity, flags);
+ Linkage::GetStubCallDescriptor(isolate(), zone(), d, arity - 1, flags);
Node* stub_code = jsgraph()->HeapConstant(stub.GetCode());
- Node* construct = NodeProperties::GetValueInput(node, 0);
+ Node* actual_construct = NodeProperties::GetValueInput(node, 0);
+ Node* original_construct = NodeProperties::GetValueInput(node, arity - 1);
+ node->RemoveInput(arity - 1); // Drop original constructor.
node->InsertInput(zone(), 0, stub_code);
- node->InsertInput(zone(), 1, jsgraph()->Int32Constant(arity - 1));
- node->InsertInput(zone(), 2, construct);
+ node->InsertInput(zone(), 1, jsgraph()->Int32Constant(arity - 2));
+ node->InsertInput(zone(), 2, actual_construct);
+ // TODO(mstarzinger): Pass original constructor in register.
+ CHECK_EQ(actual_construct, original_construct);
node->InsertInput(zone(), 3, jsgraph()->UndefinedConstant());
node->set_op(common()->Call(desc));
}
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698