| 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 2088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2099 // Now call the static function. The breakpoint handler function | 2099 // Now call the static function. The breakpoint handler function |
| 2100 // ensures that the call target is compiled. | 2100 // ensures that the call target is compiled. |
| 2101 __ lw(T0, FieldAddress(T0, Code::instructions_offset())); | 2101 __ lw(T0, FieldAddress(T0, Code::instructions_offset())); |
| 2102 __ AddImmediate(T0, Instructions::HeaderSize() - kHeapObjectTag); | 2102 __ AddImmediate(T0, Instructions::HeaderSize() - kHeapObjectTag); |
| 2103 // Load arguments descriptor into S4. | 2103 // Load arguments descriptor into S4. |
| 2104 __ lw(S4, FieldAddress(S5, ICData::arguments_descriptor_offset())); | 2104 __ lw(S4, FieldAddress(S5, ICData::arguments_descriptor_offset())); |
| 2105 __ jr(T0); | 2105 __ jr(T0); |
| 2106 } | 2106 } |
| 2107 | 2107 |
| 2108 | 2108 |
| 2109 // V0: return value. | |
| 2110 void StubCode::GenerateBreakpointReturnStub(Assembler* assembler) { | |
| 2111 __ TraceSimMsg("BreakpoingReturnStub"); | |
| 2112 // Create a stub frame as we are pushing some objects on the stack before | |
| 2113 // calling into the runtime. | |
| 2114 __ EnterStubFrame(); | |
| 2115 __ Push(V0); | |
| 2116 __ CallRuntime(kBreakpointReturnHandlerRuntimeEntry, 0); | |
| 2117 __ Pop(V0); | |
| 2118 __ LeaveStubFrame(); | |
| 2119 | |
| 2120 // Instead of returning to the patched Dart function, emulate the | |
| 2121 // smashed return code pattern and return to the function's caller. | |
| 2122 __ LeaveDartFrameAndReturn(); | |
| 2123 } | |
| 2124 | |
| 2125 | |
| 2126 // RA: return address (Dart code). | 2109 // RA: return address (Dart code). |
| 2127 // S5: Inline cache data array. | 2110 // S5: Inline cache data array. |
| 2128 void StubCode::GenerateBreakpointDynamicStub(Assembler* assembler) { | 2111 void StubCode::GenerateBreakpointDynamicStub(Assembler* assembler) { |
| 2129 // Create a stub frame as we are pushing some objects on the stack before | 2112 // Create a stub frame as we are pushing some objects on the stack before |
| 2130 // calling into the runtime. | 2113 // calling into the runtime. |
| 2131 __ TraceSimMsg("BreakpointDynamicStub"); | 2114 __ TraceSimMsg("BreakpointDynamicStub"); |
| 2132 __ EnterStubFrame(); | 2115 __ EnterStubFrame(); |
| 2133 __ Push(S5); | 2116 __ Push(S5); |
| 2134 __ CallRuntime(kBreakpointDynamicHandlerRuntimeEntry, 0); | 2117 __ CallRuntime(kBreakpointDynamicHandlerRuntimeEntry, 0); |
| 2135 __ Pop(S5); | 2118 __ Pop(S5); |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2466 const Register right = T0; | 2449 const Register right = T0; |
| 2467 __ lw(left, Address(SP, 1 * kWordSize)); | 2450 __ lw(left, Address(SP, 1 * kWordSize)); |
| 2468 __ lw(right, Address(SP, 0 * kWordSize)); | 2451 __ lw(right, Address(SP, 0 * kWordSize)); |
| 2469 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2); | 2452 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2); |
| 2470 __ Ret(); | 2453 __ Ret(); |
| 2471 } | 2454 } |
| 2472 | 2455 |
| 2473 } // namespace dart | 2456 } // namespace dart |
| 2474 | 2457 |
| 2475 #endif // defined TARGET_ARCH_MIPS | 2458 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |