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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 1020893004: Be less aggressive in sharing contexts between scopes so that sibling contexts (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 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/ast_printer.cc ('k') | runtime/vm/object_test.cc » ('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 44591)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -3785,7 +3785,10 @@
Bind(new(Z) AllocateContextInstr(node->token_pos(),
num_context_variables));
{ LocalVariable* tmp_var = EnterTempLocalScope(allocated_context);
- if (HasContextScope() || !is_top_level_sequence) {
+ if (!is_top_level_sequence || HasContextScope()) {
+ ASSERT(is_top_level_sequence ||
+ (nested_block.ContextLevel() ==
+ nested_block.outer()->ContextLevel() + 1));
Value* tmp_val = Bind(new(Z) LoadLocalInstr(*tmp_var));
Value* parent_context = Bind(BuildCurrentContext());
Do(new(Z) StoreInstanceFieldInstr(Context::parent_offset(),
@@ -3994,7 +3997,7 @@
if (is_open() &&
(num_context_variables > 0) &&
- (HasContextScope() || !is_top_level_sequence)) {
+ (!is_top_level_sequence || HasContextScope())) {
UnchainContexts(1);
}
« no previous file with comments | « runtime/vm/ast_printer.cc ('k') | runtime/vm/object_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698