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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 12529008: Collect type feedback for fields. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address Ivan's comments Created 7 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/flow_graph_optimizer.h ('k') | runtime/vm/flow_graph_type_propagator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
index f89f0d287a5f10291ce2f0e0fb4b0d74ee58ae33..508e55269d08272c3838ec91ee90ee1cb660f07f 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -1233,6 +1233,14 @@ void FlowGraphOptimizer::InlineImplicitInstanceGetter(InstanceCallInstr* call) {
field.Offset(),
AbstractType::ZoneHandle(field.type()),
field.is_final());
+ if (field.guarded_cid() != kIllegalCid) {
+ if (!field.is_nullable() || (field.guarded_cid() == kNullCid)) {
+ load->set_result_cid(field.guarded_cid());
+ }
+ load->set_field(&Field::ZoneHandle(field.raw()));
+ }
+ load->set_field_name(String::Handle(field.name()).ToCString());
+
// Discard the environment from the original instruction because the load
// can't deoptimize.
call->RemoveEnvironment();
@@ -2016,6 +2024,17 @@ bool FlowGraphOptimizer::TryInlineInstanceSetter(InstanceCallInstr* instr,
Definition::kEffect);
needs_store_barrier = kNoStoreBarrier;
}
+
+ if (field.guarded_cid() != kDynamicCid) {
+ InsertBefore(instr,
+ new GuardFieldInstr(new Value(instr->ArgumentAt(1)),
+ field,
+ instr->deopt_id()),
+ instr->env(),
+ Definition::kEffect);
+ }
+
+ // Field guard was detached.
StoreInstanceFieldInstr* store = new StoreInstanceFieldInstr(
field,
new Value(instr->ArgumentAt(0)),
@@ -3777,6 +3796,7 @@ void ConstantPropagator::VisitCheckStackOverflow(
void ConstantPropagator::VisitCheckClass(CheckClassInstr* instr) { }
+void ConstantPropagator::VisitGuardField(GuardFieldInstr* instr) { }
void ConstantPropagator::VisitCheckSmi(CheckSmiInstr* instr) { }
« no previous file with comments | « runtime/vm/flow_graph_optimizer.h ('k') | runtime/vm/flow_graph_type_propagator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698