| 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 16 matching lines...) Expand all Loading... |
| 27 DECLARE_FLAG(bool, trace_optimized_ic_calls); | 27 DECLARE_FLAG(bool, trace_optimized_ic_calls); |
| 28 | 28 |
| 29 DECLARE_FLAG(bool, enable_debugger); | 29 DECLARE_FLAG(bool, enable_debugger); |
| 30 | 30 |
| 31 // Input parameters: | 31 // Input parameters: |
| 32 // RA : return address. | 32 // RA : return address. |
| 33 // SP : address of last argument in argument array. | 33 // SP : address of last argument in argument array. |
| 34 // SP + 4*S4 - 4 : address of first argument in argument array. | 34 // SP + 4*S4 - 4 : address of first argument in argument array. |
| 35 // SP + 4*S4 : address of return value. | 35 // SP + 4*S4 : address of return value. |
| 36 // S5 : address of the runtime function to call. | 36 // S5 : address of the runtime function to call. |
| 37 // S4 : number of arguments to the call. | 37 // S4 : number of arguments to the call as Smi. |
| 38 void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) { | 38 void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) { |
| 39 const intptr_t isolate_offset = NativeArguments::isolate_offset(); | 39 const intptr_t isolate_offset = NativeArguments::isolate_offset(); |
| 40 const intptr_t argc_tag_offset = NativeArguments::argc_tag_offset(); | 40 const intptr_t argc_tag_offset = NativeArguments::argc_tag_offset(); |
| 41 const intptr_t argv_offset = NativeArguments::argv_offset(); | 41 const intptr_t argv_offset = NativeArguments::argv_offset(); |
| 42 const intptr_t retval_offset = NativeArguments::retval_offset(); | 42 const intptr_t retval_offset = NativeArguments::retval_offset(); |
| 43 const intptr_t exitframe_last_param_slot_from_fp = 2; | 43 const intptr_t exitframe_last_param_slot_from_fp = 2; |
| 44 | 44 |
| 45 __ SetPrologueOffset(); | 45 __ SetPrologueOffset(); |
| 46 __ TraceSimMsg("CallToRuntimeStub"); | 46 __ TraceSimMsg("CallToRuntimeStub"); |
| 47 __ addiu(SP, SP, Immediate(-3 * kWordSize)); | 47 __ addiu(SP, SP, Immediate(-3 * kWordSize)); |
| 48 __ sw(ZR, Address(SP, 2 * kWordSize)); // Push 0 for the PC marker | 48 __ sw(ZR, Address(SP, 2 * kWordSize)); // Push 0 for the PC marker |
| 49 __ sw(RA, Address(SP, 1 * kWordSize)); | 49 __ sw(RA, Address(SP, 1 * kWordSize)); |
| 50 __ sw(FP, Address(SP, 0 * kWordSize)); | 50 __ sw(FP, Address(SP, 0 * kWordSize)); |
| 51 __ mov(FP, SP); | 51 __ mov(FP, SP); |
| 52 __ SmiUntag(S4); |
| 52 | 53 |
| 53 // Load current Isolate pointer from Context structure into A0. | 54 // Load current Isolate pointer from Context structure into A0. |
| 54 __ lw(A0, FieldAddress(CTX, Context::isolate_offset())); | 55 __ lw(A0, FieldAddress(CTX, Context::isolate_offset())); |
| 55 | 56 |
| 56 // Save exit frame information to enable stack walking as we are about | 57 // Save exit frame information to enable stack walking as we are about |
| 57 // to transition to Dart VM C++ code. | 58 // to transition to Dart VM C++ code. |
| 58 __ sw(SP, Address(A0, Isolate::top_exit_frame_info_offset())); | 59 __ sw(SP, Address(A0, Isolate::top_exit_frame_info_offset())); |
| 59 | 60 |
| 60 // Save current Context pointer into Isolate structure. | 61 // Save current Context pointer into Isolate structure. |
| 61 __ sw(CTX, Address(A0, Isolate::top_context_offset())); | 62 __ sw(CTX, Address(A0, Isolate::top_context_offset())); |
| (...skipping 1999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2061 const Register right = T0; | 2062 const Register right = T0; |
| 2062 __ lw(left, Address(SP, 1 * kWordSize)); | 2063 __ lw(left, Address(SP, 1 * kWordSize)); |
| 2063 __ lw(right, Address(SP, 0 * kWordSize)); | 2064 __ lw(right, Address(SP, 0 * kWordSize)); |
| 2064 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2); | 2065 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2); |
| 2065 __ Ret(); | 2066 __ Ret(); |
| 2066 } | 2067 } |
| 2067 | 2068 |
| 2068 } // namespace dart | 2069 } // namespace dart |
| 2069 | 2070 |
| 2070 #endif // defined TARGET_ARCH_MIPS | 2071 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |