| 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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 projection->ReplaceInput(0, node); | 448 projection->ReplaceInput(0, node); |
| 449 } | 449 } |
| 450 | 450 |
| 451 | 451 |
| 452 void JSGenericLowering::LowerJSCreate(Node* node) { | 452 void JSGenericLowering::LowerJSCreate(Node* node) { |
| 453 ReplaceWithRuntimeCall(node, Runtime::kNewObject); | 453 ReplaceWithRuntimeCall(node, Runtime::kNewObject); |
| 454 } | 454 } |
| 455 | 455 |
| 456 | 456 |
| 457 void JSGenericLowering::LowerJSCreateArguments(Node* node) { | 457 void JSGenericLowering::LowerJSCreateArguments(Node* node) { |
| 458 const CreateArgumentsParameters& p = CreateArgumentsParametersOf(node->op()); | 458 CreateArgumentsType const type = CreateArgumentsTypeOf(node->op()); |
| 459 switch (p.type()) { | 459 switch (type) { |
| 460 case CreateArgumentsParameters::kMappedArguments: | 460 case CreateArgumentsType::kMappedArguments: |
| 461 ReplaceWithRuntimeCall(node, Runtime::kNewSloppyArguments_Generic); | 461 ReplaceWithRuntimeCall(node, Runtime::kNewSloppyArguments_Generic); |
| 462 break; | 462 break; |
| 463 case CreateArgumentsParameters::kUnmappedArguments: | 463 case CreateArgumentsType::kUnmappedArguments: |
| 464 ReplaceWithRuntimeCall(node, Runtime::kNewStrictArguments_Generic); | 464 ReplaceWithRuntimeCall(node, Runtime::kNewStrictArguments_Generic); |
| 465 break; | 465 break; |
| 466 case CreateArgumentsParameters::kRestArray: | 466 case CreateArgumentsType::kRestParameter: |
| 467 node->InsertInput(zone(), 1, jsgraph()->Constant(p.start_index())); | 467 ReplaceWithRuntimeCall(node, Runtime::kNewRestParameter); |
| 468 ReplaceWithRuntimeCall(node, Runtime::kNewRestArguments_Generic); | |
| 469 break; | 468 break; |
| 470 } | 469 } |
| 471 } | 470 } |
| 472 | 471 |
| 473 | 472 |
| 474 void JSGenericLowering::LowerJSCreateArray(Node* node) { | 473 void JSGenericLowering::LowerJSCreateArray(Node* node) { |
| 475 CreateArrayParameters const& p = CreateArrayParametersOf(node->op()); | 474 CreateArrayParameters const& p = CreateArrayParametersOf(node->op()); |
| 476 int const arity = static_cast<int>(p.arity()); | 475 int const arity = static_cast<int>(p.arity()); |
| 477 Handle<AllocationSite> const site = p.site(); | 476 Handle<AllocationSite> const site = p.site(); |
| 478 | 477 |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 } | 801 } |
| 803 | 802 |
| 804 | 803 |
| 805 MachineOperatorBuilder* JSGenericLowering::machine() const { | 804 MachineOperatorBuilder* JSGenericLowering::machine() const { |
| 806 return jsgraph()->machine(); | 805 return jsgraph()->machine(); |
| 807 } | 806 } |
| 808 | 807 |
| 809 } // namespace compiler | 808 } // namespace compiler |
| 810 } // namespace internal | 809 } // namespace internal |
| 811 } // namespace v8 | 810 } // namespace v8 |
| OLD | NEW |