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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/flow_graph.h" 5 #include "vm/flow_graph.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/flow_graph_builder.h" 8 #include "vm/flow_graph_builder.h"
9 #include "vm/intermediate_language.h" 9 #include "vm/intermediate_language.h"
10 #include "vm/longjump.h" 10 #include "vm/longjump.h"
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 for (ForwardInstructionIterator it(preorder_[i]); 689 for (ForwardInstructionIterator it(preorder_[i]);
690 !it.Done(); 690 !it.Done();
691 it.Advance()) { 691 it.Advance()) {
692 ++size; 692 ++size;
693 } 693 }
694 } 694 }
695 return size; 695 return size;
696 } 696 }
697 697
698 698
699 ZoneGrowableArray<Field*>* FlowGraph::FieldDependencies() const {
700 ZoneGrowableArray<Field*>* result = new ZoneGrowableArray<Field*>(10);
701
702 for (intptr_t i = 1; i < reverse_postorder().length(); i++) {
703 BlockEntryInstr* entry = reverse_postorder()[i];
704 for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) {
705 LoadFieldInstr* load_field = it.Current()->AsLoadField();
706 if (load_field == NULL) {
707 continue;
708 }
709
710 Field* field = load_field->field();
711 if ((field == NULL) ||
712 (field->guarded_cid() == kDynamicCid) ||
713 (field->guarded_cid() == kIllegalCid)) {
714 continue;
715 }
716
717 bool found = false;
718 for (intptr_t j = 0; j < result->length(); j++) {
719 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'
720 found = true;
721 break;
722 }
723 }
724
725 if (!found) {
726 result->Add(field);
727 }
728 }
729 }
730
731 return result;
732 }
733
699 } // namespace dart 734 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698