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 14 matching lines...) Expand all Loading... |
25 // if the intrinsified method always executes a return. | 25 // if the intrinsified method always executes a return. |
26 // The FP register should not be modified, because it is used by the profiler. | 26 // The FP register should not be modified, because it is used by the profiler. |
27 // The PP and THR registers (see constants_mips.h) must be preserved. | 27 // The PP and THR registers (see constants_mips.h) must be preserved. |
28 | 28 |
29 #define __ assembler-> | 29 #define __ assembler-> |
30 | 30 |
31 | 31 |
32 intptr_t Intrinsifier::ParameterSlotFromSp() { return -1; } | 32 intptr_t Intrinsifier::ParameterSlotFromSp() { return -1; } |
33 | 33 |
34 | 34 |
| 35 static bool IsABIPreservedRegister(Register reg) { |
| 36 return ((1 << reg) & kAbiPreservedCpuRegs) != 0; |
| 37 } |
| 38 |
35 void Intrinsifier::IntrinsicCallPrologue(Assembler* assembler) { | 39 void Intrinsifier::IntrinsicCallPrologue(Assembler* assembler) { |
| 40 ASSERT(IsABIPreservedRegister(CODE_REG)); |
| 41 ASSERT(IsABIPreservedRegister(ARGS_DESC_REG)); |
| 42 ASSERT(IsABIPreservedRegister(CALLEE_SAVED_TEMP)); |
| 43 ASSERT(CALLEE_SAVED_TEMP != CODE_REG); |
| 44 ASSERT(CALLEE_SAVED_TEMP != ARGS_DESC_REG); |
| 45 |
36 assembler->Comment("IntrinsicCallPrologue"); | 46 assembler->Comment("IntrinsicCallPrologue"); |
37 assembler->mov(CALLEE_SAVED_TEMP, RA); | 47 assembler->mov(CALLEE_SAVED_TEMP, LRREG); |
38 } | 48 } |
39 | 49 |
40 | 50 |
41 void Intrinsifier::IntrinsicCallEpilogue(Assembler* assembler) { | 51 void Intrinsifier::IntrinsicCallEpilogue(Assembler* assembler) { |
42 assembler->Comment("IntrinsicCallEpilogue"); | 52 assembler->Comment("IntrinsicCallEpilogue"); |
43 assembler->mov(RA, CALLEE_SAVED_TEMP); | 53 assembler->mov(LRREG, CALLEE_SAVED_TEMP); |
44 } | 54 } |
45 | 55 |
46 | 56 |
47 // Intrinsify only for Smi value and index. Non-smi values need a store buffer | 57 // Intrinsify only for Smi value and index. Non-smi values need a store buffer |
48 // update. Array length is always a Smi. | 58 // update. Array length is always a Smi. |
49 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) { | 59 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) { |
50 if (Isolate::Current()->type_checks()) { | 60 if (Isolate::Current()->type_checks()) { |
51 return; | 61 return; |
52 } | 62 } |
53 | 63 |
(...skipping 2168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2222 __ lw(T0, Address(V0, TimelineStream::enabled_offset())); | 2232 __ lw(T0, Address(V0, TimelineStream::enabled_offset())); |
2223 __ LoadObject(V0, Bool::True()); | 2233 __ LoadObject(V0, Bool::True()); |
2224 __ LoadObject(V1, Bool::False()); | 2234 __ LoadObject(V1, Bool::False()); |
2225 __ Ret(); | 2235 __ Ret(); |
2226 __ delay_slot()->movz(V0, V1, T0); // V0 = (T0 == 0) ? V1 : V0. | 2236 __ delay_slot()->movz(V0, V1, T0); // V0 = (T0 == 0) ? V1 : V0. |
2227 } | 2237 } |
2228 | 2238 |
2229 } // namespace dart | 2239 } // namespace dart |
2230 | 2240 |
2231 #endif // defined TARGET_ARCH_MIPS | 2241 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |