| Index: runtime/vm/compiler.cc
|
| ===================================================================
|
| --- runtime/vm/compiler.cc (revision 21001)
|
| +++ runtime/vm/compiler.cc (working copy)
|
| @@ -167,14 +167,16 @@
|
| FlowGraphPrinter::PrintGraph("Before Optimizations", flow_graph);
|
| }
|
|
|
| - const ZoneGrowableArray<Field*>* guarded_fields = NULL;
|
| -
|
| + // Collect all instance fields that are loaded in the graph and
|
| + // have non-generic type feedback attached to them that can
|
| + // potentially affect optimizations.
|
| + GrowableArray<Field*> guarded_fields(10);
|
| if (optimized) {
|
| TimerScope timer(FLAG_compiler_stats,
|
| &CompilerStats::graphoptimizer_timer,
|
| isolate);
|
|
|
| - FlowGraphOptimizer optimizer(flow_graph);
|
| + FlowGraphOptimizer optimizer(flow_graph, &guarded_fields);
|
| optimizer.ApplyICData();
|
| DEBUG_ASSERT(flow_graph->VerifyUseLists());
|
|
|
| @@ -189,14 +191,12 @@
|
| if (FLAG_use_inlining) {
|
| TimerScope timer(FLAG_compiler_stats,
|
| &CompilerStats::graphinliner_timer);
|
| - FlowGraphInliner inliner(flow_graph);
|
| + FlowGraphInliner inliner(flow_graph, &guarded_fields);
|
| inliner.Inline();
|
| // Use lists are maintained and validated by the inliner.
|
| DEBUG_ASSERT(flow_graph->VerifyUseLists());
|
| }
|
|
|
| - guarded_fields = flow_graph->FieldDependencies();
|
| -
|
| // Propagate types and eliminate more type tests.
|
| if (FLAG_propagate_types) {
|
| FlowGraphTypePropagator propagator(flow_graph);
|
| @@ -325,8 +325,8 @@
|
| Code::Handle(function.unoptimized_code()).EntryPoint());
|
| }
|
|
|
| - for (intptr_t i = 0; i < guarded_fields->length(); i++) {
|
| - const Field& field = *(*guarded_fields)[i];
|
| + for (intptr_t i = 0; i < guarded_fields.length(); i++) {
|
| + const Field& field = *guarded_fields[i];
|
| field.RegisterDependentCode(code);
|
| }
|
| } else {
|
|
|