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

Unified Diff: runtime/vm/scopes.cc

Issue 266783002: Save the entry context for a function that has captured loop variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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/scopes.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scopes.cc
diff --git a/runtime/vm/scopes.cc b/runtime/vm/scopes.cc
index 38e83b17463f45bdaa4c6538b15de9ddd81fb397..b6a6064610e9916432866609e9bffc221ce112cc 100644
--- a/runtime/vm/scopes.cc
+++ b/runtime/vm/scopes.cc
@@ -152,7 +152,8 @@ int LocalScope::AllocateVariables(int first_parameter_index,
int num_parameters,
int first_frame_index,
LocalScope* loop_owner,
- LocalScope** context_owner) {
+ LocalScope** context_owner,
+ bool* found_captured_variables) {
// We should not allocate variables of nested functions while compiling an
// enclosing function.
ASSERT(function_level() == 0);
@@ -177,6 +178,7 @@ int LocalScope::AllocateVariables(int first_parameter_index,
// context allocation index.
frame_index--;
loop_owner->AllocateContextVariable(parameter, context_owner);
+ *found_captured_variables = true;
} else {
parameter->set_index(frame_index--);
}
@@ -190,6 +192,7 @@ int LocalScope::AllocateVariables(int first_parameter_index,
if (variable->owner() == this) {
if (variable->is_captured()) {
loop_owner->AllocateContextVariable(variable, context_owner);
+ *found_captured_variables = true;
} else {
variable->set_index(frame_index--);
}
@@ -206,7 +209,8 @@ int LocalScope::AllocateVariables(int first_parameter_index,
num_parameters_in_child,
frame_index,
loop_owner,
- &child_context_owner);
+ &child_context_owner,
+ found_captured_variables);
if (child_frame_index < min_frame_index) {
min_frame_index = child_frame_index;
}
« no previous file with comments | « runtime/vm/scopes.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698