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_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 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1746 } | 1746 } |
1747 | 1747 |
1748 | 1748 |
1749 // Jump to the exception or error handler. | 1749 // Jump to the exception or error handler. |
1750 // TOS + 0: return address | 1750 // TOS + 0: return address |
1751 // TOS + 1: program_counter | 1751 // TOS + 1: program_counter |
1752 // TOS + 2: stack_pointer | 1752 // TOS + 2: stack_pointer |
1753 // TOS + 3: frame_pointer | 1753 // TOS + 3: frame_pointer |
1754 // TOS + 4: exception object | 1754 // TOS + 4: exception object |
1755 // TOS + 5: stacktrace object | 1755 // TOS + 5: stacktrace object |
1756 // TOS + 6: isolate | |
1756 // No Result. | 1757 // No Result. |
1757 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) { | 1758 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) { |
1758 ASSERT(kExceptionObjectReg == EAX); | 1759 ASSERT(kExceptionObjectReg == EAX); |
1759 ASSERT(kStackTraceObjectReg == EDX); | 1760 ASSERT(kStackTraceObjectReg == EDX); |
1761 __ movl(CTX, Address(ESP, 6 * kWordSize)); // Load target isolate. | |
regis
2014/07/14 20:00:34
You could use EAX instead of CTX.
Cutch
2014/07/14 21:32:07
Can't use EAX because it is the same askExceptionO
| |
1760 __ movl(kStackTraceObjectReg, Address(ESP, 5 * kWordSize)); | 1762 __ movl(kStackTraceObjectReg, Address(ESP, 5 * kWordSize)); |
1761 __ movl(kExceptionObjectReg, Address(ESP, 4 * kWordSize)); | 1763 __ movl(kExceptionObjectReg, Address(ESP, 4 * kWordSize)); |
1762 __ movl(EBP, Address(ESP, 3 * kWordSize)); // Load target frame_pointer. | 1764 __ movl(EBP, Address(ESP, 3 * kWordSize)); // Load target frame_pointer. |
1763 __ movl(EBX, Address(ESP, 1 * kWordSize)); // Load target PC into EBX. | 1765 __ movl(EBX, Address(ESP, 1 * kWordSize)); // Load target PC into EBX. |
1764 __ movl(ESP, Address(ESP, 2 * kWordSize)); // Load target stack_pointer. | 1766 __ movl(ESP, Address(ESP, 2 * kWordSize)); // Load target stack_pointer. |
1767 // Set tag. | |
1768 __ movl(Address(CTX, Isolate::vm_tag_offset()), | |
1769 Immediate(VMTag::kScriptTagId)); | |
1770 // Clear top exit frame. | |
1771 __ movl(Address(CTX, Isolate::top_exit_frame_info_offset()), Immediate(0)); | |
1765 __ jmp(EBX); // Jump to the exception handler code. | 1772 __ jmp(EBX); // Jump to the exception handler code. |
1766 } | 1773 } |
1767 | 1774 |
1768 | 1775 |
1769 // Calls to the runtime to optimize the given function. | 1776 // Calls to the runtime to optimize the given function. |
1770 // EDI: function to be reoptimized. | 1777 // EDI: function to be reoptimized. |
1771 // EDX: argument descriptor (preserved). | 1778 // EDX: argument descriptor (preserved). |
1772 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) { | 1779 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) { |
1773 const Immediate& raw_null = | 1780 const Immediate& raw_null = |
1774 Immediate(reinterpret_cast<intptr_t>(Object::null())); | 1781 Immediate(reinterpret_cast<intptr_t>(Object::null())); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1901 const Register temp = ECX; | 1908 const Register temp = ECX; |
1902 __ movl(left, Address(ESP, 2 * kWordSize)); | 1909 __ movl(left, Address(ESP, 2 * kWordSize)); |
1903 __ movl(right, Address(ESP, 1 * kWordSize)); | 1910 __ movl(right, Address(ESP, 1 * kWordSize)); |
1904 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 1911 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
1905 __ ret(); | 1912 __ ret(); |
1906 } | 1913 } |
1907 | 1914 |
1908 } // namespace dart | 1915 } // namespace dart |
1909 | 1916 |
1910 #endif // defined TARGET_ARCH_IA32 | 1917 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |