Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 current_iterator()->RemoveCurrentFromGraph(); |
|
zra
2013/12/27 21:10:06
Many other uses of RemoveCurrentFromGraph() are pr
srdjan
2013/12/27 21:35:01
Good point, added the assert.
| |
| 3428 return; | 3428 return; |
| 3429 } | 3429 } |
| 3430 } | 3430 } |
| 3431 const String& dst_name = String::ZoneHandle( | 3431 const String& dst_name = String::ZoneHandle( |
| 3432 Symbols::New(Exceptions::kCastErrorDstName)); | 3432 Symbols::New(Exceptions::kCastErrorDstName)); |
| 3433 AssertAssignableInstr* assert_as = | 3433 AssertAssignableInstr* assert_as = |
| 3434 new AssertAssignableInstr(call->token_pos(), | 3434 new AssertAssignableInstr(call->token_pos(), |
| 3435 new Value(left), | 3435 new Value(left), |
| 3436 new Value(instantiator), | 3436 new Value(instantiator), |
| 3437 new Value(type_args), | 3437 new Value(type_args), |
| (...skipping 4845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8283 } | 8283 } |
| 8284 | 8284 |
| 8285 // Insert materializations at environment uses. | 8285 // Insert materializations at environment uses. |
| 8286 for (intptr_t i = 0; i < exits.length(); i++) { | 8286 for (intptr_t i = 0; i < exits.length(); i++) { |
| 8287 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields); | 8287 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields); |
| 8288 } | 8288 } |
| 8289 } | 8289 } |
| 8290 | 8290 |
| 8291 | 8291 |
| 8292 } // namespace dart | 8292 } // namespace dart |
| OLD | NEW |