| 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" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 // A3 : new context containing the current isolate pointer. | 863 // A3 : new context containing the current isolate pointer. |
| 864 void StubCode::GenerateInvokeDartCodeStub(Assembler* assembler) { | 864 void StubCode::GenerateInvokeDartCodeStub(Assembler* assembler) { |
| 865 // Save frame pointer coming in. | 865 // Save frame pointer coming in. |
| 866 __ TraceSimMsg("InvokeDartCodeStub"); | 866 __ TraceSimMsg("InvokeDartCodeStub"); |
| 867 __ EnterFrame(); | 867 __ EnterFrame(); |
| 868 | 868 |
| 869 // Save new context and C++ ABI callee-saved registers. | 869 // Save new context and C++ ABI callee-saved registers. |
| 870 | 870 |
| 871 // The new context, saved vm tag, the top exit frame, and the old context. | 871 // The new context, saved vm tag, the top exit frame, and the old context. |
| 872 const intptr_t kPreservedContextSlots = 4; | 872 const intptr_t kPreservedContextSlots = 4; |
| 873 const intptr_t kNewContextOffsetFromFp = | |
| 874 -(1 + kAbiPreservedCpuRegCount + kAbiPreservedFpuRegCount) * kWordSize; | |
| 875 const intptr_t kPreservedRegSpace = | 873 const intptr_t kPreservedRegSpace = |
| 876 kWordSize * (kAbiPreservedCpuRegCount + kAbiPreservedFpuRegCount + | 874 kWordSize * (kAbiPreservedCpuRegCount + kAbiPreservedFpuRegCount + |
| 877 kPreservedContextSlots); | 875 kPreservedContextSlots); |
| 878 | 876 |
| 879 __ addiu(SP, SP, Immediate(-kPreservedRegSpace)); | 877 __ addiu(SP, SP, Immediate(-kPreservedRegSpace)); |
| 880 for (int i = S0; i <= S7; i++) { | 878 for (int i = S0; i <= S7; i++) { |
| 881 Register r = static_cast<Register>(i); | 879 Register r = static_cast<Register>(i); |
| 882 const intptr_t slot = i - S0 + kPreservedContextSlots; | 880 const intptr_t slot = i - S0 + kPreservedContextSlots; |
| 883 __ sw(r, Address(SP, slot * kWordSize)); | 881 __ sw(r, Address(SP, slot * kWordSize)); |
| 884 } | 882 } |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 966 __ delay_slot()->addiu(A2, A2, Immediate(kWordSize)); | 964 __ delay_slot()->addiu(A2, A2, Immediate(kWordSize)); |
| 967 | 965 |
| 968 __ Bind(&done_push_arguments); | 966 __ Bind(&done_push_arguments); |
| 969 | 967 |
| 970 // Call the Dart code entrypoint. | 968 // Call the Dart code entrypoint. |
| 971 // We are calling into Dart code, here, so there is no need to call through | 969 // We are calling into Dart code, here, so there is no need to call through |
| 972 // T9 to match the ABI. | 970 // T9 to match the ABI. |
| 973 __ jalr(A0); // S4 is the arguments descriptor array. | 971 __ jalr(A0); // S4 is the arguments descriptor array. |
| 974 __ TraceSimMsg("InvokeDartCodeStub return"); | 972 __ TraceSimMsg("InvokeDartCodeStub return"); |
| 975 | 973 |
| 976 // Read the saved new Context pointer. | |
| 977 __ lw(CTX, Address(FP, kNewContextOffsetFromFp)); | |
| 978 __ lw(CTX, Address(CTX, VMHandles::kOffsetOfRawPtrInHandle)); | |
| 979 | |
| 980 // Get rid of arguments pushed on the stack. | 974 // Get rid of arguments pushed on the stack. |
| 981 __ AddImmediate(SP, FP, kSavedContextSlotFromEntryFp * kWordSize); | 975 __ AddImmediate(SP, FP, kSavedContextSlotFromEntryFp * kWordSize); |
| 982 | 976 |
| 983 // Load Isolate pointer into CTX. Drop Context. | 977 // Load Isolate pointer into CTX. Drop Context. |
| 984 __ LoadIsolate(CTX); | 978 __ LoadIsolate(CTX); |
| 985 | 979 |
| 986 // Restore the current VMTag from the stack. | 980 // Restore the current VMTag from the stack. |
| 987 __ lw(T1, Address(SP, 2 * kWordSize)); | 981 __ lw(T1, Address(SP, 2 * kWordSize)); |
| 988 __ sw(T1, Address(CTX, Isolate::vm_tag_offset())); | 982 __ sw(T1, Address(CTX, Isolate::vm_tag_offset())); |
| 989 | 983 |
| (...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2257 const Register right = T0; | 2251 const Register right = T0; |
| 2258 __ lw(left, Address(SP, 1 * kWordSize)); | 2252 __ lw(left, Address(SP, 1 * kWordSize)); |
| 2259 __ lw(right, Address(SP, 0 * kWordSize)); | 2253 __ lw(right, Address(SP, 0 * kWordSize)); |
| 2260 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2); | 2254 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2); |
| 2261 __ Ret(); | 2255 __ Ret(); |
| 2262 } | 2256 } |
| 2263 | 2257 |
| 2264 } // namespace dart | 2258 } // namespace dart |
| 2265 | 2259 |
| 2266 #endif // defined TARGET_ARCH_MIPS | 2260 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |