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 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 __ Word32Equal(lhs_instance_type, __ Int32Constant(ODDBALL_TYPE)), | 1031 __ Word32Equal(lhs_instance_type, __ Int32Constant(ODDBALL_TYPE)), |
1032 &lhs_is_not_oddball); | 1032 &lhs_is_not_oddball); |
1033 | 1033 |
1034 var_type_feedback.Bind( | 1034 var_type_feedback.Bind( |
1035 __ Int32Constant(CompareOperationFeedback::kNumberOrOddball)); | 1035 __ Int32Constant(CompareOperationFeedback::kNumberOrOddball)); |
1036 __ Goto(&gather_rhs_type); | 1036 __ Goto(&gather_rhs_type); |
1037 | 1037 |
1038 __ Bind(&lhs_is_not_oddball); | 1038 __ Bind(&lhs_is_not_oddball); |
1039 } | 1039 } |
1040 | 1040 |
1041 var_type_feedback.Bind(__ SelectInt32Constant( | 1041 Label lhs_is_not_string(assembler); |
1042 __ IsStringInstanceType(lhs_instance_type), | 1042 __ GotoUnless(__ IsStringInstanceType(lhs_instance_type), |
1043 CompareOperationFeedback::kString, CompareOperationFeedback::kAny)); | 1043 &lhs_is_not_string); |
| 1044 |
| 1045 if (Token::IsOrderedRelationalCompareOp(compare_op)) { |
| 1046 var_type_feedback.Bind( |
| 1047 __ Int32Constant(CompareOperationFeedback::kString)); |
| 1048 } else { |
| 1049 var_type_feedback.Bind(__ SelectInt32Constant( |
| 1050 __ Word32Equal( |
| 1051 __ Word32And(lhs_instance_type, |
| 1052 __ Int32Constant(kIsNotInternalizedMask)), |
| 1053 __ Int32Constant(kInternalizedTag)), |
| 1054 CompareOperationFeedback::kInternalizedString, |
| 1055 CompareOperationFeedback::kString)); |
| 1056 } |
| 1057 __ Goto(&gather_rhs_type); |
| 1058 |
| 1059 __ Bind(&lhs_is_not_string); |
| 1060 var_type_feedback.Bind( |
| 1061 __ Int32Constant(CompareOperationFeedback::kAny)); |
1044 __ Goto(&gather_rhs_type); | 1062 __ Goto(&gather_rhs_type); |
1045 } | 1063 } |
1046 } | 1064 } |
1047 | 1065 |
1048 __ Bind(&gather_rhs_type); | 1066 __ Bind(&gather_rhs_type); |
1049 { | 1067 { |
1050 Label rhs_is_not_smi(assembler), rhs_is_not_number(assembler); | 1068 Label rhs_is_not_smi(assembler), rhs_is_not_number(assembler); |
1051 | 1069 |
1052 __ GotoUnless(__ TaggedIsSmi(rhs), &rhs_is_not_smi); | 1070 __ GotoUnless(__ TaggedIsSmi(rhs), &rhs_is_not_smi); |
1053 | 1071 |
(...skipping 22 matching lines...) Expand all Loading... |
1076 &rhs_is_not_oddball); | 1094 &rhs_is_not_oddball); |
1077 | 1095 |
1078 var_type_feedback.Bind(__ Word32Or( | 1096 var_type_feedback.Bind(__ Word32Or( |
1079 var_type_feedback.value(), | 1097 var_type_feedback.value(), |
1080 __ Int32Constant(CompareOperationFeedback::kNumberOrOddball))); | 1098 __ Int32Constant(CompareOperationFeedback::kNumberOrOddball))); |
1081 __ Goto(&update_feedback); | 1099 __ Goto(&update_feedback); |
1082 | 1100 |
1083 __ Bind(&rhs_is_not_oddball); | 1101 __ Bind(&rhs_is_not_oddball); |
1084 } | 1102 } |
1085 | 1103 |
1086 var_type_feedback.Bind(__ Word32Or( | 1104 Label rhs_is_not_string(assembler); |
1087 var_type_feedback.value(), | 1105 __ GotoUnless(__ IsStringInstanceType(rhs_instance_type), |
1088 __ SelectInt32Constant(__ IsStringInstanceType(rhs_instance_type), | 1106 &rhs_is_not_string); |
1089 CompareOperationFeedback::kString, | 1107 |
1090 CompareOperationFeedback::kAny))); | 1108 if (Token::IsOrderedRelationalCompareOp(compare_op)) { |
| 1109 var_type_feedback.Bind(__ Word32Or( |
| 1110 var_type_feedback.value(), |
| 1111 __ Int32Constant(CompareOperationFeedback::kString))); |
| 1112 } else { |
| 1113 var_type_feedback.Bind(__ Word32Or( |
| 1114 var_type_feedback.value(), |
| 1115 __ SelectInt32Constant( |
| 1116 __ Word32Equal( |
| 1117 __ Word32And(rhs_instance_type, |
| 1118 __ Int32Constant(kIsNotInternalizedMask)), |
| 1119 __ Int32Constant(kInternalizedTag)), |
| 1120 CompareOperationFeedback::kInternalizedString, |
| 1121 CompareOperationFeedback::kString))); |
| 1122 } |
| 1123 __ Goto(&update_feedback); |
| 1124 |
| 1125 __ Bind(&rhs_is_not_string); |
| 1126 var_type_feedback.Bind( |
| 1127 __ Int32Constant(CompareOperationFeedback::kAny)); |
1091 __ Goto(&update_feedback); | 1128 __ Goto(&update_feedback); |
1092 } | 1129 } |
1093 } | 1130 } |
1094 } | 1131 } |
1095 | 1132 |
1096 __ Bind(&update_feedback); | 1133 __ Bind(&update_feedback); |
1097 { | 1134 { |
1098 __ UpdateFeedback(var_type_feedback.value(), type_feedback_vector, | 1135 __ UpdateFeedback(var_type_feedback.value(), type_feedback_vector, |
1099 slot_index); | 1136 slot_index); |
1100 __ Goto(&do_compare); | 1137 __ Goto(&do_compare); |
(...skipping 2071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3172 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 3209 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
3173 __ SmiTag(new_state)); | 3210 __ SmiTag(new_state)); |
3174 __ SetAccumulator(old_state); | 3211 __ SetAccumulator(old_state); |
3175 | 3212 |
3176 __ Dispatch(); | 3213 __ Dispatch(); |
3177 } | 3214 } |
3178 | 3215 |
3179 } // namespace interpreter | 3216 } // namespace interpreter |
3180 } // namespace internal | 3217 } // namespace internal |
3181 } // namespace v8 | 3218 } // namespace v8 |
OLD | NEW |