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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 2160613004: VM: Mark loads from final captured locals immutable. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index a55328f4b1eafdea19435c07acb2da82cf5e5878..0bcf854c0c61c29462883740a43dca33837e05be 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -899,10 +899,13 @@ Definition* EffectGraphVisitor::BuildLoadLocal(const LocalVariable& local,
context, Context::parent_offset(), Type::ZoneHandle(Z, Type::null()),
token_pos));
}
- return new(Z) LoadFieldInstr(context,
- Context::variable_offset(local.index()),
- local.type(),
- token_pos);
+ LoadFieldInstr* load = new(Z) LoadFieldInstr(
+ context,
+ Context::variable_offset(local.index()),
+ local.type(),
+ token_pos);
+ load->set_is_immutable(local.is_final());
+ return load;
} else {
return new(Z) LoadLocalInstr(local, token_pos);
}
« 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