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 26 matching lines...) Expand all Loading... |
37 ASSERT(field_offset != Class::kNoTypeArguments); | 37 ASSERT(field_offset != Class::kNoTypeArguments); |
38 return field_offset; | 38 return field_offset; |
39 } | 39 } |
40 | 40 |
41 | 41 |
42 // Intrinsify only for Smi value and index. Non-smi values need a store buffer | 42 // Intrinsify only for Smi value and index. Non-smi values need a store buffer |
43 // update. Array length is always a Smi. | 43 // update. Array length is always a Smi. |
44 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) { | 44 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) { |
45 Label fall_through; | 45 Label fall_through; |
46 | 46 |
47 if (FLAG_enable_type_checks) { | 47 if (Isolate::Current()->TypeChecksEnabled()) { |
48 const intptr_t type_args_field_offset = | 48 const intptr_t type_args_field_offset = |
49 ComputeObjectArrayTypeArgumentsOffset(); | 49 ComputeObjectArrayTypeArgumentsOffset(); |
50 // Inline simple tests (Smi, null), fallthrough if not positive. | 50 // Inline simple tests (Smi, null), fallthrough if not positive. |
51 const int32_t raw_null = reinterpret_cast<intptr_t>(Object::null()); | 51 const int32_t raw_null = reinterpret_cast<intptr_t>(Object::null()); |
52 Label checked_ok; | 52 Label checked_ok; |
53 __ ldr(R2, Address(SP, 0 * kWordSize)); // Value. | 53 __ ldr(R2, Address(SP, 0 * kWordSize)); // Value. |
54 | 54 |
55 // Null value is valid for any type. | 55 // Null value is valid for any type. |
56 __ CompareImmediate(R2, raw_null); | 56 __ CompareImmediate(R2, raw_null); |
57 __ b(&checked_ok, EQ); | 57 __ b(&checked_ok, EQ); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 __ Bind(&fall_through); | 141 __ Bind(&fall_through); |
142 } | 142 } |
143 | 143 |
144 | 144 |
145 // Add an element to growable array if it doesn't need to grow, otherwise | 145 // Add an element to growable array if it doesn't need to grow, otherwise |
146 // call into regular code. | 146 // call into regular code. |
147 // On stack: growable array (+1), value (+0). | 147 // On stack: growable array (+1), value (+0). |
148 void Intrinsifier::GrowableArray_add(Assembler* assembler) { | 148 void Intrinsifier::GrowableArray_add(Assembler* assembler) { |
149 // In checked mode we need to type-check the incoming argument. | 149 // In checked mode we need to type-check the incoming argument. |
150 if (FLAG_enable_type_checks) { | 150 if (Isolate::Current()->TypeChecksEnabled()) { |
151 return; | 151 return; |
152 } | 152 } |
153 Label fall_through; | 153 Label fall_through; |
154 // R0: Array. | 154 // R0: Array. |
155 __ ldr(R0, Address(SP, 1 * kWordSize)); | 155 __ ldr(R0, Address(SP, 1 * kWordSize)); |
156 // R1: length. | 156 // R1: length. |
157 __ ldr(R1, FieldAddress(R0, GrowableObjectArray::length_offset())); | 157 __ ldr(R1, FieldAddress(R0, GrowableObjectArray::length_offset())); |
158 // R2: data. | 158 // R2: data. |
159 __ ldr(R2, FieldAddress(R0, GrowableObjectArray::data_offset())); | 159 __ ldr(R2, FieldAddress(R0, GrowableObjectArray::data_offset())); |
160 // R3: capacity. | 160 // R3: capacity. |
(...skipping 1813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1974 Isolate* isolate = Isolate::Current(); | 1974 Isolate* isolate = Isolate::Current(); |
1975 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); | 1975 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); |
1976 // Set return value to Isolate::current_tag_. | 1976 // Set return value to Isolate::current_tag_. |
1977 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); | 1977 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); |
1978 __ Ret(); | 1978 __ Ret(); |
1979 } | 1979 } |
1980 | 1980 |
1981 } // namespace dart | 1981 } // namespace dart |
1982 | 1982 |
1983 #endif // defined TARGET_ARCH_ARM | 1983 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |