| 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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
| 6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
| 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 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 #define __ assembler-> | 28 #define __ assembler-> |
| 29 | 29 |
| 30 | 30 |
| 31 intptr_t Intrinsifier::ParameterSlotFromSp() { return -1; } | 31 intptr_t Intrinsifier::ParameterSlotFromSp() { return -1; } |
| 32 | 32 |
| 33 | 33 |
| 34 // Intrinsify only for Smi value and index. Non-smi values need a store buffer | 34 // Intrinsify only for Smi value and index. Non-smi values need a store buffer |
| 35 // update. Array length is always a Smi. | 35 // update. Array length is always a Smi. |
| 36 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) { | 36 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) { |
| 37 if (Isolate::Current()->flags().type_checks()) { | 37 if (Isolate::Current()->type_checks()) { |
| 38 return; | 38 return; |
| 39 } | 39 } |
| 40 | 40 |
| 41 Label fall_through; | 41 Label fall_through; |
| 42 __ lw(T1, Address(SP, 1 * kWordSize)); // Index. | 42 __ lw(T1, Address(SP, 1 * kWordSize)); // Index. |
| 43 __ andi(CMPRES1, T1, Immediate(kSmiTagMask)); | 43 __ andi(CMPRES1, T1, Immediate(kSmiTagMask)); |
| 44 // Index not Smi. | 44 // Index not Smi. |
| 45 __ bne(CMPRES1, ZR, &fall_through); | 45 __ bne(CMPRES1, ZR, &fall_through); |
| 46 | 46 |
| 47 __ lw(T0, Address(SP, 2 * kWordSize)); // Array. | 47 __ lw(T0, Address(SP, 2 * kWordSize)); // Array. |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 99 |
| 100 __ Bind(&fall_through); | 100 __ Bind(&fall_through); |
| 101 } | 101 } |
| 102 | 102 |
| 103 | 103 |
| 104 // Add an element to growable array if it doesn't need to grow, otherwise | 104 // Add an element to growable array if it doesn't need to grow, otherwise |
| 105 // call into regular code. | 105 // call into regular code. |
| 106 // On stack: growable array (+1), value (+0). | 106 // On stack: growable array (+1), value (+0). |
| 107 void Intrinsifier::GrowableArray_add(Assembler* assembler) { | 107 void Intrinsifier::GrowableArray_add(Assembler* assembler) { |
| 108 // In checked mode we need to type-check the incoming argument. | 108 // In checked mode we need to type-check the incoming argument. |
| 109 if (Isolate::Current()->flags().type_checks()) return; | 109 if (Isolate::Current()->type_checks()) return; |
| 110 Label fall_through; | 110 Label fall_through; |
| 111 __ lw(T0, Address(SP, 1 * kWordSize)); // Array. | 111 __ lw(T0, Address(SP, 1 * kWordSize)); // Array. |
| 112 __ lw(T1, FieldAddress(T0, GrowableObjectArray::length_offset())); | 112 __ lw(T1, FieldAddress(T0, GrowableObjectArray::length_offset())); |
| 113 // T1: length. | 113 // T1: length. |
| 114 __ lw(T2, FieldAddress(T0, GrowableObjectArray::data_offset())); | 114 __ lw(T2, FieldAddress(T0, GrowableObjectArray::data_offset())); |
| 115 // T2: data. | 115 // T2: data. |
| 116 __ lw(T3, FieldAddress(T2, Array::length_offset())); | 116 __ lw(T3, FieldAddress(T2, Array::length_offset())); |
| 117 // Compare length with capacity. | 117 // Compare length with capacity. |
| 118 // T3: capacity. | 118 // T3: capacity. |
| 119 __ beq(T1, T3, &fall_through); // Must grow data. | 119 __ beq(T1, T3, &fall_through); // Must grow data. |
| (...skipping 2108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2228 | 2228 |
| 2229 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { | 2229 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { |
| 2230 __ LoadIsolate(V0); | 2230 __ LoadIsolate(V0); |
| 2231 __ Ret(); | 2231 __ Ret(); |
| 2232 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); | 2232 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); |
| 2233 } | 2233 } |
| 2234 | 2234 |
| 2235 } // namespace dart | 2235 } // namespace dart |
| 2236 | 2236 |
| 2237 #endif // defined TARGET_ARCH_MIPS | 2237 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |