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

Unified Diff: runtime/vm/parser.cc

Issue 695483003: Remove saving/restoring of the context at function entry. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 2 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/parser.h ('k') | runtime/vm/parser_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 41422)
+++ runtime/vm/parser.cc (working copy)
@@ -193,30 +193,6 @@
&context_owner,
&found_captured_variables);
- // We save the entry context for a function when...
- //
- // - some variable in the function is captured by nested functions, and
- // - the function does not capture any variables from parent functions.
- //
- // We used to link to the parent context in these cases, but this
- // had the effect of unintentionally retaining parent contexts which
- // would never be accessed. By breaking the context chain at this
- // point, we allow these outer contexts to be collected.
- if (found_captured_variables) {
- const ContextScope& context_scope =
- ContextScope::Handle(function().context_scope());
- if (context_scope.IsNull() || (context_scope.num_variables() == 0)) {
- // Allocate a local variable for saving the entry context.
- LocalVariable* context_var =
- new LocalVariable(function().token_pos(),
- Symbols::SavedEntryContextVar(),
- Type::ZoneHandle(Type::DynamicType()));
- context_var->set_index(next_free_frame_index--);
- scope->AddVariable(context_var);
- set_saved_entry_context_var(context_var);
- }
- }
-
// Frame indices are relative to the frame pointer and are decreasing.
ASSERT(next_free_frame_index <= first_stack_local_index_);
num_stack_locals_ = first_stack_local_index_ - next_free_frame_index;
« no previous file with comments | « runtime/vm/parser.h ('k') | runtime/vm/parser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698