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_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
7 | 7 |
8 #include "vm/debugger.h" | 8 #include "vm/debugger.h" |
9 | 9 |
10 #include "vm/code_patcher.h" | 10 #include "vm/code_patcher.h" |
11 #include "vm/cpu.h" | 11 #include "vm/cpu.h" |
12 #include "vm/disassembler.h" | 12 #include "vm/disassembler.h" |
13 #include "vm/object.h" | 13 #include "vm/object.h" |
14 #include "vm/os.h" | 14 #include "vm/os.h" |
15 #include "vm/stack_frame.h" | 15 #include "vm/stack_frame.h" |
16 #include "vm/stub_code.h" | 16 #include "vm/stub_code.h" |
17 | 17 |
18 namespace dart { | 18 namespace dart { |
19 | 19 |
20 // TODO(hausner): Handle captured variables. | |
21 RawInstance* ActivationFrame::GetLocalVarValue(intptr_t slot_index) { | |
22 uword var_address = fp() + slot_index * kWordSize; | |
23 return reinterpret_cast<RawInstance*>( | |
24 *reinterpret_cast<uword*>(var_address)); | |
25 } | |
26 | |
27 | |
28 RawInstance* ActivationFrame::GetInstanceCallReceiver( | 20 RawInstance* ActivationFrame::GetInstanceCallReceiver( |
29 intptr_t num_actual_args) { | 21 intptr_t num_actual_args) { |
30 ASSERT(num_actual_args > 0); // At minimum we have a receiver on the stack. | 22 ASSERT(num_actual_args > 0); // At minimum we have a receiver on the stack. |
31 // Stack pointer points to last argument that was pushed on the stack. | 23 // Stack pointer points to last argument that was pushed on the stack. |
32 uword receiver_addr = sp() + ((num_actual_args - 1) * kWordSize); | 24 uword receiver_addr = sp() + ((num_actual_args - 1) * kWordSize); |
33 return reinterpret_cast<RawInstance*>( | 25 return reinterpret_cast<RawInstance*>( |
34 *reinterpret_cast<uword*>(receiver_addr)); | 26 *reinterpret_cast<uword*>(receiver_addr)); |
35 } | 27 } |
36 | 28 |
37 | 29 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 code[3] = 0xC3; // ret | 61 code[3] = 0xC3; // ret |
70 code[4] = 0x90; // nop | 62 code[4] = 0x90; // nop |
71 CPU::FlushICache(pc_ - 5, 5); | 63 CPU::FlushICache(pc_ - 5, 5); |
72 } | 64 } |
73 | 65 |
74 | 66 |
75 | 67 |
76 } // namespace dart | 68 } // namespace dart |
77 | 69 |
78 #endif // defined TARGET_ARCH_IA32 | 70 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |