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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 78733002: Generalize if-conversion to arbitrary smi comparisons. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph_compiler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 30464)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -433,7 +433,8 @@
new BranchInstr(new StrictCompareInstr(call_block->start_pos(),
Token::kEQ_STRICT,
new Value(true_const),
- new Value(true_const)));
+ new Value(true_const),
+ false)); // No number check.
branch->InheritDeoptTarget(call_);
*branch->true_successor_address() = callee_entry;
*branch->false_successor_address() = false_block;
@@ -833,8 +834,8 @@
new StrictCompareInstr(condition_token_pos(),
Token::kEQ_STRICT,
value,
- constant_true);
- comp->set_needs_number_check(false);
+ constant_true,
+ false); // No number check.
BranchInstr* branch = new BranchInstr(comp);
AddInstruction(branch);
CloseFragment();
@@ -856,7 +857,8 @@
comp->token_pos(),
(comp->kind() == Token::kEQ) ? Token::kEQ_STRICT : Token::kNE_STRICT,
comp->left(),
- comp->right()));
+ comp->right(),
+ false)); // No number check.
} else {
branch = new BranchInstr(comp, FLAG_enable_type_checks);
}
@@ -874,8 +876,8 @@
new StrictCompareInstr(condition_token_pos(),
Token::kNE_STRICT,
neg->value(),
- constant_true);
- comp->set_needs_number_check(false);
+ constant_true,
+ false); // No number check.
BranchInstr* branch = new BranchInstr(comp);
AddInstruction(branch);
CloseFragment();
@@ -1201,7 +1203,8 @@
for_right.Bind(new StrictCompareInstr(node->token_pos(),
Token::kEQ_STRICT,
right_value,
- constant_true));
+ constant_true,
+ false)); // No number check.
for_right.Do(BuildStoreExprTemp(compare));
if (node->kind() == Token::kAND) {
@@ -1536,7 +1539,8 @@
StrictCompareInstr* comp = new StrictCompareInstr(token_pos,
kind,
for_left_value.value(),
- for_right_value.value());
+ for_right_value.value(),
+ true); // Number check.
return comp;
}
@@ -3090,13 +3094,14 @@
node->scope()->LookupVariable(Symbols::Other(),
true); // Test only.
Value* other = Bind(new LoadLocalInstr(*other_var));
+ // Receiver is not a number because numbers override equality.
+ const bool kNoNumberCheck = false;
StrictCompareInstr* compare =
new StrictCompareInstr(node->token_pos(),
Token::kEQ_STRICT,
receiver,
- other);
- // Receiver is not a number because numbers override equality.
- compare->set_needs_number_check(false);
+ other,
+ kNoNumberCheck);
return ReturnDefinition(compare);
}
case MethodRecognizer::kStringBaseLength:
@@ -3124,7 +3129,8 @@
new StrictCompareInstr(node->token_pos(),
Token::kEQ_STRICT,
load_val,
- zero_val);
+ zero_val,
+ false); // No number check.
return ReturnDefinition(compare);
}
case MethodRecognizer::kGrowableArrayLength:
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph_compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698