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 <deque> | 7 #include <deque> |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "src/compiler/common-operator.h" | 10 #include "src/compiler/common-operator.h" |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 if (lower()) lowering->DoStoreElement(node); | 544 if (lower()) lowering->DoStoreElement(node); |
545 break; | 545 break; |
546 } | 546 } |
547 | 547 |
548 //------------------------------------------------------------------ | 548 //------------------------------------------------------------------ |
549 // Machine-level operators. | 549 // Machine-level operators. |
550 //------------------------------------------------------------------ | 550 //------------------------------------------------------------------ |
551 case IrOpcode::kLoad: { | 551 case IrOpcode::kLoad: { |
552 // TODO(titzer): machine loads/stores need to know BaseTaggedness!? | 552 // TODO(titzer): machine loads/stores need to know BaseTaggedness!? |
553 RepType tBase = rTagged; | 553 RepType tBase = rTagged; |
554 MachineRepresentation rep = OpParameter<MachineRepresentation>(node); | 554 MachineType rep = OpParameter<MachineType>(node); |
555 ProcessInput(node, 0, tBase); // pointer or object | 555 ProcessInput(node, 0, tBase); // pointer or object |
556 ProcessInput(node, 1, kInt32); // index | 556 ProcessInput(node, 1, kInt32); // index |
557 SetOutput(node, changer_->TypeForMachineRepresentation(rep)); | 557 SetOutput(node, changer_->TypeForMachineType(rep)); |
558 break; | 558 break; |
559 } | 559 } |
560 case IrOpcode::kStore: { | 560 case IrOpcode::kStore: { |
561 // TODO(titzer): machine loads/stores need to know BaseTaggedness!? | 561 // TODO(titzer): machine loads/stores need to know BaseTaggedness!? |
562 RepType tBase = rTagged; | 562 RepType tBase = rTagged; |
563 StoreRepresentation rep = OpParameter<StoreRepresentation>(node); | 563 StoreRepresentation rep = OpParameter<StoreRepresentation>(node); |
564 ProcessInput(node, 0, tBase); // pointer or object | 564 ProcessInput(node, 0, tBase); // pointer or object |
565 ProcessInput(node, 1, kInt32); // index | 565 ProcessInput(node, 1, kInt32); // index |
566 ProcessInput(node, 2, changer_->TypeForMachineRepresentation(rep.rep)); | 566 ProcessInput(node, 2, changer_->TypeForMachineType(rep.rep)); |
567 SetOutput(node, 0); | 567 SetOutput(node, 0); |
568 break; | 568 break; |
569 } | 569 } |
570 case IrOpcode::kWord32Shr: | 570 case IrOpcode::kWord32Shr: |
571 // We output unsigned int32 for shift right because JavaScript. | 571 // We output unsigned int32 for shift right because JavaScript. |
572 return VisitBinop(node, rWord32, rWord32 | tUint32); | 572 return VisitBinop(node, rWord32, rWord32 | tUint32); |
573 case IrOpcode::kWord32And: | 573 case IrOpcode::kWord32And: |
574 case IrOpcode::kWord32Or: | 574 case IrOpcode::kWord32Or: |
575 case IrOpcode::kWord32Xor: | 575 case IrOpcode::kWord32Xor: |
576 case IrOpcode::kWord32Shl: | 576 case IrOpcode::kWord32Shl: |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 // merge. | 886 // merge. |
887 Node* merge = graph()->NewNode(common()->Merge(2), tbranch, fbranch); | 887 Node* merge = graph()->NewNode(common()->Merge(2), tbranch, fbranch); |
888 Node* phi = graph()->NewNode(common()->Phi(2), jsgraph()->TrueConstant(), | 888 Node* phi = graph()->NewNode(common()->Phi(2), jsgraph()->TrueConstant(), |
889 jsgraph()->FalseConstant(), merge); | 889 jsgraph()->FalseConstant(), merge); |
890 UpdateControlSuccessors(control, merge); | 890 UpdateControlSuccessors(control, merge); |
891 branch->ReplaceInput(1, control); | 891 branch->ReplaceInput(1, control); |
892 node->ReplaceUses(phi); | 892 node->ReplaceUses(phi); |
893 } | 893 } |
894 | 894 |
895 | 895 |
896 static WriteBarrierKind ComputeWriteBarrierKind( | 896 static WriteBarrierKind ComputeWriteBarrierKind(BaseTaggedness base_is_tagged, |
897 BaseTaggedness base_is_tagged, MachineRepresentation representation, | 897 MachineType representation, |
898 Type* type) { | 898 Type* type) { |
899 // TODO(turbofan): skip write barriers for Smis, etc. | 899 // TODO(turbofan): skip write barriers for Smis, etc. |
900 if (base_is_tagged == kTaggedBase && representation == kMachineTagged) { | 900 if (base_is_tagged == kTaggedBase && representation == kMachineTagged) { |
901 // Write barriers are only for writes into heap objects (i.e. tagged base). | 901 // Write barriers are only for writes into heap objects (i.e. tagged base). |
902 return kFullWriteBarrier; | 902 return kFullWriteBarrier; |
903 } | 903 } |
904 return kNoWriteBarrier; | 904 return kNoWriteBarrier; |
905 } | 905 } |
906 | 906 |
907 | 907 |
908 void SimplifiedLowering::DoLoadField(Node* node) { | 908 void SimplifiedLowering::DoLoadField(Node* node) { |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 break; | 1005 break; |
1006 default: | 1006 default: |
1007 UNREACHABLE(); | 1007 UNREACHABLE(); |
1008 break; | 1008 break; |
1009 } | 1009 } |
1010 } | 1010 } |
1011 | 1011 |
1012 } // namespace compiler | 1012 } // namespace compiler |
1013 } // namespace internal | 1013 } // namespace internal |
1014 } // namespace v8 | 1014 } // namespace v8 |
OLD | NEW |