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

Unified Diff: runtime/vm/flow_graph.cc

Issue 12529008: Collect type feedback for fields. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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.cc
diff --git a/runtime/vm/flow_graph.cc b/runtime/vm/flow_graph.cc
index fe14079dc1a7890a34bccecb53a4664db5f7f4af..a94bd3730bdd2388a361fdbb557b0ae80e313304 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;
Ivan Posva 2013/03/19 04:42:05 ditto. This would morph into "return result;"
+}
+
} // namespace dart

Powered by Google App Engine
This is Rietveld 408576698