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_X64) | 6 #if defined(TARGET_ARCH_X64) |
7 | 7 |
8 #include "vm/debugger.h" | 8 #include "vm/debugger.h" |
9 | 9 |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.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): Implement this. For now just return null instead | 15 // TODO(hausner): Handle captured variables. |
16 // of hitting UNIMPLEMENTED. | |
17 RawInstance* ActivationFrame::GetLocalVarValue(intptr_t slot_index) { | 16 RawInstance* ActivationFrame::GetLocalVarValue(intptr_t slot_index) { |
18 return Instance::null(); | 17 uword var_address = fp() + slot_index * kWordSize; |
| 18 return reinterpret_cast<RawInstance*>( |
| 19 *reinterpret_cast<uword*>(var_address)); |
19 } | 20 } |
20 | 21 |
21 | 22 |
22 RawInstance* ActivationFrame::GetInstanceCallReceiver( | 23 RawInstance* ActivationFrame::GetInstanceCallReceiver( |
23 intptr_t num_actual_args) { | 24 intptr_t num_actual_args) { |
24 ASSERT(num_actual_args > 0); // At minimum we have a receiver on the stack. | 25 ASSERT(num_actual_args > 0); // At minimum we have a receiver on the stack. |
25 // Stack pointer points to last argument that was pushed on the stack. | 26 // Stack pointer points to last argument that was pushed on the stack. |
26 uword receiver_addr = sp() + ((num_actual_args - 1) * kWordSize); | 27 uword receiver_addr = sp() + ((num_actual_args - 1) * kWordSize); |
27 return reinterpret_cast<RawInstance*>( | 28 return reinterpret_cast<RawInstance*>( |
28 *reinterpret_cast<uword*>(receiver_addr)); | 29 *reinterpret_cast<uword*>(receiver_addr)); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 code[9] = 0x90; // nop | 68 code[9] = 0x90; // nop |
68 code[10] = 0x90; // nop | 69 code[10] = 0x90; // nop |
69 code[11] = 0x90; // nop | 70 code[11] = 0x90; // nop |
70 code[12] = 0x90; // nop | 71 code[12] = 0x90; // nop |
71 CPU::FlushICache(pc_, 5); | 72 CPU::FlushICache(pc_, 5); |
72 } | 73 } |
73 | 74 |
74 } // namespace dart | 75 } // namespace dart |
75 | 76 |
76 #endif // defined TARGET_ARCH_X64 | 77 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |