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 graph()->start())); | 434 graph()->start())); |
435 } | 435 } |
436 node->ReplaceInput(2, NodeProperties::GetValueInput(node, 1)); | 436 node->ReplaceInput(2, NodeProperties::GetValueInput(node, 1)); |
437 node->ReplaceInput(1, jsgraph()->Int32Constant(Context::SlotOffset( | 437 node->ReplaceInput(1, jsgraph()->Int32Constant(Context::SlotOffset( |
438 static_cast<int>(access.index())))); | 438 static_cast<int>(access.index())))); |
439 NodeProperties::ChangeOp(node, machine()->Store(StoreRepresentation( | 439 NodeProperties::ChangeOp(node, machine()->Store(StoreRepresentation( |
440 kMachAnyTagged, kFullWriteBarrier))); | 440 kMachAnyTagged, kFullWriteBarrier))); |
441 } | 441 } |
442 | 442 |
443 | 443 |
444 void JSGenericLowering::LowerJSLoadDynamicGlobal(Node* node) { | 444 void JSGenericLowering::LowerJSLoadDynamic(Node* node) { |
445 const DynamicGlobalAccess& access = DynamicGlobalAccessOf(node->op()); | 445 const DynamicAccess& access = DynamicAccessOf(node->op()); |
446 Runtime::FunctionId function_id = | 446 Runtime::FunctionId function_id = |
447 (access.typeof_mode() == NOT_INSIDE_TYPEOF) | 447 (access.typeof_mode() == NOT_INSIDE_TYPEOF) |
448 ? Runtime::kLoadLookupSlot | 448 ? Runtime::kLoadLookupSlot |
449 : Runtime::kLoadLookupSlotNoReferenceError; | 449 : Runtime::kLoadLookupSlotNoReferenceError; |
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::FirstFrameStateIndex(node) + 1); | |
453 node->RemoveInput(NodeProperties::FirstValueIndex(node)); | 452 node->RemoveInput(NodeProperties::FirstValueIndex(node)); |
454 node->InsertInput(zone(), 1, jsgraph()->Constant(access.name())); | 453 node->InsertInput(zone(), 1, jsgraph()->Constant(access.name())); |
455 ReplaceWithRuntimeCall(node, function_id); | 454 ReplaceWithRuntimeCall(node, function_id); |
456 projection->ReplaceInput(0, node); | 455 projection->ReplaceInput(0, node); |
457 } | 456 } |
458 | 457 |
459 | 458 |
460 void JSGenericLowering::LowerJSLoadDynamicContext(Node* node) { | |
461 const DynamicContextAccess& access = DynamicContextAccessOf(node->op()); | |
462 Node* projection = graph()->NewNode(common()->Projection(0), node); | |
463 NodeProperties::ReplaceUses(node, projection, node, node, node); | |
464 node->InsertInput(zone(), 1, jsgraph()->Constant(access.name())); | |
465 ReplaceWithRuntimeCall(node, Runtime::kLoadLookupSlot); | |
466 projection->ReplaceInput(0, node); | |
467 } | |
468 | |
469 | |
470 void JSGenericLowering::LowerJSCreate(Node* node) { UNIMPLEMENTED(); } | 459 void JSGenericLowering::LowerJSCreate(Node* node) { UNIMPLEMENTED(); } |
471 | 460 |
472 | 461 |
473 void JSGenericLowering::LowerJSCreateArguments(Node* node) { | 462 void JSGenericLowering::LowerJSCreateArguments(Node* node) { |
474 const CreateArgumentsParameters& p = CreateArgumentsParametersOf(node->op()); | 463 const CreateArgumentsParameters& p = CreateArgumentsParametersOf(node->op()); |
475 switch (p.type()) { | 464 switch (p.type()) { |
476 case CreateArgumentsParameters::kMappedArguments: | 465 case CreateArgumentsParameters::kMappedArguments: |
477 ReplaceWithRuntimeCall(node, Runtime::kNewSloppyArguments_Generic); | 466 ReplaceWithRuntimeCall(node, Runtime::kNewSloppyArguments_Generic); |
478 break; | 467 break; |
479 case CreateArgumentsParameters::kUnmappedArguments: | 468 case CreateArgumentsParameters::kUnmappedArguments: |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 } | 829 } |
841 | 830 |
842 | 831 |
843 MachineOperatorBuilder* JSGenericLowering::machine() const { | 832 MachineOperatorBuilder* JSGenericLowering::machine() const { |
844 return jsgraph()->machine(); | 833 return jsgraph()->machine(); |
845 } | 834 } |
846 | 835 |
847 } // namespace compiler | 836 } // namespace compiler |
848 } // namespace internal | 837 } // namespace internal |
849 } // namespace v8 | 838 } // namespace v8 |
OLD | NEW |