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

Unified Diff: src/compiler/type-hint-analyzer.cc

Issue 2292873002: [turbofan] Treat the INT32 state of a truncating binary op IC as number or oddball on 32-bit machin… (Closed)
Patch Set: Update. Created 4 years, 4 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 | « no previous file | test/mjsunit/compiler/regress-5320.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/type-hint-analyzer.cc
diff --git a/src/compiler/type-hint-analyzer.cc b/src/compiler/type-hint-analyzer.cc
index 235ea1295f8d99e938227213c6fa5aba238b3aca..05b4e153998d1e349c89439449bcab68f8660d29 100644
--- a/src/compiler/type-hint-analyzer.cc
+++ b/src/compiler/type-hint-analyzer.cc
@@ -15,14 +15,17 @@ namespace compiler {
namespace {
-BinaryOperationHint ToBinaryOperationHint(BinaryOpICState::Kind kind) {
+BinaryOperationHint ToBinaryOperationHint(Token::Value op,
+ BinaryOpICState::Kind kind) {
switch (kind) {
case BinaryOpICState::NONE:
return BinaryOperationHint::kNone;
case BinaryOpICState::SMI:
return BinaryOperationHint::kSignedSmall;
case BinaryOpICState::INT32:
- return BinaryOperationHint::kSigned32;
+ return (Token::IsTruncatingBinaryOp(op) && SmiValuesAre31Bits())
+ ? BinaryOperationHint::kNumberOrOddball
+ : BinaryOperationHint::kSigned32;
case BinaryOpICState::NUMBER:
return BinaryOperationHint::kNumberOrOddball;
case BinaryOpICState::STRING:
@@ -66,7 +69,7 @@ bool TypeHintAnalysis::GetBinaryOperationHint(TypeFeedbackId id,
Handle<Code> code = i->second;
DCHECK_EQ(Code::BINARY_OP_IC, code->kind());
BinaryOpICState state(code->GetIsolate(), code->extra_ic_state());
- *hint = ToBinaryOperationHint(state.kind());
+ *hint = ToBinaryOperationHint(state.op(), state.kind());
return true;
}
« no previous file with comments | « no previous file | test/mjsunit/compiler/regress-5320.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698