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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 10562010: Chek stack overflow in while an do-while node (in order to be able to interrupt loops). (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 | no next file » | 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 8724)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -1073,6 +1073,11 @@
ASSERT(!for_test.is_empty()); // Language spec.
EffectGraphVisitor for_body(owner(), temp_index());
+ if (for_body.is_open()) {
Vyacheslav Egorov (Google) 2012/06/15 18:02:51 if is not required now. it is always open right af
srdjan 2012/06/15 18:05:06 Done.
+ CheckStackOverflowComp* comp =
+ new CheckStackOverflowComp(node->token_index(), owner()->try_index());
+ for_body.AddInstruction(new DoInstr(comp));
+ }
node->body()->Visit(&for_body);
// Labels are set after body traversal.
@@ -1099,6 +1104,11 @@
void EffectGraphVisitor::VisitDoWhileNode(DoWhileNode* node) {
// Traverse body first in order to generate continue and break labels.
EffectGraphVisitor for_body(owner(), temp_index());
+ if (for_body.is_open()) {
Vyacheslav Egorov (Google) 2012/06/15 18:02:51 ditto
srdjan 2012/06/15 18:05:06 Done.
+ CheckStackOverflowComp* comp =
+ new CheckStackOverflowComp(node->token_index(), owner()->try_index());
+ for_body.AddInstruction(new DoInstr(comp));
+ }
node->body()->Visit(&for_body);
TestGraphVisitor for_test(owner(),
@@ -1163,12 +1173,12 @@
EffectGraphVisitor for_body(owner(), temp_index());
TargetEntryInstr* body_entry = new TargetEntryInstr();
for_body.AddInstruction(body_entry);
- node->body()->Visit(&for_body);
if (for_body.is_open()) {
Vyacheslav Egorov (Google) 2012/06/15 18:02:51 ditto
srdjan 2012/06/15 18:05:06 Done.
CheckStackOverflowComp* comp =
new CheckStackOverflowComp(node->token_index(), owner()->try_index());
for_body.AddInstruction(new DoInstr(comp));
}
+ node->body()->Visit(&for_body);
// Join loop body, increment and compute their end instruction.
ASSERT(!for_body.is_empty());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698