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

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

Issue 103553006: Fix instruction removal for 'as' test; the bug caused us to stop optimizing after an 'as' test. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 12 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 | « no previous file | no next file » | 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/flow_graph_optimizer.h" 5 #include "vm/flow_graph_optimizer.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/cha.h" 8 #include "vm/cha.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/flow_graph_builder.h" 10 #include "vm/flow_graph_builder.h"
(...skipping 3406 matching lines...) Expand 10 before | Expand all | Expand 10 after
3417 if (as_bool.raw() == Bool::True().raw()) { 3417 if (as_bool.raw() == Bool::True().raw()) {
3418 AddReceiverCheck(call); 3418 AddReceiverCheck(call);
3419 // Remove the original push arguments. 3419 // Remove the original push arguments.
3420 for (intptr_t i = 0; i < call->ArgumentCount(); ++i) { 3420 for (intptr_t i = 0; i < call->ArgumentCount(); ++i) {
3421 PushArgumentInstr* push = call->PushArgumentAt(i); 3421 PushArgumentInstr* push = call->PushArgumentAt(i);
3422 push->ReplaceUsesWith(push->value()->definition()); 3422 push->ReplaceUsesWith(push->value()->definition());
3423 push->RemoveFromGraph(); 3423 push->RemoveFromGraph();
3424 } 3424 }
3425 // Remove call, replace it with 'left'. 3425 // Remove call, replace it with 'left'.
3426 call->ReplaceUsesWith(left); 3426 call->ReplaceUsesWith(left);
3427 call->RemoveFromGraph(); 3427 ASSERT(current_iterator()->Current() == call);
3428 current_iterator()->RemoveCurrentFromGraph();
3428 return; 3429 return;
3429 } 3430 }
3430 } 3431 }
3431 const String& dst_name = String::ZoneHandle( 3432 const String& dst_name = String::ZoneHandle(
3432 Symbols::New(Exceptions::kCastErrorDstName)); 3433 Symbols::New(Exceptions::kCastErrorDstName));
3433 AssertAssignableInstr* assert_as = 3434 AssertAssignableInstr* assert_as =
3434 new AssertAssignableInstr(call->token_pos(), 3435 new AssertAssignableInstr(call->token_pos(),
3435 new Value(left), 3436 new Value(left),
3436 new Value(instantiator), 3437 new Value(instantiator),
3437 new Value(type_args), 3438 new Value(type_args),
(...skipping 4845 matching lines...) Expand 10 before | Expand all | Expand 10 after
8283 } 8284 }
8284 8285
8285 // Insert materializations at environment uses. 8286 // Insert materializations at environment uses.
8286 for (intptr_t i = 0; i < exits.length(); i++) { 8287 for (intptr_t i = 0; i < exits.length(); i++) {
8287 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields); 8288 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields);
8288 } 8289 }
8289 } 8290 }
8290 8291
8291 8292
8292 } // namespace dart 8293 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698