| Index: runtime/vm/flow_graph.cc
|
| diff --git a/runtime/vm/flow_graph.cc b/runtime/vm/flow_graph.cc
|
| index fe14079dc1a7890a34bccecb53a4664db5f7f4af..9f8e9a5871e3256d83d0fe187e6e18babb04b53f 100644
|
| --- a/runtime/vm/flow_graph.cc
|
| +++ b/runtime/vm/flow_graph.cc
|
| @@ -696,4 +696,39 @@ intptr_t FlowGraph::InstructionCount() const {
|
| }
|
|
|
|
|
| +const ZoneGrowableArray<Field*>* FlowGraph::FieldDependencies() const {
|
| + ZoneGrowableArray<Field*>* result = new ZoneGrowableArray<Field*>(10);
|
| +
|
| + for (intptr_t i = 1; i < reverse_postorder().length(); i++) {
|
| + BlockEntryInstr* entry = reverse_postorder()[i];
|
| + for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) {
|
| + LoadFieldInstr* load_field = it.Current()->AsLoadField();
|
| + if (load_field == NULL) {
|
| + continue;
|
| + }
|
| +
|
| + Field* field = load_field->field();
|
| + if ((field == NULL) ||
|
| + (field->guarded_cid() == kDynamicCid) ||
|
| + (field->guarded_cid() == kIllegalCid)) {
|
| + continue;
|
| + }
|
| +
|
| + bool found = false;
|
| + for (intptr_t j = 0; j < result->length(); j++) {
|
| + if ((*result)[j]->raw() == field->raw()) {
|
| + found = true;
|
| + break;
|
| + }
|
| + }
|
| +
|
| + if (!found) {
|
| + result->Add(field);
|
| + }
|
| + }
|
| + }
|
| +
|
| + return result;
|
| +}
|
| +
|
| } // namespace dart
|
|
|