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

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

Issue 10879041: Validate well-formedness of the use lists in debug mode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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_optimizer.h" 5 #include "vm/flow_graph_optimizer.h"
6 6
7 #include "vm/cha.h" 7 #include "vm/cha.h"
8 #include "vm/flow_graph_builder.h" 8 #include "vm/flow_graph_builder.h"
9 #include "vm/hash_map.h" 9 #include "vm/hash_map.h"
10 #include "vm/il_printer.h" 10 #include "vm/il_printer.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 static bool HasOnlyTwoDouble(const ICData& ic_data) { 147 static bool HasOnlyTwoDouble(const ICData& ic_data) {
148 return (ic_data.NumberOfChecks() == 1) && 148 return (ic_data.NumberOfChecks() == 1) &&
149 ICDataHasReceiverArgumentClassIds(ic_data, kDoubleCid, kDoubleCid); 149 ICDataHasReceiverArgumentClassIds(ic_data, kDoubleCid, kDoubleCid);
150 } 150 }
151 151
152 152
153 static void RemovePushArguments(InstanceCallComp* comp) { 153 static void RemovePushArguments(InstanceCallComp* comp) {
154 // Remove original push arguments. 154 // Remove original push arguments.
155 for (intptr_t i = 0; i < comp->ArgumentCount(); ++i) { 155 for (intptr_t i = 0; i < comp->ArgumentCount(); ++i) {
156 PushArgumentInstr* push = comp->ArgumentAt(i); 156 PushArgumentInstr* push = comp->ArgumentAt(i);
157 push->ReplaceUsesWith(push->value());
157 push->RemoveFromGraph(); 158 push->RemoveFromGraph();
158 } 159 }
159 } 160 }
160 161
161 162
162 // Returns true if all targets are the same. 163 // Returns true if all targets are the same.
163 // TODO(srdjan): if targets are native use their C_function to compare. 164 // TODO(srdjan): if targets are native use their C_function to compare.
164 static bool HasOneTarget(const ICData& ic_data) { 165 static bool HasOneTarget(const ICData& ic_data) {
165 ASSERT(ic_data.NumberOfChecks() > 0); 166 ASSERT(ic_data.NumberOfChecks() > 0);
166 const Function& first_target = Function::Handle(ic_data.GetTargetAt(0)); 167 const Function& first_target = Function::Handle(ic_data.GetTargetAt(0));
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 DirectChainedHashMap<BindInstr*> child_map(*map); // Copy map. 1049 DirectChainedHashMap<BindInstr*> child_map(*map); // Copy map.
1049 OptimizeRecursive(child, &child_map); 1050 OptimizeRecursive(child, &child_map);
1050 } else { 1051 } else {
1051 OptimizeRecursive(child, map); // Reuse map for the last child. 1052 OptimizeRecursive(child, map); // Reuse map for the last child.
1052 } 1053 }
1053 } 1054 }
1054 } 1055 }
1055 1056
1056 1057
1057 } // namespace dart 1058 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698