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

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

Issue 2498073004: AOT: Fix bug in receiver type propagation after unique selector calls. (Closed)
Patch Set: address comments Created 4 years, 1 month 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
« no previous file with comments | « no previous file | runtime/vm/flow_graph.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/aot_optimizer.h" 5 #include "vm/aot_optimizer.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/branch_optimizer.h" 8 #include "vm/branch_optimizer.h"
9 #include "vm/cha.h" 9 #include "vm/cha.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 target_function.AreValidArgumentCounts(call->ArgumentCount(), 0, 284 target_function.AreValidArgumentCounts(call->ArgumentCount(), 0,
285 /* error_message = */ NULL)) { 285 /* error_message = */ NULL)) {
286 const Class& cls = Class::Handle(Z, target_function.Owner()); 286 const Class& cls = Class::Handle(Z, target_function.Owner());
287 if (!CHA::IsImplemented(cls) && !CHA::HasSubclasses(cls)) { 287 if (!CHA::IsImplemented(cls) && !CHA::HasSubclasses(cls)) {
288 const ICData& ic_data = 288 const ICData& ic_data =
289 ICData::ZoneHandle(Z, ICData::NewFrom(*call->ic_data(), 1)); 289 ICData::ZoneHandle(Z, ICData::NewFrom(*call->ic_data(), 1));
290 ic_data.AddReceiverCheck(cls.id(), target_function); 290 ic_data.AddReceiverCheck(cls.id(), target_function);
291 call->set_ic_data(&ic_data); 291 call->set_ic_data(&ic_data);
292 if (has_unique_no_such_method_) { 292 if (has_unique_no_such_method_) {
293 call->set_has_unique_selector(true); 293 call->set_has_unique_selector(true);
294 // Add redefinition of the receiver to prevent code motion across
295 // this call.
296 RedefinitionInstr* redefinition =
297 new (Z) RedefinitionInstr(new (Z) Value(call->ArgumentAt(0)));
298 redefinition->set_ssa_temp_index(flow_graph_->alloc_ssa_temp_index());
299 redefinition->InsertAfter(call);
300 // Replace all uses of the receiver dominated by this call.
301 FlowGraph::RenameDominatedUses(call->ArgumentAt(0), redefinition,
302 redefinition);
303 if (!redefinition->HasUses()) {
304 redefinition->RemoveFromGraph();
305 }
294 } 306 }
295 return true; 307 return true;
296 } 308 }
297 } 309 }
298 } 310 }
299 311
300 return false; 312 return false;
301 } 313 }
302 314
303 315
(...skipping 1869 matching lines...) Expand 10 before | Expand all | Expand 10 after
2173 FlowGraph::kEffect); 2185 FlowGraph::kEffect);
2174 current_iterator()->RemoveCurrentFromGraph(); 2186 current_iterator()->RemoveCurrentFromGraph();
2175 } 2187 }
2176 } 2188 }
2177 } 2189 }
2178 } 2190 }
2179 2191
2180 #endif // DART_PRECOMPILER 2192 #endif // DART_PRECOMPILER
2181 2193
2182 } // namespace dart 2194 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698