| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 __ addiu(SP, SP, Immediate(-4 * kWordSize)); | 192 __ addiu(SP, SP, Immediate(-4 * kWordSize)); |
| 193 __ sw(A3, Address(SP, 3 * kWordSize)); | 193 __ sw(A3, Address(SP, 3 * kWordSize)); |
| 194 __ sw(A2, Address(SP, 2 * kWordSize)); | 194 __ sw(A2, Address(SP, 2 * kWordSize)); |
| 195 __ sw(A1, Address(SP, 1 * kWordSize)); | 195 __ sw(A1, Address(SP, 1 * kWordSize)); |
| 196 __ sw(A0, Address(SP, 0 * kWordSize)); | 196 __ sw(A0, Address(SP, 0 * kWordSize)); |
| 197 __ mov(A0, SP); // Pass the pointer to the NativeArguments. | 197 __ mov(A0, SP); // Pass the pointer to the NativeArguments. |
| 198 | 198 |
| 199 | 199 |
| 200 __ mov(A1, T5); // Pass the function entrypoint. | 200 __ mov(A1, T5); // Pass the function entrypoint. |
| 201 __ ReserveAlignedFrameSpace(2 * kWordSize); // Just passing A0, A1. | 201 __ ReserveAlignedFrameSpace(2 * kWordSize); // Just passing A0, A1. |
| 202 |
| 202 // Call native wrapper function or redirection via simulator. | 203 // Call native wrapper function or redirection via simulator. |
| 203 #if defined(USING_SIMULATOR) | 204 __ lw(T9, Address(THR, Thread::native_call_wrapper_entry_point_offset())); |
| 204 uword entry = reinterpret_cast<uword>(NativeEntry::NativeCallWrapper); | |
| 205 entry = Simulator::RedirectExternalReference( | |
| 206 entry, Simulator::kNativeCall, NativeEntry::kNumCallWrapperArguments); | |
| 207 __ LoadImmediate(T9, entry); | |
| 208 __ jalr(T9); | 205 __ jalr(T9); |
| 209 #else | |
| 210 __ BranchLink(&NativeEntry::NativeCallWrapperLabel(), kNotPatchable); | |
| 211 #endif | |
| 212 __ Comment("CallNativeCFunctionStub return"); | 206 __ Comment("CallNativeCFunctionStub return"); |
| 213 | 207 |
| 214 // Mark that the isolate is executing Dart code. | 208 // Mark that the isolate is executing Dart code. |
| 215 __ LoadImmediate(A2, VMTag::kDartTagId); | 209 __ LoadImmediate(A2, VMTag::kDartTagId); |
| 216 __ sw(A2, Address(S2, Isolate::vm_tag_offset())); | 210 __ sw(A2, Address(S2, Isolate::vm_tag_offset())); |
| 217 | 211 |
| 218 // Reset exit frame information in Isolate structure. | 212 // Reset exit frame information in Isolate structure. |
| 219 __ sw(ZR, Address(THR, Thread::top_exit_frame_info_offset())); | 213 __ sw(ZR, Address(THR, Thread::top_exit_frame_info_offset())); |
| 220 | 214 |
| 221 __ LeaveStubFrameAndReturn(); | 215 __ LeaveStubFrameAndReturn(); |
| (...skipping 2055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2277 // Result: | 2271 // Result: |
| 2278 // T1: entry point. | 2272 // T1: entry point. |
| 2279 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { | 2273 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
| 2280 EmitMegamorphicLookup(assembler, T0, T1, T1); | 2274 EmitMegamorphicLookup(assembler, T0, T1, T1); |
| 2281 __ Ret(); | 2275 __ Ret(); |
| 2282 } | 2276 } |
| 2283 | 2277 |
| 2284 } // namespace dart | 2278 } // namespace dart |
| 2285 | 2279 |
| 2286 #endif // defined TARGET_ARCH_MIPS | 2280 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |