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

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

Issue 13874010: Merge JumpToErrorHandler and JumpToExceptionHandler stubs on all architectures. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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
« no previous file with comments | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 1861 matching lines...) Expand 10 before | Expand all | Expand 10 after
1872 // Return the current stack pointer address, used to stack alignment 1872 // Return the current stack pointer address, used to stack alignment
1873 // checks. 1873 // checks.
1874 // TOS + 0: return address 1874 // TOS + 0: return address
1875 // Result in EAX. 1875 // Result in EAX.
1876 void StubCode::GenerateGetStackPointerStub(Assembler* assembler) { 1876 void StubCode::GenerateGetStackPointerStub(Assembler* assembler) {
1877 __ leal(EAX, Address(ESP, kWordSize)); 1877 __ leal(EAX, Address(ESP, kWordSize));
1878 __ ret(); 1878 __ ret();
1879 } 1879 }
1880 1880
1881 1881
1882 // Jump to the exception handler. 1882 // Jump to the exception or error handler.
1883 // TOS + 0: return address 1883 // TOS + 0: return address
1884 // TOS + 1: program_counter 1884 // TOS + 1: program_counter
1885 // TOS + 2: stack_pointer 1885 // TOS + 2: stack_pointer
1886 // TOS + 3: frame_pointer 1886 // TOS + 3: frame_pointer
1887 // TOS + 4: exception object 1887 // TOS + 4: exception object
1888 // TOS + 5: stacktrace object 1888 // TOS + 5: stacktrace object
1889 // No Result. 1889 // No Result.
1890 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) { 1890 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) {
1891 ASSERT(kExceptionObjectReg == EAX); 1891 ASSERT(kExceptionObjectReg == EAX);
1892 ASSERT(kStackTraceObjectReg == EDX); 1892 ASSERT(kStackTraceObjectReg == EDX);
1893 __ movl(kStackTraceObjectReg, Address(ESP, 5 * kWordSize)); 1893 __ movl(kStackTraceObjectReg, Address(ESP, 5 * kWordSize));
1894 __ movl(kExceptionObjectReg, Address(ESP, 4 * kWordSize)); 1894 __ movl(kExceptionObjectReg, Address(ESP, 4 * kWordSize));
1895 __ movl(EBP, Address(ESP, 3 * kWordSize)); // Load target frame_pointer. 1895 __ movl(EBP, Address(ESP, 3 * kWordSize)); // Load target frame_pointer.
1896 __ movl(EBX, Address(ESP, 1 * kWordSize)); // Load target PC into EBX. 1896 __ movl(EBX, Address(ESP, 1 * kWordSize)); // Load target PC into EBX.
1897 __ movl(ESP, Address(ESP, 2 * kWordSize)); // Load target stack_pointer. 1897 __ movl(ESP, Address(ESP, 2 * kWordSize)); // Load target stack_pointer.
1898 __ jmp(EBX); // Jump to the exception handler code. 1898 __ jmp(EBX); // Jump to the exception handler code.
1899 } 1899 }
1900 1900
1901 1901
1902 // Jump to the error handler.
1903 // TOS + 0: return address
1904 // TOS + 1: program_counter
1905 // TOS + 2: stack_pointer
1906 // TOS + 3: frame_pointer
1907 // TOS + 4: error object
1908 // No Result.
1909 void StubCode::GenerateJumpToErrorHandlerStub(Assembler* assembler) {
1910 ASSERT(kExceptionObjectReg == EAX);
1911 __ movl(EAX, Address(ESP, 4 * kWordSize)); // Load error object.
1912 __ movl(EBP, Address(ESP, 3 * kWordSize)); // Load target frame_pointer.
1913 __ movl(EBX, Address(ESP, 1 * kWordSize)); // Load target PC into EBX.
1914 __ movl(ESP, Address(ESP, 2 * kWordSize)); // Load target stack_pointer.
1915 __ jmp(EBX); // Jump to the exception handler code.
1916 }
1917
1918
1919 // Implements equality operator when one of the arguments is null 1902 // Implements equality operator when one of the arguments is null
1920 // (identity check) and updates ICData if necessary. 1903 // (identity check) and updates ICData if necessary.
1921 // TOS + 0: return address 1904 // TOS + 0: return address
1922 // TOS + 1: right argument 1905 // TOS + 1: right argument
1923 // TOS + 2: left argument 1906 // TOS + 2: left argument
1924 // ECX: ICData. 1907 // ECX: ICData.
1925 // EAX: result. 1908 // EAX: result.
1926 // TODO(srdjan): Move to VM stubs once Boolean objects become VM objects. 1909 // TODO(srdjan): Move to VM stubs once Boolean objects become VM objects.
1927 void StubCode::GenerateEqualityWithNullArgStub(Assembler* assembler) { 1910 void StubCode::GenerateEqualityWithNullArgStub(Assembler* assembler) {
1928 static const intptr_t kNumArgsTested = 2; 1911 static const intptr_t kNumArgsTested = 2;
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
2118 __ Bind(&done); 2101 __ Bind(&done);
2119 __ popl(temp); 2102 __ popl(temp);
2120 __ popl(right); 2103 __ popl(right);
2121 __ popl(left); 2104 __ popl(left);
2122 __ ret(); 2105 __ ret();
2123 } 2106 }
2124 2107
2125 } // namespace dart 2108 } // namespace dart
2126 2109
2127 #endif // defined TARGET_ARCH_IA32 2110 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698