OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
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 30 matching lines...) Expand all Loading... |
41 ASSERT(field_offset != Class::kNoTypeArguments); | 41 ASSERT(field_offset != Class::kNoTypeArguments); |
42 return field_offset; | 42 return field_offset; |
43 } | 43 } |
44 | 44 |
45 | 45 |
46 // Intrinsify only for Smi value and index. Non-smi values need a store buffer | 46 // Intrinsify only for Smi value and index. Non-smi values need a store buffer |
47 // update. Array length is always a Smi. | 47 // update. Array length is always a Smi. |
48 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) { | 48 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) { |
49 Label fall_through; | 49 Label fall_through; |
50 | 50 |
51 if (Isolate::Current()->TypeChecksEnabled()) { | 51 if (Isolate::Current()->flags().type_checks()) { |
52 const intptr_t type_args_field_offset = | 52 const intptr_t type_args_field_offset = |
53 ComputeObjectArrayTypeArgumentsOffset(); | 53 ComputeObjectArrayTypeArgumentsOffset(); |
54 // Inline simple tests (Smi, null), fallthrough if not positive. | 54 // Inline simple tests (Smi, null), fallthrough if not positive. |
55 Label checked_ok; | 55 Label checked_ok; |
56 __ ldr(R2, Address(SP, 0 * kWordSize)); // Value. | 56 __ ldr(R2, Address(SP, 0 * kWordSize)); // Value. |
57 | 57 |
58 // Null value is valid for any type. | 58 // Null value is valid for any type. |
59 __ CompareObject(R2, Object::null_object(), PP); | 59 __ CompareObject(R2, Object::null_object(), PP); |
60 __ b(&checked_ok, EQ); | 60 __ b(&checked_ok, EQ); |
61 | 61 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 142 |
143 __ Bind(&fall_through); | 143 __ Bind(&fall_through); |
144 } | 144 } |
145 | 145 |
146 | 146 |
147 // Add an element to growable array if it doesn't need to grow, otherwise | 147 // Add an element to growable array if it doesn't need to grow, otherwise |
148 // call into regular code. | 148 // call into regular code. |
149 // On stack: growable array (+1), value (+0). | 149 // On stack: growable array (+1), value (+0). |
150 void Intrinsifier::GrowableArray_add(Assembler* assembler) { | 150 void Intrinsifier::GrowableArray_add(Assembler* assembler) { |
151 // In checked mode we need to type-check the incoming argument. | 151 // In checked mode we need to type-check the incoming argument. |
152 if (Isolate::Current()->TypeChecksEnabled()) { | 152 if (Isolate::Current()->flags().type_checks()) { |
153 return; | 153 return; |
154 } | 154 } |
155 Label fall_through; | 155 Label fall_through; |
156 // R0: Array. | 156 // R0: Array. |
157 __ ldr(R0, Address(SP, 1 * kWordSize)); | 157 __ ldr(R0, Address(SP, 1 * kWordSize)); |
158 // R1: length. | 158 // R1: length. |
159 __ ldr(R1, FieldAddress(R0, GrowableObjectArray::length_offset())); | 159 __ ldr(R1, FieldAddress(R0, GrowableObjectArray::length_offset())); |
160 // R2: data. | 160 // R2: data. |
161 __ ldr(R2, FieldAddress(R0, GrowableObjectArray::data_offset())); | 161 __ ldr(R2, FieldAddress(R0, GrowableObjectArray::data_offset())); |
162 // R3: capacity. | 162 // R3: capacity. |
(...skipping 1946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2109 Isolate* isolate = Isolate::Current(); | 2109 Isolate* isolate = Isolate::Current(); |
2110 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate), kNoPP); | 2110 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate), kNoPP); |
2111 // Set return value to Isolate::current_tag_. | 2111 // Set return value to Isolate::current_tag_. |
2112 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); | 2112 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); |
2113 __ ret(); | 2113 __ ret(); |
2114 } | 2114 } |
2115 | 2115 |
2116 } // namespace dart | 2116 } // namespace dart |
2117 | 2117 |
2118 #endif // defined TARGET_ARCH_ARM64 | 2118 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |