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 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1089 __ Word32Equal( | 1089 __ Word32Equal( |
1090 __ Word32And(lhs_instance_type, | 1090 __ Word32And(lhs_instance_type, |
1091 __ Int32Constant(kIsNotInternalizedMask)), | 1091 __ Int32Constant(kIsNotInternalizedMask)), |
1092 __ Int32Constant(kInternalizedTag)), | 1092 __ Int32Constant(kInternalizedTag)), |
1093 CompareOperationFeedback::kInternalizedString, | 1093 CompareOperationFeedback::kInternalizedString, |
1094 CompareOperationFeedback::kString)); | 1094 CompareOperationFeedback::kString)); |
1095 } | 1095 } |
1096 __ Goto(&gather_rhs_type); | 1096 __ Goto(&gather_rhs_type); |
1097 | 1097 |
1098 __ Bind(&lhs_is_not_string); | 1098 __ Bind(&lhs_is_not_string); |
1099 var_type_feedback.Bind(__ SmiConstant(CompareOperationFeedback::kAny)); | 1099 if (Token::IsEqualityOp(compare_op)) { |
| 1100 var_type_feedback.Bind(__ SelectSmiConstant( |
| 1101 __ IsJSReceiverInstanceType(lhs_instance_type), |
| 1102 CompareOperationFeedback::kReceiver, |
| 1103 CompareOperationFeedback::kAny)); |
| 1104 } else { |
| 1105 var_type_feedback.Bind( |
| 1106 __ SmiConstant(CompareOperationFeedback::kAny)); |
| 1107 } |
1100 __ Goto(&gather_rhs_type); | 1108 __ Goto(&gather_rhs_type); |
1101 } | 1109 } |
1102 } | 1110 } |
1103 | 1111 |
1104 __ Bind(&gather_rhs_type); | 1112 __ Bind(&gather_rhs_type); |
1105 { | 1113 { |
1106 Label rhs_is_not_smi(assembler), rhs_is_not_number(assembler); | 1114 Label rhs_is_not_smi(assembler), rhs_is_not_number(assembler); |
1107 | 1115 |
1108 __ GotoUnless(__ TaggedIsSmi(rhs), &rhs_is_not_smi); | 1116 __ GotoUnless(__ TaggedIsSmi(rhs), &rhs_is_not_smi); |
1109 | 1117 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1154 __ Word32Equal( | 1162 __ Word32Equal( |
1155 __ Word32And(rhs_instance_type, | 1163 __ Word32And(rhs_instance_type, |
1156 __ Int32Constant(kIsNotInternalizedMask)), | 1164 __ Int32Constant(kIsNotInternalizedMask)), |
1157 __ Int32Constant(kInternalizedTag)), | 1165 __ Int32Constant(kInternalizedTag)), |
1158 CompareOperationFeedback::kInternalizedString, | 1166 CompareOperationFeedback::kInternalizedString, |
1159 CompareOperationFeedback::kString))); | 1167 CompareOperationFeedback::kString))); |
1160 } | 1168 } |
1161 __ Goto(&update_feedback); | 1169 __ Goto(&update_feedback); |
1162 | 1170 |
1163 __ Bind(&rhs_is_not_string); | 1171 __ Bind(&rhs_is_not_string); |
1164 var_type_feedback.Bind( | 1172 if (Token::IsEqualityOp(compare_op)) { |
1165 __ SmiConstant(CompareOperationFeedback::kAny)); | 1173 var_type_feedback.Bind( |
| 1174 __ SmiOr(var_type_feedback.value(), |
| 1175 __ SelectSmiConstant( |
| 1176 __ IsJSReceiverInstanceType(rhs_instance_type), |
| 1177 CompareOperationFeedback::kReceiver, |
| 1178 CompareOperationFeedback::kAny))); |
| 1179 } else { |
| 1180 var_type_feedback.Bind( |
| 1181 __ SmiConstant(CompareOperationFeedback::kAny)); |
| 1182 } |
1166 __ Goto(&update_feedback); | 1183 __ Goto(&update_feedback); |
1167 } | 1184 } |
1168 } | 1185 } |
1169 } | 1186 } |
1170 | 1187 |
1171 __ Bind(&update_feedback); | 1188 __ Bind(&update_feedback); |
1172 { | 1189 { |
1173 __ UpdateFeedback(var_type_feedback.value(), type_feedback_vector, | 1190 __ UpdateFeedback(var_type_feedback.value(), type_feedback_vector, |
1174 slot_index); | 1191 slot_index); |
1175 __ Goto(&do_compare); | 1192 __ Goto(&do_compare); |
(...skipping 2083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3259 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 3276 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
3260 __ SmiTag(new_state)); | 3277 __ SmiTag(new_state)); |
3261 __ SetAccumulator(old_state); | 3278 __ SetAccumulator(old_state); |
3262 | 3279 |
3263 __ Dispatch(); | 3280 __ Dispatch(); |
3264 } | 3281 } |
3265 | 3282 |
3266 } // namespace interpreter | 3283 } // namespace interpreter |
3267 } // namespace internal | 3284 } // namespace internal |
3268 } // namespace v8 | 3285 } // namespace v8 |
OLD | NEW |