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/globals.h" // Needed here to get TARGET_ARCH_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
7 | 7 |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 2179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2190 Label type_arguments_instantiated; | 2190 Label type_arguments_instantiated; |
2191 const intptr_t len = type_arguments().Length(); | 2191 const intptr_t len = type_arguments().Length(); |
2192 if (type_arguments().IsRawInstantiatedRaw(len)) { | 2192 if (type_arguments().IsRawInstantiatedRaw(len)) { |
2193 __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null())); | 2193 __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null())); |
2194 __ cmp(instantiator_reg, ShifterOperand(IP)); | 2194 __ cmp(instantiator_reg, ShifterOperand(IP)); |
2195 __ b(&type_arguments_instantiated, EQ); | 2195 __ b(&type_arguments_instantiated, EQ); |
2196 } | 2196 } |
2197 | 2197 |
2198 __ LoadObject(R2, type_arguments()); | 2198 __ LoadObject(R2, type_arguments()); |
2199 __ ldr(R2, FieldAddress(R2, TypeArguments::instantiations_offset())); | 2199 __ ldr(R2, FieldAddress(R2, TypeArguments::instantiations_offset())); |
2200 __ ldr(R3, FieldAddress(R2, Array::length_offset())); | |
2201 __ AddImmediate(R2, Array::data_offset() - kHeapObjectTag); | 2200 __ AddImmediate(R2, Array::data_offset() - kHeapObjectTag); |
2202 __ add(R3, R2, ShifterOperand(R3, LSL, 1)); // R3 is Smi. | 2201 // The instantiations cache is initialized with Object::zero_array() and is |
| 2202 // therefore guaranteed to contain kNoInstantiator. No length check needed. |
2203 Label loop, found, slow_case; | 2203 Label loop, found, slow_case; |
2204 __ Bind(&loop); | 2204 __ Bind(&loop); |
2205 __ cmp(R2, ShifterOperand(R3)); | |
2206 __ b(&slow_case, CS); // Unsigned higher or equal. | |
2207 __ ldr(R1, Address(R2, 0 * kWordSize)); // Cached instantiator. | 2205 __ ldr(R1, Address(R2, 0 * kWordSize)); // Cached instantiator. |
2208 __ cmp(R1, ShifterOperand(R0)); | 2206 __ cmp(R1, ShifterOperand(R0)); |
2209 __ b(&found, EQ); | 2207 __ b(&found, EQ); |
2210 __ CompareImmediate(R1, Smi::RawValue(StubCode::kNoInstantiator)); | 2208 __ CompareImmediate(R1, Smi::RawValue(StubCode::kNoInstantiator)); |
2211 __ b(&slow_case, EQ); | 2209 __ b(&slow_case, EQ); |
2212 __ AddImmediate(R2, 2 * kWordSize); | 2210 __ AddImmediate(R2, 2 * kWordSize); |
2213 __ b(&loop); | 2211 __ b(&loop); |
2214 __ Bind(&found); | 2212 __ Bind(&found); |
2215 __ ldr(R0, Address(R2, 1 * kWordSize)); // Cached instantiated args. | 2213 __ ldr(R0, Address(R2, 1 * kWordSize)); // Cached instantiated args. |
2216 __ b(&type_arguments_instantiated); | 2214 __ b(&type_arguments_instantiated); |
(...skipping 2681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4898 compiler->GenerateCall(token_pos(), | 4896 compiler->GenerateCall(token_pos(), |
4899 &label, | 4897 &label, |
4900 PcDescriptors::kOther, | 4898 PcDescriptors::kOther, |
4901 locs()); | 4899 locs()); |
4902 __ Drop(2); // Discard type arguments and receiver. | 4900 __ Drop(2); // Discard type arguments and receiver. |
4903 } | 4901 } |
4904 | 4902 |
4905 } // namespace dart | 4903 } // namespace dart |
4906 | 4904 |
4907 #endif // defined TARGET_ARCH_ARM | 4905 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |