OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/effect-control-linearizer.h" | 5 #include "src/compiler/effect-control-linearizer.h" |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/compiler/access-builder.h" | 8 #include "src/compiler/access-builder.h" |
9 #include "src/compiler/compiler-source-position-table.h" | 9 #include "src/compiler/compiler-source-position-table.h" |
10 #include "src/compiler/js-graph.h" | 10 #include "src/compiler/js-graph.h" |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 break; | 641 break; |
642 case IrOpcode::kCheckBounds: | 642 case IrOpcode::kCheckBounds: |
643 result = LowerCheckBounds(node, frame_state); | 643 result = LowerCheckBounds(node, frame_state); |
644 break; | 644 break; |
645 case IrOpcode::kCheckMaps: | 645 case IrOpcode::kCheckMaps: |
646 result = LowerCheckMaps(node, frame_state); | 646 result = LowerCheckMaps(node, frame_state); |
647 break; | 647 break; |
648 case IrOpcode::kCheckNumber: | 648 case IrOpcode::kCheckNumber: |
649 result = LowerCheckNumber(node, frame_state); | 649 result = LowerCheckNumber(node, frame_state); |
650 break; | 650 break; |
| 651 case IrOpcode::kCheckReceiver: |
| 652 result = LowerCheckReceiver(node, frame_state); |
| 653 break; |
651 case IrOpcode::kCheckString: | 654 case IrOpcode::kCheckString: |
652 result = LowerCheckString(node, frame_state); | 655 result = LowerCheckString(node, frame_state); |
653 break; | 656 break; |
654 case IrOpcode::kCheckInternalizedString: | 657 case IrOpcode::kCheckInternalizedString: |
655 result = LowerCheckInternalizedString(node, frame_state); | 658 result = LowerCheckInternalizedString(node, frame_state); |
656 break; | 659 break; |
657 case IrOpcode::kCheckIf: | 660 case IrOpcode::kCheckIf: |
658 result = LowerCheckIf(node, frame_state); | 661 result = LowerCheckIf(node, frame_state); |
659 break; | 662 break; |
660 case IrOpcode::kCheckedInt32Add: | 663 case IrOpcode::kCheckedInt32Add: |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1147 __ Bind(&if_not_smi); | 1150 __ Bind(&if_not_smi); |
1148 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value); | 1151 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value); |
1149 Node* check1 = __ WordEqual(value_map, __ HeapNumberMapConstant()); | 1152 Node* check1 = __ WordEqual(value_map, __ HeapNumberMapConstant()); |
1150 __ DeoptimizeUnless(DeoptimizeReason::kNotAHeapNumber, check1, frame_state); | 1153 __ DeoptimizeUnless(DeoptimizeReason::kNotAHeapNumber, check1, frame_state); |
1151 __ Goto(&done); | 1154 __ Goto(&done); |
1152 | 1155 |
1153 __ Bind(&done); | 1156 __ Bind(&done); |
1154 return value; | 1157 return value; |
1155 } | 1158 } |
1156 | 1159 |
| 1160 Node* EffectControlLinearizer::LowerCheckReceiver(Node* node, |
| 1161 Node* frame_state) { |
| 1162 Node* value = node->InputAt(0); |
| 1163 |
| 1164 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value); |
| 1165 Node* value_instance_type = |
| 1166 __ LoadField(AccessBuilder::ForMapInstanceType(), value_map); |
| 1167 |
| 1168 STATIC_ASSERT(LAST_TYPE == LAST_JS_RECEIVER_TYPE); |
| 1169 Node* check = __ Uint32LessThanOrEqual( |
| 1170 __ Uint32Constant(FIRST_JS_RECEIVER_TYPE), value_instance_type); |
| 1171 __ DeoptimizeUnless(DeoptimizeReason::kNotAJavaScriptObject, check, |
| 1172 frame_state); |
| 1173 return value; |
| 1174 } |
| 1175 |
1157 Node* EffectControlLinearizer::LowerCheckString(Node* node, Node* frame_state) { | 1176 Node* EffectControlLinearizer::LowerCheckString(Node* node, Node* frame_state) { |
1158 Node* value = node->InputAt(0); | 1177 Node* value = node->InputAt(0); |
1159 | 1178 |
1160 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value); | 1179 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value); |
1161 Node* value_instance_type = | 1180 Node* value_instance_type = |
1162 __ LoadField(AccessBuilder::ForMapInstanceType(), value_map); | 1181 __ LoadField(AccessBuilder::ForMapInstanceType(), value_map); |
1163 | 1182 |
1164 Node* check = __ Uint32LessThan(value_instance_type, | 1183 Node* check = __ Uint32LessThan(value_instance_type, |
1165 __ Uint32Constant(FIRST_NONSTRING_TYPE)); | 1184 __ Uint32Constant(FIRST_NONSTRING_TYPE)); |
1166 __ DeoptimizeUnless(DeoptimizeReason::kWrongInstanceType, check, frame_state); | 1185 __ DeoptimizeUnless(DeoptimizeReason::kWrongInstanceType, check, frame_state); |
(...skipping 1529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2696 return isolate()->factory(); | 2715 return isolate()->factory(); |
2697 } | 2716 } |
2698 | 2717 |
2699 Isolate* EffectControlLinearizer::isolate() const { | 2718 Isolate* EffectControlLinearizer::isolate() const { |
2700 return jsgraph()->isolate(); | 2719 return jsgraph()->isolate(); |
2701 } | 2720 } |
2702 | 2721 |
2703 } // namespace compiler | 2722 } // namespace compiler |
2704 } // namespace internal | 2723 } // namespace internal |
2705 } // namespace v8 | 2724 } // namespace v8 |
OLD | NEW |