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/compiler/simplified-lowering.h" | 5 #include "src/compiler/simplified-lowering.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/compiler/common-operator.h" | 9 #include "src/compiler/common-operator.h" |
10 #include "src/compiler/graph-inl.h" | 10 #include "src/compiler/graph-inl.h" |
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 SetOutput(node, 0); | 605 SetOutput(node, 0); |
606 if (lower()) lowering->DoStoreElement(node); | 606 if (lower()) lowering->DoStoreElement(node); |
607 break; | 607 break; |
608 } | 608 } |
609 | 609 |
610 //------------------------------------------------------------------ | 610 //------------------------------------------------------------------ |
611 // Machine-level operators. | 611 // Machine-level operators. |
612 //------------------------------------------------------------------ | 612 //------------------------------------------------------------------ |
613 case IrOpcode::kLoad: { | 613 case IrOpcode::kLoad: { |
614 // TODO(titzer): machine loads/stores need to know BaseTaggedness!? | 614 // TODO(titzer): machine loads/stores need to know BaseTaggedness!? |
615 MachineType tBase = kRepTagged; | 615 MachineTypeUnion tBase = kRepTagged | kMachPtr; |
616 LoadRepresentation rep = OpParameter<LoadRepresentation>(node); | 616 LoadRepresentation rep = OpParameter<LoadRepresentation>(node); |
617 ProcessInput(node, 0, tBase); // pointer or object | 617 ProcessInput(node, 0, tBase); // pointer or object |
618 ProcessInput(node, 1, kMachInt32); // index | 618 ProcessInput(node, 1, kMachInt32); // index |
619 ProcessRemainingInputs(node, 2); | 619 ProcessRemainingInputs(node, 2); |
620 SetOutput(node, rep); | 620 SetOutput(node, rep); |
621 break; | 621 break; |
622 } | 622 } |
623 case IrOpcode::kStore: { | 623 case IrOpcode::kStore: { |
624 // TODO(titzer): machine loads/stores need to know BaseTaggedness!? | 624 // TODO(titzer): machine loads/stores need to know BaseTaggedness!? |
625 MachineType tBase = kRepTagged; | 625 MachineTypeUnion tBase = kRepTagged | kMachPtr; |
626 StoreRepresentation rep = OpParameter<StoreRepresentation>(node); | 626 StoreRepresentation rep = OpParameter<StoreRepresentation>(node); |
627 ProcessInput(node, 0, tBase); // pointer or object | 627 ProcessInput(node, 0, tBase); // pointer or object |
628 ProcessInput(node, 1, kMachInt32); // index | 628 ProcessInput(node, 1, kMachInt32); // index |
629 ProcessInput(node, 2, rep.machine_type()); | 629 ProcessInput(node, 2, rep.machine_type()); |
630 ProcessRemainingInputs(node, 3); | 630 ProcessRemainingInputs(node, 3); |
631 SetOutput(node, 0); | 631 SetOutput(node, 0); |
632 break; | 632 break; |
633 } | 633 } |
634 case IrOpcode::kWord32Shr: | 634 case IrOpcode::kWord32Shr: |
635 // We output unsigned int32 for shift right because JavaScript. | 635 // We output unsigned int32 for shift right because JavaScript. |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 case IrOpcode::kFloat64Mul: | 725 case IrOpcode::kFloat64Mul: |
726 case IrOpcode::kFloat64Div: | 726 case IrOpcode::kFloat64Div: |
727 case IrOpcode::kFloat64Mod: | 727 case IrOpcode::kFloat64Mod: |
728 return VisitFloat64Binop(node); | 728 return VisitFloat64Binop(node); |
729 case IrOpcode::kFloat64Sqrt: | 729 case IrOpcode::kFloat64Sqrt: |
730 return VisitUnop(node, kMachFloat64, kMachFloat64); | 730 return VisitUnop(node, kMachFloat64, kMachFloat64); |
731 case IrOpcode::kFloat64Equal: | 731 case IrOpcode::kFloat64Equal: |
732 case IrOpcode::kFloat64LessThan: | 732 case IrOpcode::kFloat64LessThan: |
733 case IrOpcode::kFloat64LessThanOrEqual: | 733 case IrOpcode::kFloat64LessThanOrEqual: |
734 return VisitFloat64Cmp(node); | 734 return VisitFloat64Cmp(node); |
| 735 case IrOpcode::kLoadStackPointer: |
| 736 return VisitLeaf(node, kMachPtr); |
735 default: | 737 default: |
736 VisitInputs(node); | 738 VisitInputs(node); |
737 break; | 739 break; |
738 } | 740 } |
739 } | 741 } |
740 | 742 |
741 void DeferReplacement(Node* node, Node* replacement) { | 743 void DeferReplacement(Node* node, Node* replacement) { |
742 if (replacement->id() < count_) { | 744 if (replacement->id() < count_) { |
743 // Replace with a previously existing node eagerly. | 745 // Replace with a previously existing node eagerly. |
744 node->ReplaceUses(replacement); | 746 node->ReplaceUses(replacement); |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 void SimplifiedLowering::DoStringLessThanOrEqual(Node* node) { | 969 void SimplifiedLowering::DoStringLessThanOrEqual(Node* node) { |
968 node->set_op(machine()->IntLessThanOrEqual()); | 970 node->set_op(machine()->IntLessThanOrEqual()); |
969 node->ReplaceInput(0, StringComparison(node, true)); | 971 node->ReplaceInput(0, StringComparison(node, true)); |
970 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); | 972 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); |
971 } | 973 } |
972 | 974 |
973 | 975 |
974 } // namespace compiler | 976 } // namespace compiler |
975 } // namespace internal | 977 } // namespace internal |
976 } // namespace v8 | 978 } // namespace v8 |
OLD | NEW |