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

Side by Side Diff: runtime/vm/flow_graph.cc

Issue 13529021: Fix guarded_cid handling: add field to list of guarded_field at LoadField creation time. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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
« no previous file with comments | « runtime/vm/flow_graph.h ('k') | runtime/vm/flow_graph_inliner.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 for (intptr_t i = 1; i < preorder_.length(); ++i) { 688 for (intptr_t i = 1; i < preorder_.length(); ++i) {
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
699 const 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()) {
720 found = true;
721 break;
722 }
723 }
724
725 if (!found) {
726 result->Add(field);
727 }
728 }
729 }
730
731 return result;
732 }
733
734 } // namespace dart 698 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph.h ('k') | runtime/vm/flow_graph_inliner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698