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 1911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1922 } | 1922 } |
1923 | 1923 |
1924 | 1924 |
1925 // Jump to the exception or error handler. | 1925 // Jump to the exception or error handler. |
1926 // RA: return address. | 1926 // RA: return address. |
1927 // A0: program_counter. | 1927 // A0: program_counter. |
1928 // A1: stack_pointer. | 1928 // A1: stack_pointer. |
1929 // A2: frame_pointer. | 1929 // A2: frame_pointer. |
1930 // A3: error object. | 1930 // A3: error object. |
1931 // SP + 4*kWordSize: address of stacktrace object. | 1931 // SP + 4*kWordSize: address of stacktrace object. |
| 1932 // SP + 5*kWordSize: address of isolate. |
1932 // Does not return. | 1933 // Does not return. |
1933 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) { | 1934 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) { |
1934 ASSERT(kExceptionObjectReg == V0); | 1935 ASSERT(kExceptionObjectReg == V0); |
1935 ASSERT(kStackTraceObjectReg == V1); | 1936 ASSERT(kStackTraceObjectReg == V1); |
1936 __ mov(V0, A3); // Exception object. | 1937 __ mov(V0, A3); // Exception object. |
1937 // MIPS ABI reserves stack space for all arguments. The StackTrace object is | 1938 // MIPS ABI reserves stack space for all arguments. The StackTrace object is |
1938 // the last of five arguments, so it is first pushed on the stack. | 1939 // the last of five arguments, so it is first pushed on the stack. |
1939 __ lw(V1, Address(SP, 4 * kWordSize)); // StackTrace object. | 1940 __ lw(V1, Address(SP, 4 * kWordSize)); // StackTrace object. |
1940 __ mov(FP, A2); // Frame_pointer. | 1941 __ mov(FP, A2); // Frame_pointer. |
| 1942 __ lw(A3, Address(SP, 5 * kWordSize)); // Isolate. |
| 1943 // Set tag. |
| 1944 __ LoadImmediate(A2, VMTag::kScriptTagId); |
| 1945 __ sw(A2, Address(A3, Isolate::vm_tag_offset())); |
| 1946 // Clear top exit frame. |
| 1947 __ sw(ZR, Address(A3, Isolate::top_exit_frame_info_offset())); |
| 1948 |
1941 __ jr(A0); // Jump to the exception handler code. | 1949 __ jr(A0); // Jump to the exception handler code. |
1942 __ delay_slot()->mov(SP, A1); // Stack pointer. | 1950 __ delay_slot()->mov(SP, A1); // Stack pointer. |
1943 } | 1951 } |
1944 | 1952 |
1945 | 1953 |
1946 // Calls to the runtime to optimize the given function. | 1954 // Calls to the runtime to optimize the given function. |
1947 // T0: function to be reoptimized. | 1955 // T0: function to be reoptimized. |
1948 // S4: argument descriptor (preserved). | 1956 // S4: argument descriptor (preserved). |
1949 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) { | 1957 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) { |
1950 __ TraceSimMsg("OptimizeFunctionStub"); | 1958 __ TraceSimMsg("OptimizeFunctionStub"); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2104 const Register right = T0; | 2112 const Register right = T0; |
2105 __ lw(left, Address(SP, 1 * kWordSize)); | 2113 __ lw(left, Address(SP, 1 * kWordSize)); |
2106 __ lw(right, Address(SP, 0 * kWordSize)); | 2114 __ lw(right, Address(SP, 0 * kWordSize)); |
2107 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2); | 2115 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2); |
2108 __ Ret(); | 2116 __ Ret(); |
2109 } | 2117 } |
2110 | 2118 |
2111 } // namespace dart | 2119 } // namespace dart |
2112 | 2120 |
2113 #endif // defined TARGET_ARCH_MIPS | 2121 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |