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

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: rewritten instruction pattern on ia32 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
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..b5d00f9e22af0630731b8f86d455b9564dd16101 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -1233,6 +1233,12 @@ void FlowGraphOptimizer::InlineImplicitInstanceGetter(InstanceCallInstr* call) {
field.Offset(),
AbstractType::ZoneHandle(field.type()),
field.is_final());
+ if (field.guarded_cid() != kIllegalCid) {
+ load->set_result_cid(field.GuardedCid());
+ 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 +2022,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 +3794,7 @@ void ConstantPropagator::VisitCheckStackOverflow(
void ConstantPropagator::VisitCheckClass(CheckClassInstr* instr) { }
+void ConstantPropagator::VisitGuardField(GuardFieldInstr* instr) { }
void ConstantPropagator::VisitCheckSmi(CheckSmiInstr* instr) { }

Powered by Google App Engine
This is Rietveld 408576698