Index: src/compiler/js-generic-lowering.cc |
diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc |
index 0261e4c6472a4f70c46eb311790ee389e81ba51e..5a6e9411346f317ebcc894fc82431ee060992174 100644 |
--- a/src/compiler/js-generic-lowering.cc |
+++ b/src/compiler/js-generic-lowering.cc |
@@ -429,6 +429,15 @@ void JSGenericLowering::LowerJSStoreContext(Node* node) { |
} |
+void JSGenericLowering::LowerJSLoadNativeContext(Node* node) { |
+ node->ReplaceInput( |
+ 1, jsgraph()->IntPtrConstant(JSGlobalObject::kNativeContextOffset - |
+ kHeapObjectTag)); |
+ node->AppendInput(zone(), graph()->start()); |
+ NodeProperties::ChangeOp(node, machine()->Load(kMachAnyTagged)); |
+} |
+ |
+ |
void JSGenericLowering::LowerJSLoadDynamic(Node* node) { |
const DynamicAccess& access = DynamicAccessOf(node->op()); |
Runtime::FunctionId function_id = |
@@ -465,6 +474,26 @@ void JSGenericLowering::LowerJSCreateArguments(Node* node) { |
} |
+void JSGenericLowering::LowerJSCreateArray(Node* node) { |
+ CreateArrayParameters const& p = CreateArrayParametersOf(node->op()); |
+ int const arity = static_cast<int>(p.arity()); |
+ Node* new_target = node->InputAt(1); |
+ // TODO(turbofan): We embed the AllocationSite from the Operator at this |
+ // point, which we should not do once we want to both consume the feedback |
+ // but at the same time shared the optimized code across native contexts, |
+ // as the AllocationSite is associated with a single native context (it's |
+ // stored in the type feedback vector after all). Once we go for cross |
+ // context code generation, we should somehow find a way to get to the |
+ // allocation site for the actual native context at runtime. |
+ Node* type_info = p.site().is_null() ? jsgraph()->UndefinedConstant() |
+ : jsgraph()->HeapConstant(p.site()); |
+ node->RemoveInput(1); |
+ node->InsertInput(zone(), 1 + arity, new_target); |
+ node->InsertInput(zone(), 2 + arity, type_info); |
+ ReplaceWithRuntimeCall(node, Runtime::kNewArray, arity + 3); |
+} |
+ |
+ |
void JSGenericLowering::LowerJSCreateClosure(Node* node) { |
CreateClosureParameters p = CreateClosureParametersOf(node->op()); |
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(p.shared_info())); |
@@ -510,8 +539,9 @@ void JSGenericLowering::LowerJSCreateScriptContext(Node* node) { |
void JSGenericLowering::LowerJSCallConstruct(Node* node) { |
+ CallConstructParameters const& p = CallConstructParametersOf(node->op()); |
+ int const arity = static_cast<int>(p.arity()); |
// TODO(bmeurer): Use the Construct builtin here. |
- int arity = OpParameter<int>(node); |
CallConstructStub stub(isolate(), SUPER_CONSTRUCTOR_CALL); |
CallInterfaceDescriptor d = stub.GetCallInterfaceDescriptor(); |
CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |