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

Unified Diff: runtime/vm/aot_optimizer.cc

Issue 2466643002: AOT: Enable branch merging for checked smi comparisons (Closed)
Patch Set: addressed comments 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/branch_optimizer.cc » ('j') | no next file with comments »
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 c938bc3799a82e1860e3385892e05e7e663c503f..b76cffe3aa746530acb22c53360578e1bcf5c197 100644
--- a/runtime/vm/aot_optimizer.cc
+++ b/runtime/vm/aot_optimizer.cc
@@ -1819,7 +1819,21 @@ void AotOptimizer::VisitInstanceCall(InstanceCallInstr* instr) {
case Token::kLT:
case Token::kLTE:
case Token::kGT:
- case Token::kGTE:
+ case Token::kGTE: {
+ if (HasOnlyTwoOf(*instr->ic_data(), kSmiCid) ||
+ HasLikelySmiOperand(instr)) {
+ Definition* left = instr->ArgumentAt(0);
+ Definition* right = instr->ArgumentAt(1);
+ CheckedSmiComparisonInstr* smi_op =
+ new(Z) CheckedSmiComparisonInstr(instr->token_kind(),
+ new(Z) Value(left),
+ new(Z) Value(right),
+ instr);
+ ReplaceCall(instr, smi_op);
+ return;
+ }
+ break;
+ }
case Token::kBIT_OR:
case Token::kBIT_XOR:
case Token::kBIT_AND:
« no previous file with comments | « no previous file | runtime/vm/branch_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698