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 2063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2074 | 2074 |
2075 __ lw(S5, Address(SP, 2 * kWordSize)); | 2075 __ lw(S5, Address(SP, 2 * kWordSize)); |
2076 __ lw(S4, Address(SP, 1 * kWordSize)); | 2076 __ lw(S4, Address(SP, 1 * kWordSize)); |
2077 __ lw(T0, Address(SP, 0 * kWordSize)); | 2077 __ lw(T0, Address(SP, 0 * kWordSize)); |
2078 __ addiu(SP, SP, Immediate(3 * kWordSize)); | 2078 __ addiu(SP, SP, Immediate(3 * kWordSize)); |
2079 __ LeaveStubFrame(); | 2079 __ LeaveStubFrame(); |
2080 __ jr(T0); | 2080 __ jr(T0); |
2081 } | 2081 } |
2082 | 2082 |
2083 | 2083 |
2084 // RA: return address (Dart code). | |
2085 // S5: Inline cache data array. | |
2086 void StubCode::GenerateBreakpointDynamicStub(Assembler* assembler) { | |
2087 // Create a stub frame as we are pushing some objects on the stack before | |
2088 // calling into the runtime. | |
2089 __ TraceSimMsg("BreakpointDynamicStub"); | |
2090 __ EnterStubFrame(); | |
2091 __ Push(S5); | |
2092 __ CallRuntime(kBreakpointDynamicHandlerRuntimeEntry, 0); | |
2093 __ Pop(S5); | |
2094 __ LeaveStubFrame(); | |
2095 | |
2096 // Find out which dispatch stub to call. | |
2097 __ lw(T1, FieldAddress(S5, ICData::num_args_tested_offset())); | |
2098 | |
2099 Label one_arg, two_args, three_args; | |
2100 __ BranchEqual(T1, 1, &one_arg); | |
2101 __ BranchEqual(T1, 2, &two_args); | |
2102 __ BranchEqual(T1, 3, &three_args); | |
2103 __ Stop("Unsupported number of arguments tested."); | |
2104 | |
2105 __ Bind(&one_arg); | |
2106 __ Branch(&StubCode::OneArgCheckInlineCacheLabel()); | |
2107 __ Bind(&two_args); | |
2108 __ Branch(&StubCode::TwoArgsCheckInlineCacheLabel()); | |
2109 __ Bind(&three_args); | |
2110 __ Branch(&StubCode::ThreeArgsCheckInlineCacheLabel()); | |
2111 __ break_(0); | |
2112 } | |
2113 | |
2114 | |
2115 // Called only from unoptimized code. All relevant registers have been saved. | 2084 // Called only from unoptimized code. All relevant registers have been saved. |
2116 // RA: return address. | 2085 // RA: return address. |
2117 void StubCode::GenerateDebugStepCheckStub(Assembler* assembler) { | 2086 void StubCode::GenerateDebugStepCheckStub(Assembler* assembler) { |
2118 // Check single stepping. | 2087 // Check single stepping. |
2119 Label not_stepping; | 2088 Label not_stepping; |
2120 __ lw(T0, FieldAddress(CTX, Context::isolate_offset())); | 2089 __ lw(T0, FieldAddress(CTX, Context::isolate_offset())); |
2121 __ lbu(T0, Address(T0, Isolate::single_step_offset())); | 2090 __ lbu(T0, Address(T0, Isolate::single_step_offset())); |
2122 __ BranchEqual(T0, 0, ¬_stepping); | 2091 __ BranchEqual(T0, 0, ¬_stepping); |
2123 // Call single step callback in debugger. | 2092 // Call single step callback in debugger. |
2124 __ EnterStubFrame(); | 2093 __ EnterStubFrame(); |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2428 const Register right = T0; | 2397 const Register right = T0; |
2429 __ lw(left, Address(SP, 1 * kWordSize)); | 2398 __ lw(left, Address(SP, 1 * kWordSize)); |
2430 __ lw(right, Address(SP, 0 * kWordSize)); | 2399 __ lw(right, Address(SP, 0 * kWordSize)); |
2431 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2); | 2400 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2); |
2432 __ Ret(); | 2401 __ Ret(); |
2433 } | 2402 } |
2434 | 2403 |
2435 } // namespace dart | 2404 } // namespace dart |
2436 | 2405 |
2437 #endif // defined TARGET_ARCH_MIPS | 2406 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |