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/jit_optimizer.h" | 5 #include "vm/jit_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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 } | 89 } |
90 | 90 |
91 | 91 |
92 bool JitOptimizer::TryCreateICData(InstanceCallInstr* call) { | 92 bool JitOptimizer::TryCreateICData(InstanceCallInstr* call) { |
93 ASSERT(call->HasICData()); | 93 ASSERT(call->HasICData()); |
94 if (call->ic_data()->NumberOfUsedChecks() > 0) { | 94 if (call->ic_data()->NumberOfUsedChecks() > 0) { |
95 // This occurs when an instance call has too many checks, will be converted | 95 // This occurs when an instance call has too many checks, will be converted |
96 // to megamorphic call. | 96 // to megamorphic call. |
97 return false; | 97 return false; |
98 } | 98 } |
| 99 |
99 GrowableArray<intptr_t> class_ids(call->ic_data()->NumArgsTested()); | 100 GrowableArray<intptr_t> class_ids(call->ic_data()->NumArgsTested()); |
100 ASSERT(call->ic_data()->NumArgsTested() <= call->ArgumentCount()); | 101 ASSERT(call->ic_data()->NumArgsTested() <= call->ArgumentCount()); |
101 for (intptr_t i = 0; i < call->ic_data()->NumArgsTested(); i++) { | 102 for (intptr_t i = 0; i < call->ic_data()->NumArgsTested(); i++) { |
102 class_ids.Add(call->PushArgumentAt(i)->value()->Type()->ToCid()); | 103 class_ids.Add(call->PushArgumentAt(i)->value()->Type()->ToCid()); |
103 } | 104 } |
104 | 105 |
105 const Token::Kind op_kind = call->token_kind(); | 106 const Token::Kind op_kind = call->token_kind(); |
106 if (Token::IsRelationalOperator(op_kind) || | 107 if (Token::IsRelationalOperator(op_kind) || |
107 Token::IsEqualityOperator(op_kind) || | 108 Token::IsEqualityOperator(op_kind) || |
108 Token::IsBinaryOperator(op_kind)) { | 109 Token::IsBinaryOperator(op_kind)) { |
(...skipping 3016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3125 | 3126 |
3126 // Discard the environment from the original instruction because the store | 3127 // Discard the environment from the original instruction because the store |
3127 // can't deoptimize. | 3128 // can't deoptimize. |
3128 instr->RemoveEnvironment(); | 3129 instr->RemoveEnvironment(); |
3129 ReplaceCall(instr, store); | 3130 ReplaceCall(instr, store); |
3130 return true; | 3131 return true; |
3131 } | 3132 } |
3132 | 3133 |
3133 | 3134 |
3134 } // namespace dart | 3135 } // namespace dart |
OLD | NEW |