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/js-graph.h" | 5 #include "src/compiler/js-graph.h" |
6 #include "src/compiler/js-typed-lowering.h" | 6 #include "src/compiler/js-typed-lowering.h" |
7 #include "src/compiler/machine-operator.h" | 7 #include "src/compiler/machine-operator.h" |
8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
9 #include "src/compiler/opcodes.h" | 9 #include "src/compiler/opcodes.h" |
10 #include "src/compiler/operator-properties.h" | 10 #include "src/compiler/operator-properties.h" |
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 // No reduction of mixed types. | 706 // No reduction of mixed types. |
707 CHECK_EQ(r->op(), less_than); | 707 CHECK_EQ(r->op(), less_than); |
708 } | 708 } |
709 } | 709 } |
710 } | 710 } |
711 } | 711 } |
712 } | 712 } |
713 | 713 |
714 | 714 |
715 TEST_WITH_STRONG(RemoveToNumberEffects) { | 715 TEST_WITH_STRONG(RemoveToNumberEffects) { |
716 FLAG_turbo_deoptimization = true; | |
717 | |
718 JSTypedLoweringTester R; | 716 JSTypedLoweringTester R; |
719 | 717 |
720 Node* effect_use = NULL; | 718 Node* effect_use = NULL; |
721 for (int i = 0; i < 10; i++) { | 719 for (int i = 0; i < 10; i++) { |
722 Node* p0 = R.Parameter(Type::Number()); | 720 Node* p0 = R.Parameter(Type::Number()); |
723 Node* ton = R.Unop(R.javascript.ToNumber(), p0); | 721 Node* ton = R.Unop(R.javascript.ToNumber(), p0); |
724 Node* frame_state = R.EmptyFrameState(R.context()); | 722 Node* frame_state = R.EmptyFrameState(R.context()); |
725 effect_use = NULL; | 723 effect_use = NULL; |
726 | 724 |
727 switch (i) { | 725 switch (i) { |
728 case 0: | 726 case 0: |
729 if (FLAG_turbo_deoptimization) { | 727 DCHECK(OperatorProperties::GetFrameStateInputCount( |
730 DCHECK(OperatorProperties::GetFrameStateInputCount( | 728 R.javascript.ToNumber()) == 1); |
731 R.javascript.ToNumber()) == 1); | |
732 effect_use = R.graph.NewNode(R.javascript.ToNumber(), p0, R.context(), | |
733 frame_state, ton, R.start()); | |
734 } else { | |
735 effect_use = R.graph.NewNode(R.javascript.ToNumber(), p0, R.context(), | 729 effect_use = R.graph.NewNode(R.javascript.ToNumber(), p0, R.context(), |
736 ton, R.start()); | 730 frame_state, ton, R.start()); |
737 } | |
738 break; | 731 break; |
739 case 1: | 732 case 1: |
740 if (FLAG_turbo_deoptimization) { | 733 DCHECK(OperatorProperties::GetFrameStateInputCount( |
741 DCHECK(OperatorProperties::GetFrameStateInputCount( | 734 R.javascript.ToNumber()) == 1); |
742 R.javascript.ToNumber()) == 1); | 735 effect_use = R.graph.NewNode(R.javascript.ToNumber(), ton, R.context(), |
743 effect_use = | 736 frame_state, ton, R.start()); |
744 R.graph.NewNode(R.javascript.ToNumber(), ton, R.context(), | |
745 frame_state, ton, R.start()); | |
746 } else { | |
747 effect_use = R.graph.NewNode(R.javascript.ToNumber(), ton, | |
748 R.context(), ton, R.start()); | |
749 } | |
750 break; | 737 break; |
751 case 2: | 738 case 2: |
752 effect_use = R.graph.NewNode(R.common.EffectPhi(1), ton, R.start()); | 739 effect_use = R.graph.NewNode(R.common.EffectPhi(1), ton, R.start()); |
753 case 3: | 740 case 3: |
754 effect_use = R.graph.NewNode(R.javascript.Add(language_mode), ton, ton, | 741 effect_use = R.graph.NewNode(R.javascript.Add(language_mode), ton, ton, |
755 R.context(), frame_state, frame_state, ton, | 742 R.context(), frame_state, frame_state, ton, |
756 R.start()); | 743 R.start()); |
757 break; | 744 break; |
758 case 4: | 745 case 4: |
759 effect_use = R.graph.NewNode(R.javascript.Add(language_mode), p0, p0, | 746 effect_use = R.graph.NewNode(R.javascript.Add(language_mode), p0, p0, |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1275 CHECK_EQ(p1, r->InputAt(0)); | 1262 CHECK_EQ(p1, r->InputAt(0)); |
1276 CHECK_EQ(p0, r->InputAt(1)); | 1263 CHECK_EQ(p0, r->InputAt(1)); |
1277 } else { | 1264 } else { |
1278 CHECK_EQ(p0, r->InputAt(0)); | 1265 CHECK_EQ(p0, r->InputAt(0)); |
1279 CHECK_EQ(p1, r->InputAt(1)); | 1266 CHECK_EQ(p1, r->InputAt(1)); |
1280 } | 1267 } |
1281 } | 1268 } |
1282 } | 1269 } |
1283 } | 1270 } |
1284 } | 1271 } |
OLD | NEW |