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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 10536086: Add stack check in loops so that loops can be stopped. Optimize relational operations. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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_ia32.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 8493)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -804,14 +804,12 @@
ValueGraphVisitor for_right_value(owner(), temp_index());
node->right()->Visit(&for_right_value);
Append(for_right_value);
- ZoneGrowableArray<Value*>* arguments = new ZoneGrowableArray<Value*>(2);
- arguments->Add(for_left_value.value());
- arguments->Add(for_right_value.value());
- const String& name = String::ZoneHandle(String::NewSymbol(node->Name()));
- InstanceCallComp* call = new InstanceCallComp(
- node->token_index(), owner()->try_index(), name,
- arguments, Array::ZoneHandle(), 2);
- ReturnComputation(call);
+ RelationalOpComp* comp = new RelationalOpComp(node->token_index(),
+ owner()->try_index(),
+ node->kind(),
+ for_left_value.value(),
+ for_right_value.value());
+ ReturnComputation(comp);
}
@@ -1164,6 +1162,11 @@
TargetEntryInstr* body_entry = new TargetEntryInstr();
for_body.AddInstruction(body_entry);
node->body()->Visit(&for_body);
+ if (for_body.is_open()) {
+ CheckStackOverflowComp* comp =
+ new CheckStackOverflowComp(node->token_index(), owner()->try_index());
+ for_body.AddInstruction(new DoInstr(comp));
+ }
// Join loop body, increment and compute their end instruction.
ASSERT(!for_body.is_empty());
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698