Chromium Code Reviews| 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 1667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1678 __ Ret(); | 1678 __ Ret(); |
| 1679 } | 1679 } |
| 1680 | 1680 |
| 1681 | 1681 |
| 1682 // Jump to the exception or error handler. | 1682 // Jump to the exception or error handler. |
| 1683 // LR: return address. | 1683 // LR: return address. |
| 1684 // R0: program_counter. | 1684 // R0: program_counter. |
| 1685 // R1: stack_pointer. | 1685 // R1: stack_pointer. |
| 1686 // R2: frame_pointer. | 1686 // R2: frame_pointer. |
| 1687 // R3: error object. | 1687 // R3: error object. |
| 1688 // SP: address of stacktrace object. | 1688 // SP + 0: address of stacktrace object. |
| 1689 // SP + 4: isolate | |
| 1689 // Does not return. | 1690 // Does not return. |
| 1690 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) { | 1691 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) { |
| 1691 ASSERT(kExceptionObjectReg == R0); | 1692 ASSERT(kExceptionObjectReg == R0); |
| 1692 ASSERT(kStackTraceObjectReg == R1); | 1693 ASSERT(kStackTraceObjectReg == R1); |
| 1693 __ mov(IP, Operand(R1)); // Stack pointer. | 1694 __ mov(IP, Operand(R1)); // Stack pointer. |
| 1694 __ mov(LR, Operand(R0)); // Program counter. | 1695 __ mov(LR, Operand(R0)); // Program counter. |
| 1695 __ mov(R0, Operand(R3)); // Exception object. | 1696 __ mov(R0, Operand(R3)); // Exception object. |
| 1696 __ ldr(R1, Address(SP, 0)); // StackTrace object. | 1697 __ ldr(R1, Address(SP, 0)); // StackTrace object. |
| 1698 __ ldr(CTX, Address(SP, 4)); // Isolate. | |
|
regis
2014/07/14 20:00:34
Are you sure it is OK to trash the CTX register? I
Cutch
2014/07/14 21:32:07
Done.
| |
| 1697 __ mov(FP, Operand(R2)); // Frame_pointer. | 1699 __ mov(FP, Operand(R2)); // Frame_pointer. |
| 1698 __ mov(SP, Operand(IP)); // Stack pointer. | 1700 __ mov(SP, Operand(IP)); // Stack pointer. |
| 1701 // Set the tag. | |
| 1702 __ LoadImmediate(R2, VMTag::kScriptTagId); | |
| 1703 __ StoreToOffset(kWord, R2, CTX, Isolate::vm_tag_offset()); | |
| 1704 // Clear top exit frame. | |
| 1705 __ LoadImmediate(R2, 0); | |
| 1706 __ StoreToOffset(kWord, R2, CTX, Isolate::top_exit_frame_info_offset()); | |
| 1699 __ bx(LR); // Jump to the exception handler code. | 1707 __ bx(LR); // Jump to the exception handler code. |
| 1700 } | 1708 } |
| 1701 | 1709 |
| 1702 | 1710 |
| 1703 // Calls to the runtime to optimize the given function. | 1711 // Calls to the runtime to optimize the given function. |
| 1704 // R6: function to be reoptimized. | 1712 // R6: function to be reoptimized. |
| 1705 // R4: argument descriptor (preserved). | 1713 // R4: argument descriptor (preserved). |
| 1706 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) { | 1714 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) { |
| 1707 __ EnterStubFrame(); | 1715 __ EnterStubFrame(); |
| 1708 __ Push(R4); | 1716 __ Push(R4); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1837 const Register right = R0; | 1845 const Register right = R0; |
| 1838 __ ldr(left, Address(SP, 1 * kWordSize)); | 1846 __ ldr(left, Address(SP, 1 * kWordSize)); |
| 1839 __ ldr(right, Address(SP, 0 * kWordSize)); | 1847 __ ldr(right, Address(SP, 0 * kWordSize)); |
| 1840 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 1848 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
| 1841 __ Ret(); | 1849 __ Ret(); |
| 1842 } | 1850 } |
| 1843 | 1851 |
| 1844 } // namespace dart | 1852 } // namespace dart |
| 1845 | 1853 |
| 1846 #endif // defined TARGET_ARCH_ARM | 1854 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |