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_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 instr3->SetImmInstrBits(LW, SP, PP, 0 * kWordSize); | 79 instr3->SetImmInstrBits(LW, SP, PP, 0 * kWordSize); |
88 instr4->SetSpecialInstrBits(JR, RA, ZR, ZR); | 80 instr4->SetSpecialInstrBits(JR, RA, ZR, ZR); |
89 instr5->SetImmInstrBits(ADDIU, SP, SP, 4 * kWordSize); | 81 instr5->SetImmInstrBits(ADDIU, SP, SP, 4 * kWordSize); |
90 | 82 |
91 CPU::FlushICache(pc_ - 5 * Instr::kInstrSize, 5 * Instr::kInstrSize); | 83 CPU::FlushICache(pc_ - 5 * Instr::kInstrSize, 5 * Instr::kInstrSize); |
92 } | 84 } |
93 | 85 |
94 } // namespace dart | 86 } // namespace dart |
95 | 87 |
96 #endif // defined TARGET_ARCH_MIPS | 88 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |