| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/cpu.h" | 8 #include "vm/cpu.h" |
| 9 #include "vm/debugger.h" | 9 #include "vm/debugger.h" |
| 10 #include "vm/instructions.h" | 10 #include "vm/instructions.h" |
| 11 #include "vm/stub_code.h" | 11 #include "vm/stub_code.h" |
| 12 | 12 |
| 13 namespace dart { | 13 namespace dart { |
| 14 | 14 |
| 15 // TODO(hausner): Handle captured variables. | |
| 16 RawInstance* ActivationFrame::GetLocalVarValue(intptr_t slot_index) { | |
| 17 uword var_address = fp() + slot_index * kWordSize; | |
| 18 return reinterpret_cast<RawInstance*>( | |
| 19 *reinterpret_cast<uword*>(var_address)); | |
| 20 } | |
| 21 | |
| 22 | |
| 23 RawInstance* ActivationFrame::GetInstanceCallReceiver( | 15 RawInstance* ActivationFrame::GetInstanceCallReceiver( |
| 24 intptr_t num_actual_args) { | 16 intptr_t num_actual_args) { |
| 25 ASSERT(num_actual_args > 0); // At minimum we have a receiver on the stack. | 17 ASSERT(num_actual_args > 0); // At minimum we have a receiver on the stack. |
| 26 // Stack pointer points to last argument that was pushed on the stack. | 18 // Stack pointer points to last argument that was pushed on the stack. |
| 27 uword receiver_addr = sp() + ((num_actual_args - 1) * kWordSize); | 19 uword receiver_addr = sp() + ((num_actual_args - 1) * kWordSize); |
| 28 return reinterpret_cast<RawInstance*>( | 20 return reinterpret_cast<RawInstance*>( |
| 29 *reinterpret_cast<uword*>(receiver_addr)); | 21 *reinterpret_cast<uword*>(receiver_addr)); |
| 30 } | 22 } |
| 31 | 23 |
| 32 | 24 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 ASSERT((code[0] & 0xfff0f000) == 0xe300c000); | 57 ASSERT((code[0] & 0xfff0f000) == 0xe300c000); |
| 66 code[0] = 0xe8bd4c00; // ldmia sp!, {pp, fp, lr} | 58 code[0] = 0xe8bd4c00; // ldmia sp!, {pp, fp, lr} |
| 67 code[1] = 0xe28dd004; // add sp, sp, #4 | 59 code[1] = 0xe28dd004; // add sp, sp, #4 |
| 68 code[2] = 0xe12fff1e; // bx lr | 60 code[2] = 0xe12fff1e; // bx lr |
| 69 CPU::FlushICache(pc_ - 3 * Instr::kInstrSize, 3 * Instr::kInstrSize); | 61 CPU::FlushICache(pc_ - 3 * Instr::kInstrSize, 3 * Instr::kInstrSize); |
| 70 } | 62 } |
| 71 | 63 |
| 72 } // namespace dart | 64 } // namespace dart |
| 73 | 65 |
| 74 #endif // defined TARGET_ARCH_ARM | 66 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |