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/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 2368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2379 push->ReplaceUsesWith(push->value()->definition()); | 2379 push->ReplaceUsesWith(push->value()->definition()); |
2380 push->RemoveFromGraph(); | 2380 push->RemoveFromGraph(); |
2381 } | 2381 } |
2382 // Remove call, replace it with 'left'. | 2382 // Remove call, replace it with 'left'. |
2383 call->ReplaceUsesWith(left); | 2383 call->ReplaceUsesWith(left); |
2384 ASSERT(current_iterator()->Current() == call); | 2384 ASSERT(current_iterator()->Current() == call); |
2385 current_iterator()->RemoveCurrentFromGraph(); | 2385 current_iterator()->RemoveCurrentFromGraph(); |
2386 return; | 2386 return; |
2387 } | 2387 } |
2388 } | 2388 } |
2389 const String& dst_name = String::ZoneHandle(Z, | |
2390 Symbols::New(Exceptions::kCastErrorDstName)); | |
2391 AssertAssignableInstr* assert_as = | 2389 AssertAssignableInstr* assert_as = |
2392 new(Z) AssertAssignableInstr(call->token_pos(), | 2390 new(Z) AssertAssignableInstr(call->token_pos(), |
2393 new(Z) Value(left), | 2391 new(Z) Value(left), |
2394 new(Z) Value(type_args), | 2392 new(Z) Value(type_args), |
2395 type, | 2393 type, |
2396 dst_name, | 2394 Symbols::InTypeCast(), |
2397 call->deopt_id()); | 2395 call->deopt_id()); |
2398 ReplaceCall(call, assert_as); | 2396 ReplaceCall(call, assert_as); |
2399 } | 2397 } |
2400 | 2398 |
2401 | 2399 |
2402 bool AotOptimizer::IsBlackListedForInlining(intptr_t call_deopt_id) { | 2400 bool AotOptimizer::IsBlackListedForInlining(intptr_t call_deopt_id) { |
2403 for (intptr_t i = 0; i < inlining_black_list_->length(); ++i) { | 2401 for (intptr_t i = 0; i < inlining_black_list_->length(); ++i) { |
2404 if ((*inlining_black_list_)[i] == call_deopt_id) return true; | 2402 if ((*inlining_black_list_)[i] == call_deopt_id) return true; |
2405 } | 2403 } |
2406 return false; | 2404 return false; |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2793 | 2791 |
2794 // Discard the environment from the original instruction because the store | 2792 // Discard the environment from the original instruction because the store |
2795 // can't deoptimize. | 2793 // can't deoptimize. |
2796 instr->RemoveEnvironment(); | 2794 instr->RemoveEnvironment(); |
2797 ReplaceCall(instr, store); | 2795 ReplaceCall(instr, store); |
2798 return true; | 2796 return true; |
2799 } | 2797 } |
2800 | 2798 |
2801 | 2799 |
2802 } // namespace dart | 2800 } // namespace dart |
OLD | NEW |