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/interpreter/interpreter.h" | 5 #include "src/interpreter/interpreter.h" |
6 | 6 |
7 #include <fstream> | 7 #include <fstream> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
(...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 __ GotoUnless(__ WordEqual(lhs_map, __ HeapNumberMapConstant()), | 1050 __ GotoUnless(__ WordEqual(lhs_map, __ HeapNumberMapConstant()), |
1051 &lhs_is_not_number); | 1051 &lhs_is_not_number); |
1052 | 1052 |
1053 var_type_feedback.Bind( | 1053 var_type_feedback.Bind( |
1054 __ Int32Constant(CompareOperationFeedback::kNumber)); | 1054 __ Int32Constant(CompareOperationFeedback::kNumber)); |
1055 __ Goto(&gather_rhs_type); | 1055 __ Goto(&gather_rhs_type); |
1056 | 1056 |
1057 __ Bind(&lhs_is_not_number); | 1057 __ Bind(&lhs_is_not_number); |
1058 { | 1058 { |
1059 Node* lhs_instance_type = __ LoadInstanceType(lhs); | 1059 Node* lhs_instance_type = __ LoadInstanceType(lhs); |
1060 Node* lhs_type = | 1060 if (Token::IsOrderedRelationalCompareOp(compare_op)) { |
| 1061 Label lhs_is_not_oddball(assembler); |
| 1062 __ GotoUnless( |
| 1063 __ Word32Equal(lhs_instance_type, __ Int32Constant(ODDBALL_TYPE)), |
| 1064 &lhs_is_not_oddball); |
| 1065 |
| 1066 var_type_feedback.Bind( |
| 1067 __ Int32Constant(CompareOperationFeedback::kNumberOrOddball)); |
| 1068 __ Goto(&gather_rhs_type); |
| 1069 |
| 1070 __ Bind(&lhs_is_not_oddball); |
| 1071 } |
| 1072 |
| 1073 var_type_feedback.Bind( |
1061 __ Select(__ IsStringInstanceType(lhs_instance_type), | 1074 __ Select(__ IsStringInstanceType(lhs_instance_type), |
1062 __ Int32Constant(CompareOperationFeedback::kString), | 1075 __ Int32Constant(CompareOperationFeedback::kString), |
1063 __ Int32Constant(CompareOperationFeedback::kAny)); | 1076 __ Int32Constant(CompareOperationFeedback::kAny))); |
1064 | |
1065 var_type_feedback.Bind(lhs_type); | |
1066 __ Goto(&gather_rhs_type); | 1077 __ Goto(&gather_rhs_type); |
1067 } | 1078 } |
1068 } | 1079 } |
1069 | 1080 |
1070 __ Bind(&gather_rhs_type); | 1081 __ Bind(&gather_rhs_type); |
1071 { | 1082 { |
1072 Label rhs_is_not_smi(assembler), rhs_is_not_number(assembler); | 1083 Label rhs_is_not_smi(assembler), rhs_is_not_number(assembler); |
1073 | 1084 |
1074 __ GotoUnless(__ TaggedIsSmi(rhs), &rhs_is_not_smi); | 1085 __ GotoUnless(__ TaggedIsSmi(rhs), &rhs_is_not_smi); |
1075 | 1086 |
1076 var_type_feedback.Bind(__ Word32Or( | 1087 var_type_feedback.Bind(__ Word32Or( |
1077 var_type_feedback.value(), | 1088 var_type_feedback.value(), |
1078 __ Int32Constant(CompareOperationFeedback::kSignedSmall))); | 1089 __ Int32Constant(CompareOperationFeedback::kSignedSmall))); |
1079 __ Goto(&update_feedback); | 1090 __ Goto(&update_feedback); |
1080 | 1091 |
1081 __ Bind(&rhs_is_not_smi); | 1092 __ Bind(&rhs_is_not_smi); |
1082 { | 1093 { |
1083 Node* rhs_map = __ LoadMap(rhs); | 1094 Node* rhs_map = __ LoadMap(rhs); |
1084 __ GotoUnless(__ WordEqual(rhs_map, __ HeapNumberMapConstant()), | 1095 __ GotoUnless(__ WordEqual(rhs_map, __ HeapNumberMapConstant()), |
1085 &rhs_is_not_number); | 1096 &rhs_is_not_number); |
1086 | 1097 |
1087 var_type_feedback.Bind( | 1098 var_type_feedback.Bind( |
1088 __ Word32Or(var_type_feedback.value(), | 1099 __ Word32Or(var_type_feedback.value(), |
1089 __ Int32Constant(CompareOperationFeedback::kNumber))); | 1100 __ Int32Constant(CompareOperationFeedback::kNumber))); |
1090 __ Goto(&update_feedback); | 1101 __ Goto(&update_feedback); |
1091 | 1102 |
1092 __ Bind(&rhs_is_not_number); | 1103 __ Bind(&rhs_is_not_number); |
1093 { | 1104 { |
1094 Node* rhs_instance_type = __ LoadInstanceType(rhs); | 1105 Node* rhs_instance_type = __ LoadInstanceType(rhs); |
1095 Node* rhs_type = | 1106 if (Token::IsOrderedRelationalCompareOp(compare_op)) { |
| 1107 Label rhs_is_not_oddball(assembler); |
| 1108 __ GotoUnless(__ Word32Equal(rhs_instance_type, |
| 1109 __ Int32Constant(ODDBALL_TYPE)), |
| 1110 &rhs_is_not_oddball); |
| 1111 |
| 1112 var_type_feedback.Bind(__ Word32Or( |
| 1113 var_type_feedback.value(), |
| 1114 __ Int32Constant(CompareOperationFeedback::kNumberOrOddball))); |
| 1115 __ Goto(&update_feedback); |
| 1116 |
| 1117 __ Bind(&rhs_is_not_oddball); |
| 1118 } |
| 1119 |
| 1120 var_type_feedback.Bind(__ Word32Or( |
| 1121 var_type_feedback.value(), |
1096 __ Select(__ IsStringInstanceType(rhs_instance_type), | 1122 __ Select(__ IsStringInstanceType(rhs_instance_type), |
1097 __ Int32Constant(CompareOperationFeedback::kString), | 1123 __ Int32Constant(CompareOperationFeedback::kString), |
1098 __ Int32Constant(CompareOperationFeedback::kAny)); | 1124 __ Int32Constant(CompareOperationFeedback::kAny)))); |
1099 var_type_feedback.Bind( | |
1100 __ Word32Or(var_type_feedback.value(), rhs_type)); | |
1101 __ Goto(&update_feedback); | 1125 __ Goto(&update_feedback); |
1102 } | 1126 } |
1103 } | 1127 } |
1104 } | 1128 } |
1105 | 1129 |
1106 __ Bind(&update_feedback); | 1130 __ Bind(&update_feedback); |
1107 { | 1131 { |
1108 __ UpdateFeedback(var_type_feedback.value(), type_feedback_vector, | 1132 __ UpdateFeedback(var_type_feedback.value(), type_feedback_vector, |
1109 slot_index); | 1133 slot_index); |
1110 __ Goto(&do_compare); | 1134 __ Goto(&do_compare); |
(...skipping 1655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2766 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 2790 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
2767 __ SmiTag(new_state)); | 2791 __ SmiTag(new_state)); |
2768 __ SetAccumulator(old_state); | 2792 __ SetAccumulator(old_state); |
2769 | 2793 |
2770 __ Dispatch(); | 2794 __ Dispatch(); |
2771 } | 2795 } |
2772 | 2796 |
2773 } // namespace interpreter | 2797 } // namespace interpreter |
2774 } // namespace internal | 2798 } // namespace internal |
2775 } // namespace v8 | 2799 } // namespace v8 |
OLD | NEW |