| 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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 Node* projection = graph()->NewNode(common()->Projection(0), node); | 450 Node* projection = graph()->NewNode(common()->Projection(0), node); |
| 451 NodeProperties::ReplaceUses(node, projection, node, node, node); | 451 NodeProperties::ReplaceUses(node, projection, node, node, node); |
| 452 node->RemoveInput(NodeProperties::FirstValueIndex(node)); | 452 node->RemoveInput(NodeProperties::FirstValueIndex(node)); |
| 453 node->InsertInput(zone(), 1, jsgraph()->Constant(access.name())); | 453 node->InsertInput(zone(), 1, jsgraph()->Constant(access.name())); |
| 454 ReplaceWithRuntimeCall(node, function_id); | 454 ReplaceWithRuntimeCall(node, function_id); |
| 455 projection->ReplaceInput(0, node); | 455 projection->ReplaceInput(0, node); |
| 456 } | 456 } |
| 457 | 457 |
| 458 | 458 |
| 459 void JSGenericLowering::LowerJSCreate(Node* node) { | 459 void JSGenericLowering::LowerJSCreate(Node* node) { |
| 460 // TODO(4544): The duplication of the constructor function is only valid if | |
| 461 // actual constructor and original constructor coincide. Fix this! | |
| 462 node->InsertInput(zone(), 1, node->InputAt(0)); // Duplicate constructor. | |
| 463 ReplaceWithRuntimeCall(node, Runtime::kNewObject); | 460 ReplaceWithRuntimeCall(node, Runtime::kNewObject); |
| 464 } | 461 } |
| 465 | 462 |
| 466 | 463 |
| 467 void JSGenericLowering::LowerJSCreateArguments(Node* node) { | 464 void JSGenericLowering::LowerJSCreateArguments(Node* node) { |
| 468 const CreateArgumentsParameters& p = CreateArgumentsParametersOf(node->op()); | 465 const CreateArgumentsParameters& p = CreateArgumentsParametersOf(node->op()); |
| 469 switch (p.type()) { | 466 switch (p.type()) { |
| 470 case CreateArgumentsParameters::kMappedArguments: | 467 case CreateArgumentsParameters::kMappedArguments: |
| 471 ReplaceWithRuntimeCall(node, Runtime::kNewSloppyArguments_Generic); | 468 ReplaceWithRuntimeCall(node, Runtime::kNewSloppyArguments_Generic); |
| 472 break; | 469 break; |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 } | 855 } |
| 859 | 856 |
| 860 | 857 |
| 861 MachineOperatorBuilder* JSGenericLowering::machine() const { | 858 MachineOperatorBuilder* JSGenericLowering::machine() const { |
| 862 return jsgraph()->machine(); | 859 return jsgraph()->machine(); |
| 863 } | 860 } |
| 864 | 861 |
| 865 } // namespace compiler | 862 } // namespace compiler |
| 866 } // namespace internal | 863 } // namespace internal |
| 867 } // namespace v8 | 864 } // namespace v8 |
| OLD | NEW |