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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 11232063: Enable merging of comparisons into branches in checked mode. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | « no previous file | runtime/vm/flow_graph_optimizer.cc » ('j') | runtime/vm/intermediate_language.h » ('J')
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 13969)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -366,7 +366,6 @@
void TestGraphVisitor::MergeBranchWithComparison(ComparisonInstr* comp) {
- ASSERT(!FLAG_enable_type_checks);
ControlInstruction* branch;
if (Token::IsStrictEqualityOperator(comp->kind())) {
branch = new BranchInstr(new StrictCompareInstr(comp->kind(),
@@ -380,7 +379,7 @@
comp->left(),
comp->right()));
} else {
- branch = new BranchInstr(comp);
+ branch = new BranchInstr(comp, FLAG_enable_type_checks);
}
AddInstruction(branch);
CloseFragment();
@@ -403,12 +402,12 @@
void TestGraphVisitor::ReturnDefinition(Definition* definition) {
+ ComparisonInstr* comp = definition->AsComparison();
+ if (comp != NULL) {
+ MergeBranchWithComparison(comp);
+ return;
+ }
if (!FLAG_enable_type_checks) {
- ComparisonInstr* comp = definition->AsComparison();
- if (comp != NULL) {
- MergeBranchWithComparison(comp);
- return;
- }
BooleanNegateInstr* neg = definition->AsBooleanNegate();
if (neg != NULL) {
MergeBranchWithNegate(neg);
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.cc » ('j') | runtime/vm/intermediate_language.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698