| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/code-factory.h" | 5 #include "src/code-factory.h" |
| 6 #include "src/code-stubs.h" | 6 #include "src/code-stubs.h" |
| 7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
| 8 #include "src/compiler/js-generic-lowering.h" | 8 #include "src/compiler/js-generic-lowering.h" |
| 9 #include "src/compiler/js-graph.h" | 9 #include "src/compiler/js-graph.h" |
| 10 #include "src/compiler/machine-operator.h" | 10 #include "src/compiler/machine-operator.h" |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 | 530 |
| 531 void JSGenericLowering::LowerJSCreateCatchContext(Node* node) { | 531 void JSGenericLowering::LowerJSCreateCatchContext(Node* node) { |
| 532 Unique<String> name = OpParameter<Unique<String>>(node); | 532 Unique<String> name = OpParameter<Unique<String>>(node); |
| 533 node->InsertInput(zone(), 0, jsgraph()->HeapConstant(name)); | 533 node->InsertInput(zone(), 0, jsgraph()->HeapConstant(name)); |
| 534 ReplaceWithRuntimeCall(node, Runtime::kPushCatchContext); | 534 ReplaceWithRuntimeCall(node, Runtime::kPushCatchContext); |
| 535 } | 535 } |
| 536 | 536 |
| 537 | 537 |
| 538 void JSGenericLowering::LowerJSCallConstruct(Node* node) { | 538 void JSGenericLowering::LowerJSCallConstruct(Node* node) { |
| 539 int arity = OpParameter<int>(node); | 539 int arity = OpParameter<int>(node); |
| 540 CallConstructStub stub(isolate(), NO_CALL_CONSTRUCTOR_FLAGS); | 540 CallConstructStub stub(isolate(), SUPER_CONSTRUCTOR_CALL); |
| 541 CallInterfaceDescriptor d = stub.GetCallInterfaceDescriptor(); | 541 CallInterfaceDescriptor d = stub.GetCallInterfaceDescriptor(); |
| 542 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); | 542 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
| 543 CallDescriptor* desc = | 543 CallDescriptor* desc = |
| 544 Linkage::GetStubCallDescriptor(isolate(), zone(), d, arity - 1, flags); | 544 Linkage::GetStubCallDescriptor(isolate(), zone(), d, arity - 1, flags); |
| 545 Node* stub_code = jsgraph()->HeapConstant(stub.GetCode()); | 545 Node* stub_code = jsgraph()->HeapConstant(stub.GetCode()); |
| 546 Node* actual_construct = NodeProperties::GetValueInput(node, 0); | 546 Node* actual_construct = NodeProperties::GetValueInput(node, 0); |
| 547 Node* original_construct = NodeProperties::GetValueInput(node, arity - 1); | 547 Node* original_construct = NodeProperties::GetValueInput(node, arity - 1); |
| 548 node->RemoveInput(arity - 1); // Drop original constructor. | 548 node->RemoveInput(arity - 1); // Drop original constructor. |
| 549 node->InsertInput(zone(), 0, stub_code); | 549 node->InsertInput(zone(), 0, stub_code); |
| 550 node->InsertInput(zone(), 1, jsgraph()->Int32Constant(arity - 2)); | 550 node->InsertInput(zone(), 1, jsgraph()->Int32Constant(arity - 2)); |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 } | 841 } |
| 842 | 842 |
| 843 | 843 |
| 844 MachineOperatorBuilder* JSGenericLowering::machine() const { | 844 MachineOperatorBuilder* JSGenericLowering::machine() const { |
| 845 return jsgraph()->machine(); | 845 return jsgraph()->machine(); |
| 846 } | 846 } |
| 847 | 847 |
| 848 } // namespace compiler | 848 } // namespace compiler |
| 849 } // namespace internal | 849 } // namespace internal |
| 850 } // namespace v8 | 850 } // namespace v8 |
| OLD | NEW |