| 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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 ? DISABLE_ALLOCATION_SITES | 434 ? DISABLE_ALLOCATION_SITES |
| 435 : DONT_OVERRIDE; | 435 : DONT_OVERRIDE; |
| 436 if (arity == 0) { | 436 if (arity == 0) { |
| 437 ArrayNoArgumentConstructorStub stub(isolate(), elements_kind, | 437 ArrayNoArgumentConstructorStub stub(isolate(), elements_kind, |
| 438 override_mode); | 438 override_mode); |
| 439 CallDescriptor* desc = Linkage::GetStubCallDescriptor( | 439 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
| 440 isolate(), graph()->zone(), stub.GetCallInterfaceDescriptor(), 1, | 440 isolate(), graph()->zone(), stub.GetCallInterfaceDescriptor(), 1, |
| 441 CallDescriptor::kNeedsFrameState); | 441 CallDescriptor::kNeedsFrameState); |
| 442 node->ReplaceInput(0, jsgraph()->HeapConstant(stub.GetCode())); | 442 node->ReplaceInput(0, jsgraph()->HeapConstant(stub.GetCode())); |
| 443 node->InsertInput(graph()->zone(), 2, jsgraph()->HeapConstant(site)); | 443 node->InsertInput(graph()->zone(), 2, jsgraph()->HeapConstant(site)); |
| 444 node->InsertInput(graph()->zone(), 3, jsgraph()->UndefinedConstant()); | 444 node->InsertInput(graph()->zone(), 3, jsgraph()->Int32Constant(0)); |
| 445 node->InsertInput(graph()->zone(), 4, jsgraph()->UndefinedConstant()); |
| 445 NodeProperties::ChangeOp(node, common()->Call(desc)); | 446 NodeProperties::ChangeOp(node, common()->Call(desc)); |
| 446 } else if (arity == 1) { | 447 } else if (arity == 1) { |
| 447 // TODO(bmeurer): Optimize for the 0 length non-holey case? | 448 // TODO(bmeurer): Optimize for the 0 length non-holey case? |
| 448 ArraySingleArgumentConstructorStub stub( | 449 ArraySingleArgumentConstructorStub stub( |
| 449 isolate(), GetHoleyElementsKind(elements_kind), override_mode); | 450 isolate(), GetHoleyElementsKind(elements_kind), override_mode); |
| 450 CallDescriptor* desc = Linkage::GetStubCallDescriptor( | 451 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
| 451 isolate(), graph()->zone(), stub.GetCallInterfaceDescriptor(), 2, | 452 isolate(), graph()->zone(), stub.GetCallInterfaceDescriptor(), 2, |
| 452 CallDescriptor::kNeedsFrameState); | 453 CallDescriptor::kNeedsFrameState); |
| 453 node->ReplaceInput(0, jsgraph()->HeapConstant(stub.GetCode())); | 454 node->ReplaceInput(0, jsgraph()->HeapConstant(stub.GetCode())); |
| 454 node->InsertInput(graph()->zone(), 2, jsgraph()->HeapConstant(site)); | 455 node->InsertInput(graph()->zone(), 2, jsgraph()->HeapConstant(site)); |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 } | 749 } |
| 749 | 750 |
| 750 | 751 |
| 751 MachineOperatorBuilder* JSGenericLowering::machine() const { | 752 MachineOperatorBuilder* JSGenericLowering::machine() const { |
| 752 return jsgraph()->machine(); | 753 return jsgraph()->machine(); |
| 753 } | 754 } |
| 754 | 755 |
| 755 } // namespace compiler | 756 } // namespace compiler |
| 756 } // namespace internal | 757 } // namespace internal |
| 757 } // namespace v8 | 758 } // namespace v8 |
| OLD | NEW |