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