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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 179003005: VM: Eliminate a redundant store of the context at function entry. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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 33019)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -3460,17 +3460,18 @@
// allocated context but saved on entry and restored on exit as to prevent
// memory leaks.
// In this case, the parser pre-allocates a variable to save the context.
+ Value* parent_context = NULL;
if (MustSaveRestoreContext(node)) {
BuildSaveContext(
*owner()->parsed_function()->saved_entry_context_var());
- Value* null_context = Bind(new ConstantInstr(Object::ZoneHandle()));
- AddInstruction(new StoreContextInstr(null_context));
+ parent_context = Bind(new ConstantInstr(Object::ZoneHandle()));
+ } else {
+ parent_context = Bind(new CurrentContextInstr());
}
- Value* current_context = Bind(new CurrentContextInstr());
Value* tmp_val = Bind(new LoadLocalInstr(*tmp_var));
Do(new StoreVMFieldInstr(tmp_val,
Context::parent_offset(),
- current_context,
+ parent_context,
Type::ZoneHandle()));
AddInstruction(
new StoreContextInstr(Bind(ExitTempLocalScope(tmp_var))));
« 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