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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/code-stubs.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/interpreter-assembler.cc
diff --git a/src/interpreter/interpreter-assembler.cc b/src/interpreter/interpreter-assembler.cc
index 5767ffa8a5a423de9d09a85ce9bb0eb7f99fb2c3..5bbd96699bbcf68cfe254315b6f82dfc4e5c2de0 100644
--- a/src/interpreter/interpreter-assembler.cc
+++ b/src/interpreter/interpreter-assembler.cc
@@ -1178,7 +1178,8 @@ Node* InterpreterAssembler::TruncateTaggedToWord32WithFeedback(
// Check if {value} is a HeapNumber.
Label if_valueisheapnumber(this),
if_valueisnotheapnumber(this, Label::kDeferred);
- Branch(WordEqual(LoadMap(value), HeapNumberMapConstant()),
+ Node* value_map = LoadMap(value);
+ Branch(WordEqual(value_map, HeapNumberMapConstant()),
&if_valueisheapnumber, &if_valueisnotheapnumber);
Bind(&if_valueisheapnumber);
@@ -1193,11 +1194,35 @@ Node* InterpreterAssembler::TruncateTaggedToWord32WithFeedback(
Bind(&if_valueisnotheapnumber);
{
- // Convert the {value} to a Number first.
- Callable callable = CodeFactory::NonNumberToNumber(isolate());
- var_value.Bind(CallStub(callable, context, value));
- var_type_feedback->Bind(Int32Constant(BinaryOperationFeedback::kAny));
- Goto(&loop);
+ // We do not require an Or with earlier feedback here because once we
+ // convert the value to a number, we cannot reach this path. We can
+ // only reach this path on the first pass when the feedback is kNone.
+ Assert(Word32Equal(var_type_feedback->value(),
+ Int32Constant(BinaryOperationFeedback::kNone)));
+
+ Label if_valueisoddball(this),
+ if_valueisnotoddball(this, Label::kDeferred);
+ Node* is_oddball = Word32Equal(LoadMapInstanceType(value_map),
+ Int32Constant(ODDBALL_TYPE));
+ Branch(is_oddball, &if_valueisoddball, &if_valueisnotoddball);
+
+ Bind(&if_valueisoddball);
+ {
+ // Convert Oddball to a Number and perform checks again.
+ var_value.Bind(LoadObjectField(value, Oddball::kToNumberOffset));
+ var_type_feedback->Bind(
+ Int32Constant(BinaryOperationFeedback::kNumberOrOddball));
+ Goto(&loop);
+ }
+
+ Bind(&if_valueisnotoddball);
+ {
+ // Convert the {value} to a Number first.
+ Callable callable = CodeFactory::NonNumberToNumber(isolate());
+ var_value.Bind(CallStub(callable, context, value));
+ var_type_feedback->Bind(Int32Constant(BinaryOperationFeedback::kAny));
+ Goto(&loop);
+ }
}
}
}
« 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