Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Side by Side Diff: runtime/vm/stub_code_mips.cc

Issue 396463003: Move some isolate state setup from C++ code to JumpToExceptionHandler stub (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1874 matching lines...) Expand 10 before | Expand all | Expand 10 after
1885 } 1885 }
1886 1886
1887 1887
1888 // Jump to the exception or error handler. 1888 // Jump to the exception or error handler.
1889 // RA: return address. 1889 // RA: return address.
1890 // A0: program_counter. 1890 // A0: program_counter.
1891 // A1: stack_pointer. 1891 // A1: stack_pointer.
1892 // A2: frame_pointer. 1892 // A2: frame_pointer.
1893 // A3: error object. 1893 // A3: error object.
1894 // SP + 4*kWordSize: address of stacktrace object. 1894 // SP + 4*kWordSize: address of stacktrace object.
1895 // SP + 5*kWordSize: address of isolate.
1895 // Does not return. 1896 // Does not return.
1896 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) { 1897 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) {
1897 ASSERT(kExceptionObjectReg == V0); 1898 ASSERT(kExceptionObjectReg == V0);
1898 ASSERT(kStackTraceObjectReg == V1); 1899 ASSERT(kStackTraceObjectReg == V1);
1899 __ mov(V0, A3); // Exception object. 1900 __ mov(V0, A3); // Exception object.
1900 // MIPS ABI reserves stack space for all arguments. The StackTrace object is 1901 // MIPS ABI reserves stack space for all arguments. The StackTrace object is
1901 // the last of five arguments, so it is first pushed on the stack. 1902 // the last of five arguments, so it is first pushed on the stack.
1902 __ lw(V1, Address(SP, 4 * kWordSize)); // StackTrace object. 1903 __ lw(V1, Address(SP, 4 * kWordSize)); // StackTrace object.
1903 __ mov(FP, A2); // Frame_pointer. 1904 __ mov(FP, A2); // Frame_pointer.
1905 __ lw(CTX, Address(SP, 5 * kWordSize)); // Isolate.
regis 2014/07/14 20:00:34 A3?
Cutch 2014/07/14 21:32:07 Done.
1906 // Set tag.
1907 __ LoadImmediate(A2, VMTag::kScriptTagId);
1908 __ sw(A2, Address(CTX, Isolate::vm_tag_offset()));
1909 // Clear top exit frame.
1910 __ sw(ZR, Address(CTX, Isolate::top_exit_frame_info_offset()));
1911
1904 __ jr(A0); // Jump to the exception handler code. 1912 __ jr(A0); // Jump to the exception handler code.
1905 __ delay_slot()->mov(SP, A1); // Stack pointer. 1913 __ delay_slot()->mov(SP, A1); // Stack pointer.
1906 } 1914 }
1907 1915
1908 1916
1909 // Calls to the runtime to optimize the given function. 1917 // Calls to the runtime to optimize the given function.
1910 // T0: function to be reoptimized. 1918 // T0: function to be reoptimized.
1911 // S4: argument descriptor (preserved). 1919 // S4: argument descriptor (preserved).
1912 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) { 1920 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) {
1913 __ TraceSimMsg("OptimizeFunctionStub"); 1921 __ TraceSimMsg("OptimizeFunctionStub");
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
2067 const Register right = T0; 2075 const Register right = T0;
2068 __ lw(left, Address(SP, 1 * kWordSize)); 2076 __ lw(left, Address(SP, 1 * kWordSize));
2069 __ lw(right, Address(SP, 0 * kWordSize)); 2077 __ lw(right, Address(SP, 0 * kWordSize));
2070 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2); 2078 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2);
2071 __ Ret(); 2079 __ Ret();
2072 } 2080 }
2073 2081
2074 } // namespace dart 2082 } // namespace dart
2075 2083
2076 #endif // defined TARGET_ARCH_MIPS 2084 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698