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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 9706086: Clean-up CodeGenState: remove unused loop_level and move context_level to CodeGenerator (and add it… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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 | « runtime/vm/flow_graph_builder.h ('k') | 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 5548)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -1261,20 +1261,30 @@
// nodes: <Statement>*
// label: SourceLabel }
void EffectGraphVisitor::VisitSequenceNode(SequenceNode* node) {
+ LocalScope* scope = node->scope();
+ const intptr_t num_context_variables =
+ (scope != NULL) ? scope->num_context_variables() : 0;
+ int previous_context_level = owner()->context_level();
+ if (num_context_variables > 0) {
+ // The loop local scope declares variables that are captured.
+ // Allocate and chain a new context.
+ // Allocate context computation
regis 2012/03/15 23:39:07 period
srdjan 2012/03/15 23:45:41 Done.
+ // Chain Context computation (maybe introduce a new variable).
+ Bailout("Sequence needs a context. Gotta have a context.");
+ }
+
if (FLAG_enable_type_checks &&
(node == owner()->parsed_function().node_sequence())) {
Bailout("VisitSequenceNode GenerateArgumentTypeChecks()");
}
- if ((node->scope() != NULL) &&
- (node->scope()->num_context_variables() != 0)) {
- Bailout("Sequence needs a context. Gotta have a context.");
- }
+
intptr_t i = 0;
while (is_open() && (i < node->length())) {
EffectGraphVisitor for_effect(owner(), temp_index());
node->NodeAt(i++)->Visit(&for_effect);
Append(for_effect);
}
+ owner()->set_context_level(previous_context_level);
}
« no previous file with comments | « runtime/vm/flow_graph_builder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698