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_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
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/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 1694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1705 __ Ret(); | 1705 __ Ret(); |
1706 } | 1706 } |
1707 | 1707 |
1708 | 1708 |
1709 // Jump to the exception or error handler. | 1709 // Jump to the exception or error handler. |
1710 // LR: return address. | 1710 // LR: return address. |
1711 // R0: program_counter. | 1711 // R0: program_counter. |
1712 // R1: stack_pointer. | 1712 // R1: stack_pointer. |
1713 // R2: frame_pointer. | 1713 // R2: frame_pointer. |
1714 // R3: error object. | 1714 // R3: error object. |
1715 // SP + 0: address of stacktrace object. | 1715 // SP: address of stacktrace object. |
1716 // SP + 4: isolate | |
1717 // Does not return. | 1716 // Does not return. |
1718 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) { | 1717 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) { |
1719 ASSERT(kExceptionObjectReg == R0); | 1718 ASSERT(kExceptionObjectReg == R0); |
1720 ASSERT(kStackTraceObjectReg == R1); | 1719 ASSERT(kStackTraceObjectReg == R1); |
1721 __ mov(IP, Operand(R1)); // Copy Stack pointer into IP. | 1720 __ mov(IP, Operand(R1)); // Stack pointer. |
1722 __ mov(LR, Operand(R0)); // Program counter. | 1721 __ mov(LR, Operand(R0)); // Program counter. |
1723 __ mov(R0, Operand(R3)); // Exception object. | 1722 __ mov(R0, Operand(R3)); // Exception object. |
1724 __ ldr(R1, Address(SP, 0)); // StackTrace object. | 1723 __ ldr(R1, Address(SP, 0)); // StackTrace object. |
1725 __ ldr(R3, Address(SP, 4)); // Isolate. | |
1726 __ mov(FP, Operand(R2)); // Frame_pointer. | 1724 __ mov(FP, Operand(R2)); // Frame_pointer. |
1727 __ mov(SP, Operand(IP)); // Set Stack pointer. | 1725 __ mov(SP, Operand(IP)); // Stack pointer. |
1728 // Set the tag. | |
1729 __ LoadImmediate(R2, VMTag::kScriptTagId); | |
1730 __ StoreToOffset(kWord, R2, R3, Isolate::vm_tag_offset()); | |
1731 // Clear top exit frame. | |
1732 __ LoadImmediate(R2, 0); | |
1733 __ StoreToOffset(kWord, R2, R3, Isolate::top_exit_frame_info_offset()); | |
1734 __ bx(LR); // Jump to the exception handler code. | 1726 __ bx(LR); // Jump to the exception handler code. |
1735 } | 1727 } |
1736 | 1728 |
1737 | 1729 |
1738 // Calls to the runtime to optimize the given function. | 1730 // Calls to the runtime to optimize the given function. |
1739 // R6: function to be reoptimized. | 1731 // R6: function to be reoptimized. |
1740 // R4: argument descriptor (preserved). | 1732 // R4: argument descriptor (preserved). |
1741 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) { | 1733 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) { |
1742 __ EnterStubFrame(); | 1734 __ EnterStubFrame(); |
1743 __ Push(R4); | 1735 __ Push(R4); |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1872 const Register right = R0; | 1864 const Register right = R0; |
1873 __ ldr(left, Address(SP, 1 * kWordSize)); | 1865 __ ldr(left, Address(SP, 1 * kWordSize)); |
1874 __ ldr(right, Address(SP, 0 * kWordSize)); | 1866 __ ldr(right, Address(SP, 0 * kWordSize)); |
1875 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 1867 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
1876 __ Ret(); | 1868 __ Ret(); |
1877 } | 1869 } |
1878 | 1870 |
1879 } // namespace dart | 1871 } // namespace dart |
1880 | 1872 |
1881 #endif // defined TARGET_ARCH_ARM | 1873 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |