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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 10887009: Refactor branch instructions to enable further optimizations. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | runtime/vm/flow_graph_optimizer.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 11450)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -276,8 +276,9 @@
}
const Bool& bool_true = Bool::ZoneHandle(Bool::True());
Value* constant_true = Bind(Constant(bool_true));
- StrictCompareAndBranchInstr* branch =
- new StrictCompareAndBranchInstr(value, constant_true, Token::kEQ_STRICT);
+ StrictCompareComp* comp =
+ new StrictCompareComp(Token::kEQ_STRICT, value, constant_true);
+ BranchInstr* branch = new BranchInstr(comp);
AddInstruction(branch);
CloseFragment();
true_successor_address_ = branch->true_successor_address();
@@ -289,22 +290,18 @@
ASSERT(!FLAG_enable_type_checks);
ControlInstruction* branch;
if (Token::IsStrictEqualityOperator(comp->kind())) {
- branch = new StrictCompareAndBranchInstr(comp->left(),
- comp->right(),
- comp->kind());
+ branch = new BranchInstr(new StrictCompareComp(comp->kind(),
+ comp->left(),
+ comp->right()));
} else if (Token::IsEqualityOperator(comp->kind()) &&
(comp->left()->BindsToConstantNull() ||
comp->right()->BindsToConstantNull())) {
- branch = new StrictCompareAndBranchInstr(
+ branch = new BranchInstr(new StrictCompareComp(
+ (comp->kind() == Token::kEQ) ? Token::kEQ_STRICT : Token::kNE_STRICT,
comp->left(),
- comp->right(),
- (comp->kind() == Token::kEQ) ? Token::kEQ_STRICT : Token::kNE_STRICT);
+ comp->right()));
} else {
- branch = new BranchInstr(condition_token_pos(),
- owner()->try_index(),
- comp->left(),
- comp->right(),
- comp->kind());
+ branch = new BranchInstr(comp);
}
AddInstruction(branch);
CloseFragment();
@@ -317,10 +314,10 @@
ASSERT(!FLAG_enable_type_checks);
const Bool& bool_true = Bool::ZoneHandle(Bool::True());
Value* constant_true = Bind(Constant(bool_true));
- StrictCompareAndBranchInstr* branch =
- new StrictCompareAndBranchInstr(comp->value(),
- constant_true,
- Token::kNE_STRICT);
+ BranchInstr* branch = new BranchInstr(
+ new StrictCompareComp(Token::kNE_STRICT,
+ comp->value(),
+ constant_true));
AddInstruction(branch);
CloseFragment();
true_successor_address_ = branch->true_successor_address();
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698