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 2136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2147 __ Bind(&one_arg); | 2147 __ Bind(&one_arg); |
2148 __ Branch(&StubCode::OneArgCheckInlineCacheLabel()); | 2148 __ Branch(&StubCode::OneArgCheckInlineCacheLabel()); |
2149 __ Bind(&two_args); | 2149 __ Bind(&two_args); |
2150 __ Branch(&StubCode::TwoArgsCheckInlineCacheLabel()); | 2150 __ Branch(&StubCode::TwoArgsCheckInlineCacheLabel()); |
2151 __ Bind(&three_args); | 2151 __ Bind(&three_args); |
2152 __ Branch(&StubCode::ThreeArgsCheckInlineCacheLabel()); | 2152 __ Branch(&StubCode::ThreeArgsCheckInlineCacheLabel()); |
2153 __ break_(0); | 2153 __ break_(0); |
2154 } | 2154 } |
2155 | 2155 |
2156 | 2156 |
| 2157 // Called only from unoptimized code. All relevant registers have been saved. |
| 2158 // RA: return address. |
| 2159 void StubCode::GenerateDebugStepCheckStub(Assembler* assembler) { |
| 2160 // Check single stepping. |
| 2161 Label not_stepping; |
| 2162 __ lw(T0, FieldAddress(CTX, Context::isolate_offset())); |
| 2163 __ lbu(T0, Address(T0, Isolate::single_step_offset())); |
| 2164 __ BranchEqual(T0, 0, ¬_stepping); |
| 2165 // Call single step callback in debugger. |
| 2166 __ addiu(SP, SP, Immediate(-1 * kWordSize)); |
| 2167 __ sw(RA, Address(SP, 0 * kWordSize)); // Return address. |
| 2168 __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0); |
| 2169 __ lw(RA, Address(SP, 0 * kWordSize)); |
| 2170 __ addiu(SP, SP, Immediate(1 * kWordSize)); |
| 2171 __ Bind(¬_stepping); |
| 2172 __ Ret(); |
| 2173 } |
| 2174 |
| 2175 |
2157 // Used to check class and type arguments. Arguments passed in registers: | 2176 // Used to check class and type arguments. Arguments passed in registers: |
2158 // RA: return address. | 2177 // RA: return address. |
2159 // A0: instance (must be preserved). | 2178 // A0: instance (must be preserved). |
2160 // A1: instantiator type arguments or NULL. | 2179 // A1: instantiator type arguments or NULL. |
2161 // A2: cache array. | 2180 // A2: cache array. |
2162 // Result in V0: null -> not found, otherwise result (true or false). | 2181 // Result in V0: null -> not found, otherwise result (true or false). |
2163 static void GenerateSubtypeNTestCacheStub(Assembler* assembler, int n) { | 2182 static void GenerateSubtypeNTestCacheStub(Assembler* assembler, int n) { |
2164 __ TraceSimMsg("SubtypeNTestCacheStub"); | 2183 __ TraceSimMsg("SubtypeNTestCacheStub"); |
2165 ASSERT((1 <= n) && (n <= 3)); | 2184 ASSERT((1 <= n) && (n <= 3)); |
2166 if (n > 1) { | 2185 if (n > 1) { |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2447 const Register right = T0; | 2466 const Register right = T0; |
2448 __ lw(left, Address(SP, 1 * kWordSize)); | 2467 __ lw(left, Address(SP, 1 * kWordSize)); |
2449 __ lw(right, Address(SP, 0 * kWordSize)); | 2468 __ lw(right, Address(SP, 0 * kWordSize)); |
2450 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2); | 2469 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2); |
2451 __ Ret(); | 2470 __ Ret(); |
2452 } | 2471 } |
2453 | 2472 |
2454 } // namespace dart | 2473 } // namespace dart |
2455 | 2474 |
2456 #endif // defined TARGET_ARCH_MIPS | 2475 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |