Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(858)

Side by Side Diff: src/interpreter/interpreter-assembler.cc

Issue 2407103003: [Interpreter] Collect feedback about Oddballs in Bitwise, Inc, Dec operations. (Closed)
Patch Set: Moved the assert to higher level. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/code-stubs.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-assembler.h" 5 #include "src/interpreter/interpreter-assembler.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <ostream> 8 #include <ostream>
9 9
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after
1171 Word32Or(var_type_feedback->value(), 1171 Word32Or(var_type_feedback->value(),
1172 Int32Constant(BinaryOperationFeedback::kSignedSmall))); 1172 Int32Constant(BinaryOperationFeedback::kSignedSmall)));
1173 Goto(&done_loop); 1173 Goto(&done_loop);
1174 } 1174 }
1175 1175
1176 Bind(&if_valueisnotsmi); 1176 Bind(&if_valueisnotsmi);
1177 { 1177 {
1178 // Check if {value} is a HeapNumber. 1178 // Check if {value} is a HeapNumber.
1179 Label if_valueisheapnumber(this), 1179 Label if_valueisheapnumber(this),
1180 if_valueisnotheapnumber(this, Label::kDeferred); 1180 if_valueisnotheapnumber(this, Label::kDeferred);
1181 Branch(WordEqual(LoadMap(value), HeapNumberMapConstant()), 1181 Node* value_map = LoadMap(value);
1182 Branch(WordEqual(value_map, HeapNumberMapConstant()),
1182 &if_valueisheapnumber, &if_valueisnotheapnumber); 1183 &if_valueisheapnumber, &if_valueisnotheapnumber);
1183 1184
1184 Bind(&if_valueisheapnumber); 1185 Bind(&if_valueisheapnumber);
1185 { 1186 {
1186 // Truncate the floating point value. 1187 // Truncate the floating point value.
1187 var_result.Bind(TruncateHeapNumberValueToWord32(value)); 1188 var_result.Bind(TruncateHeapNumberValueToWord32(value));
1188 var_type_feedback->Bind( 1189 var_type_feedback->Bind(
1189 Word32Or(var_type_feedback->value(), 1190 Word32Or(var_type_feedback->value(),
1190 Int32Constant(BinaryOperationFeedback::kNumber))); 1191 Int32Constant(BinaryOperationFeedback::kNumber)));
1191 Goto(&done_loop); 1192 Goto(&done_loop);
1192 } 1193 }
1193 1194
1194 Bind(&if_valueisnotheapnumber); 1195 Bind(&if_valueisnotheapnumber);
1195 { 1196 {
1196 // Convert the {value} to a Number first. 1197 // We do not require an Or with earlier feedback here because once we
1197 Callable callable = CodeFactory::NonNumberToNumber(isolate()); 1198 // convert the value to a number, we cannot reach this path. We can
1198 var_value.Bind(CallStub(callable, context, value)); 1199 // only reach this path on the first pass when the feedback is kNone.
1199 var_type_feedback->Bind(Int32Constant(BinaryOperationFeedback::kAny)); 1200 Assert(Word32Equal(var_type_feedback->value(),
1200 Goto(&loop); 1201 Int32Constant(BinaryOperationFeedback::kNone)));
1202
1203 Label if_valueisoddball(this),
1204 if_valueisnotoddball(this, Label::kDeferred);
1205 Node* is_oddball = Word32Equal(LoadMapInstanceType(value_map),
1206 Int32Constant(ODDBALL_TYPE));
1207 Branch(is_oddball, &if_valueisoddball, &if_valueisnotoddball);
1208
1209 Bind(&if_valueisoddball);
1210 {
1211 // Convert Oddball to a Number and perform checks again.
1212 var_value.Bind(LoadObjectField(value, Oddball::kToNumberOffset));
1213 var_type_feedback->Bind(
1214 Int32Constant(BinaryOperationFeedback::kNumberOrOddball));
1215 Goto(&loop);
1216 }
1217
1218 Bind(&if_valueisnotoddball);
1219 {
1220 // Convert the {value} to a Number first.
1221 Callable callable = CodeFactory::NonNumberToNumber(isolate());
1222 var_value.Bind(CallStub(callable, context, value));
1223 var_type_feedback->Bind(Int32Constant(BinaryOperationFeedback::kAny));
1224 Goto(&loop);
1225 }
1201 } 1226 }
1202 } 1227 }
1203 } 1228 }
1204 Bind(&done_loop); 1229 Bind(&done_loop);
1205 return var_result.value(); 1230 return var_result.value();
1206 } 1231 }
1207 1232
1208 void InterpreterAssembler::UpdateInterruptBudgetOnReturn() { 1233 void InterpreterAssembler::UpdateInterruptBudgetOnReturn() {
1209 // TODO(rmcilroy): Investigate whether it is worth supporting self 1234 // TODO(rmcilroy): Investigate whether it is worth supporting self
1210 // optimization of primitive functions like FullCodegen. 1235 // optimization of primitive functions like FullCodegen.
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
1371 Goto(&loop); 1396 Goto(&loop);
1372 } 1397 }
1373 Bind(&done_loop); 1398 Bind(&done_loop);
1374 1399
1375 return array; 1400 return array;
1376 } 1401 }
1377 1402
1378 } // namespace interpreter 1403 } // namespace interpreter
1379 } // namespace internal 1404 } // namespace internal
1380 } // namespace v8 1405 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stubs.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698