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/intrinsifier.h" | 8 #include "vm/intrinsifier.h" |
9 | 9 |
10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 ASSERT(field_offset != Class::kNoTypeArguments); | 43 ASSERT(field_offset != Class::kNoTypeArguments); |
44 return field_offset; | 44 return field_offset; |
45 } | 45 } |
46 | 46 |
47 | 47 |
48 // Intrinsify only for Smi value and index. Non-smi values need a store buffer | 48 // Intrinsify only for Smi value and index. Non-smi values need a store buffer |
49 // update. Array length is always a Smi. | 49 // update. Array length is always a Smi. |
50 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) { | 50 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) { |
51 Label fall_through; | 51 Label fall_through; |
52 | 52 |
53 if (Isolate::Current()->TypeChecksEnabled()) { | 53 if (Isolate::Current()->flags().type_checks()) { |
54 const intptr_t type_args_field_offset = | 54 const intptr_t type_args_field_offset = |
55 ComputeObjectArrayTypeArgumentsOffset(); | 55 ComputeObjectArrayTypeArgumentsOffset(); |
56 // Inline simple tests (Smi, null), fallthrough if not positive. | 56 // Inline simple tests (Smi, null), fallthrough if not positive. |
57 const int32_t raw_null = reinterpret_cast<intptr_t>(Object::null()); | 57 const int32_t raw_null = reinterpret_cast<intptr_t>(Object::null()); |
58 Label checked_ok; | 58 Label checked_ok; |
59 __ ldr(R2, Address(SP, 0 * kWordSize)); // Value. | 59 __ ldr(R2, Address(SP, 0 * kWordSize)); // Value. |
60 | 60 |
61 // Null value is valid for any type. | 61 // Null value is valid for any type. |
62 __ CompareImmediate(R2, raw_null); | 62 __ CompareImmediate(R2, raw_null); |
63 __ b(&checked_ok, EQ); | 63 __ b(&checked_ok, EQ); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 | 146 |
147 __ Bind(&fall_through); | 147 __ Bind(&fall_through); |
148 } | 148 } |
149 | 149 |
150 | 150 |
151 // Add an element to growable array if it doesn't need to grow, otherwise | 151 // Add an element to growable array if it doesn't need to grow, otherwise |
152 // call into regular code. | 152 // call into regular code. |
153 // On stack: growable array (+1), value (+0). | 153 // On stack: growable array (+1), value (+0). |
154 void Intrinsifier::GrowableArray_add(Assembler* assembler) { | 154 void Intrinsifier::GrowableArray_add(Assembler* assembler) { |
155 // In checked mode we need to type-check the incoming argument. | 155 // In checked mode we need to type-check the incoming argument. |
156 if (Isolate::Current()->TypeChecksEnabled()) { | 156 if (Isolate::Current()->flags().type_checks()) { |
157 return; | 157 return; |
158 } | 158 } |
159 Label fall_through; | 159 Label fall_through; |
160 // R0: Array. | 160 // R0: Array. |
161 __ ldr(R0, Address(SP, 1 * kWordSize)); | 161 __ ldr(R0, Address(SP, 1 * kWordSize)); |
162 // R1: length. | 162 // R1: length. |
163 __ ldr(R1, FieldAddress(R0, GrowableObjectArray::length_offset())); | 163 __ ldr(R1, FieldAddress(R0, GrowableObjectArray::length_offset())); |
164 // R2: data. | 164 // R2: data. |
165 __ ldr(R2, FieldAddress(R0, GrowableObjectArray::data_offset())); | 165 __ ldr(R2, FieldAddress(R0, GrowableObjectArray::data_offset())); |
166 // R3: capacity. | 166 // R3: capacity. |
(...skipping 1860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2027 Isolate* isolate = Isolate::Current(); | 2027 Isolate* isolate = Isolate::Current(); |
2028 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); | 2028 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); |
2029 // Set return value to Isolate::current_tag_. | 2029 // Set return value to Isolate::current_tag_. |
2030 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); | 2030 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); |
2031 __ Ret(); | 2031 __ Ret(); |
2032 } | 2032 } |
2033 | 2033 |
2034 } // namespace dart | 2034 } // namespace dart |
2035 | 2035 |
2036 #endif // defined TARGET_ARCH_ARM | 2036 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |