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

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: ensure that not-null constraints are recomputed correctly 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..492a26d39b66cc674122f36c2423a8e35a019ae6 100644
--- a/runtime/vm/flow_graph.cc
+++ b/runtime/vm/flow_graph.cc
@@ -696,4 +696,39 @@ intptr_t FlowGraph::InstructionCount() 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()) {
srdjan 2013/03/18 18:54:35 do "continue" here and remove 'found' ?
Vyacheslav Egorov (Google) 2013/03/18 19:41:18 C++ does not have continue with a label, so I can'
+ found = true;
+ break;
+ }
+ }
+
+ if (!found) {
+ result->Add(field);
+ }
+ }
+ }
+
+ return result;
+}
+
} // namespace dart

Powered by Google App Engine
This is Rietveld 408576698