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

Unified Diff: runtime/vm/aot_optimizer.cc

Issue 2487873003: Speculate on bitwise operators. (Closed)
Patch Set: git cl format Created 4 years, 1 month 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 | runtime/vm/intermediate_language_arm.cc » ('j') | runtime/vm/redundancy_elimination.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/aot_optimizer.cc
diff --git a/runtime/vm/aot_optimizer.cc b/runtime/vm/aot_optimizer.cc
index ea444c0de86088e8ef351217ecbe072f4158100e..168471ceeb93252db7dae73defb027ad0ff5ddd1 100644
--- a/runtime/vm/aot_optimizer.cc
+++ b/runtime/vm/aot_optimizer.cc
@@ -209,11 +209,16 @@ bool AotOptimizer::TryCreateICData(InstanceCallInstr* call) {
}
const Token::Kind op_kind = call->token_kind();
- if (Token::IsRelationalOperator(op_kind) ||
- Token::IsEqualityOperator(op_kind) || Token::IsBinaryOperator(op_kind)) {
- // Guess cid: if one of the inputs is a number assume that the other
- // is a number of same type.
- if (FLAG_guess_icdata_cid) {
+ if (FLAG_guess_icdata_cid) {
+ if (Token::IsBinaryBitwiseOperator(op_kind)) {
+ class_ids[0] = kSmiCid;
+ class_ids[1] = kSmiCid;
+ }
+ if (Token::IsRelationalOperator(op_kind) ||
+ Token::IsEqualityOperator(op_kind) ||
+ Token::IsBinaryOperator(op_kind)) {
+ // Guess cid: if one of the inputs is a number assume that the other
+ // is a number of same type.
const intptr_t cid_0 = class_ids[0];
const intptr_t cid_1 = class_ids[1];
if ((cid_0 == kDynamicCid) && (IsNumberCid(cid_1))) {
@@ -1796,6 +1801,8 @@ void AotOptimizer::VisitInstanceCall(InstanceCallInstr* instr) {
}
break;
}
+ case Token::kSHL:
+ case Token::kSHR:
case Token::kBIT_OR:
case Token::kBIT_XOR:
case Token::kBIT_AND:
« no previous file with comments | « no previous file | runtime/vm/intermediate_language_arm.cc » ('j') | runtime/vm/redundancy_elimination.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698