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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 23757016: Simplify compilation of relational operators. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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_compiler.cc » ('j') | runtime/vm/flow_graph_optimizer.cc » ('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 27045)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -686,7 +686,7 @@
void TestGraphVisitor::MergeBranchWithComparison(ComparisonInstr* comp) {
- ControlInstruction* branch;
+ BranchInstr* branch;
if (Token::IsStrictEqualityOperator(comp->kind())) {
branch = new BranchInstr(new StrictCompareInstr(comp->token_pos(),
comp->kind(),
@@ -1420,17 +1420,31 @@
return;
}
+ ZoneGrowableArray<PushArgumentInstr*>* arguments =
+ new ZoneGrowableArray<PushArgumentInstr*>(2);
+
ValueGraphVisitor for_left_value(owner(), temp_index());
node->left()->Visit(&for_left_value);
Append(for_left_value);
+ PushArgumentInstr* push_left = PushArgument(for_left_value.value());
+ arguments->Add(push_left);
+
ValueGraphVisitor for_right_value(owner(), temp_index());
node->right()->Visit(&for_right_value);
Append(for_right_value);
- RelationalOpInstr* comp = new RelationalOpInstr(node->token_pos(),
- node->kind(),
- for_left_value.value(),
- for_right_value.value(),
- owner()->ic_data_array());
+ PushArgumentInstr* push_right = PushArgument(for_right_value.value());
+ arguments->Add(push_right);
+
+ ASSERT(Token::IsRelationalOperator(node->kind()));
+ InstanceCallInstr* comp =
+ new InstanceCallInstr(node->token_pos(),
+ String::ZoneHandle(
+ Symbols::New(Token::Str(node->kind()))),
Kevin Millikin (Google) 2013/09/03 13:23:55 node->Name() is the same as Token::Str(node->kind(
Florian Schneider 2013/09/03 13:55:06 Done.
+ node->kind(),
+ arguments,
+ Object::null_array(),
+ 2,
+ owner()->ic_data_array());
ReturnDefinition(comp);
}
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler.cc » ('j') | runtime/vm/flow_graph_optimizer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698