| 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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 graph()->start())); | 440 graph()->start())); |
| 441 } | 441 } |
| 442 node->ReplaceInput(2, NodeProperties::GetValueInput(node, 1)); | 442 node->ReplaceInput(2, NodeProperties::GetValueInput(node, 1)); |
| 443 node->ReplaceInput(1, jsgraph()->Int32Constant(Context::SlotOffset( | 443 node->ReplaceInput(1, jsgraph()->Int32Constant(Context::SlotOffset( |
| 444 static_cast<int>(access.index())))); | 444 static_cast<int>(access.index())))); |
| 445 node->set_op( | 445 node->set_op( |
| 446 machine()->Store(StoreRepresentation(kMachAnyTagged, kFullWriteBarrier))); | 446 machine()->Store(StoreRepresentation(kMachAnyTagged, kFullWriteBarrier))); |
| 447 } | 447 } |
| 448 | 448 |
| 449 | 449 |
| 450 void JSGenericLowering::LowerJSLoadDynamicGlobal(Node* node) { |
| 451 const DynamicGlobalAccess& access = DynamicGlobalAccessOf(node->op()); |
| 452 Runtime::FunctionId function_id = |
| 453 (access.mode() == CONTEXTUAL) ? Runtime::kLoadLookupSlot |
| 454 : Runtime::kLoadLookupSlotNoReferenceError; |
| 455 Node* projection = graph()->NewNode(common()->Projection(0), node); |
| 456 NodeProperties::ReplaceWithValue(node, projection, node, node); |
| 457 node->InsertInput(zone(), 1, jsgraph()->Constant(access.name())); |
| 458 ReplaceWithRuntimeCall(node, function_id); |
| 459 projection->ReplaceInput(0, node); |
| 460 } |
| 461 |
| 462 |
| 463 void JSGenericLowering::LowerJSLoadDynamicContext(Node* node) { |
| 464 const DynamicContextAccess& access = DynamicContextAccessOf(node->op()); |
| 465 Node* projection = graph()->NewNode(common()->Projection(0), node); |
| 466 NodeProperties::ReplaceWithValue(node, projection, node, node); |
| 467 node->InsertInput(zone(), 1, jsgraph()->Constant(access.name())); |
| 468 ReplaceWithRuntimeCall(node, Runtime::kLoadLookupSlot); |
| 469 projection->ReplaceInput(0, node); |
| 470 } |
| 471 |
| 472 |
| 450 void JSGenericLowering::LowerJSCreateClosure(Node* node) { | 473 void JSGenericLowering::LowerJSCreateClosure(Node* node) { |
| 451 CreateClosureParameters p = CreateClosureParametersOf(node->op()); | 474 CreateClosureParameters p = CreateClosureParametersOf(node->op()); |
| 452 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.shared_info())); | 475 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.shared_info())); |
| 453 node->InsertInput(zone(), 2, jsgraph()->BooleanConstant(p.pretenure())); | 476 node->InsertInput(zone(), 2, jsgraph()->BooleanConstant(p.pretenure())); |
| 454 ReplaceWithRuntimeCall(node, Runtime::kNewClosure); | 477 ReplaceWithRuntimeCall(node, Runtime::kNewClosure); |
| 455 } | 478 } |
| 456 | 479 |
| 457 | 480 |
| 458 void JSGenericLowering::LowerJSCreateLiteralArray(Node* node) { | 481 void JSGenericLowering::LowerJSCreateLiteralArray(Node* node) { |
| 459 int literal_flags = OpParameter<int>(node->op()); | 482 int literal_flags = OpParameter<int>(node->op()); |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 } | 629 } |
| 607 | 630 |
| 608 | 631 |
| 609 MachineOperatorBuilder* JSGenericLowering::machine() const { | 632 MachineOperatorBuilder* JSGenericLowering::machine() const { |
| 610 return jsgraph()->machine(); | 633 return jsgraph()->machine(); |
| 611 } | 634 } |
| 612 | 635 |
| 613 } // namespace compiler | 636 } // namespace compiler |
| 614 } // namespace internal | 637 } // namespace internal |
| 615 } // namespace v8 | 638 } // namespace v8 |
| OLD | NEW |