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 #ifndef VM_ASSEMBLER_MIPS_H_ | 5 #ifndef VM_ASSEMBLER_MIPS_H_ |
6 #define VM_ASSEMBLER_MIPS_H_ | 6 #define VM_ASSEMBLER_MIPS_H_ |
7 | 7 |
8 #ifndef VM_ASSEMBLER_H_ | 8 #ifndef VM_ASSEMBLER_H_ |
9 #error Do not include assembler_mips.h directly; use assembler.h instead. | 9 #error Do not include assembler_mips.h directly; use assembler.h instead. |
10 #endif | 10 #endif |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 } | 168 } |
169 const GrowableObjectArray& object_pool() const { return object_pool_; } | 169 const GrowableObjectArray& object_pool() const { return object_pool_; } |
170 void FinalizeInstructions(const MemoryRegion& region) { | 170 void FinalizeInstructions(const MemoryRegion& region) { |
171 buffer_.FinalizeInstructions(region); | 171 buffer_.FinalizeInstructions(region); |
172 } | 172 } |
173 | 173 |
174 bool use_far_branches() const { | 174 bool use_far_branches() const { |
175 return FLAG_use_far_branches || use_far_branches_; | 175 return FLAG_use_far_branches || use_far_branches_; |
176 } | 176 } |
177 | 177 |
| 178 void EnterFrame(); |
| 179 void LeaveFrameAndReturn(); |
| 180 |
178 // Set up a stub frame so that the stack traversal code can easily identify | 181 // Set up a stub frame so that the stack traversal code can easily identify |
179 // a stub frame. | 182 // a stub frame. |
180 void EnterStubFrame(bool uses_pp = false); | 183 void EnterStubFrame(bool load_pp = false); |
181 void LeaveStubFrame(bool uses_pp = false); | 184 void LeaveStubFrame(); |
182 // A separate macro for when a Ret immediately follows, so that we can use | 185 // A separate macro for when a Ret immediately follows, so that we can use |
183 // the branch delay slot. | 186 // the branch delay slot. |
184 void LeaveStubFrameAndReturn(Register ra = RA, bool uses_pp = false); | 187 void LeaveStubFrameAndReturn(Register ra = RA); |
185 | 188 |
186 // Instruction pattern from entrypoint is used in dart frame prologs | 189 // Instruction pattern from entrypoint is used in dart frame prologs |
187 // to set up the frame and save a PC which can be used to figure out the | 190 // to set up the frame and save a PC which can be used to figure out the |
188 // RawInstruction object corresponding to the code running in the frame. | 191 // RawInstruction object corresponding to the code running in the frame. |
189 // See EnterDartFrame. There are 6 instructions before we know the PC. | 192 // See EnterDartFrame. There are 6 instructions before we know the PC. |
190 static const intptr_t kEntryPointToPcMarkerOffset = 6 * Instr::kInstrSize; | 193 static const intptr_t kEntryPointToPcMarkerOffset = 6 * Instr::kInstrSize; |
191 | 194 |
192 // Inlined allocation of an instance of class 'cls', code has no runtime | 195 // Inlined allocation of an instance of class 'cls', code has no runtime |
193 // calls. Jump to 'failure' if the instance cannot be allocated here. | 196 // calls. Jump to 'failure' if the instance cannot be allocated here. |
194 // Allocated instance is returned in 'instance_reg'. | 197 // Allocated instance is returned in 'instance_reg'. |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 delay_slot_available_ = false; // CodePatcher expects a nop. | 799 delay_slot_available_ = false; // CodePatcher expects a nop. |
797 } | 800 } |
798 | 801 |
799 void Drop(intptr_t stack_elements) { | 802 void Drop(intptr_t stack_elements) { |
800 ASSERT(stack_elements >= 0); | 803 ASSERT(stack_elements >= 0); |
801 if (stack_elements > 0) { | 804 if (stack_elements > 0) { |
802 addiu(SP, SP, Immediate(stack_elements * kWordSize)); | 805 addiu(SP, SP, Immediate(stack_elements * kWordSize)); |
803 } | 806 } |
804 } | 807 } |
805 | 808 |
| 809 void LoadPoolPointer() { |
| 810 GetNextPC(TMP); // TMP gets the address of the next instruction. |
| 811 const intptr_t object_pool_pc_dist = |
| 812 Instructions::HeaderSize() - Instructions::object_pool_offset() + |
| 813 CodeSize(); |
| 814 lw(PP, Address(TMP, -object_pool_pc_dist)); |
| 815 } |
| 816 |
806 void LoadImmediate(Register rd, int32_t value) { | 817 void LoadImmediate(Register rd, int32_t value) { |
807 if (Utils::IsInt(kImmBits, value)) { | 818 if (Utils::IsInt(kImmBits, value)) { |
808 addiu(rd, ZR, Immediate(value)); | 819 addiu(rd, ZR, Immediate(value)); |
809 } else { | 820 } else { |
810 const uint16_t low = Utils::Low16Bits(value); | 821 const uint16_t low = Utils::Low16Bits(value); |
811 const uint16_t high = Utils::High16Bits(value); | 822 const uint16_t high = Utils::High16Bits(value); |
812 lui(rd, Immediate(high)); | 823 lui(rd, Immediate(high)); |
813 ori(rd, rd, Immediate(low)); | 824 ori(rd, rd, Immediate(low)); |
814 } | 825 } |
815 } | 826 } |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1275 Register value, | 1286 Register value, |
1276 Label* no_update); | 1287 Label* no_update); |
1277 | 1288 |
1278 DISALLOW_ALLOCATION(); | 1289 DISALLOW_ALLOCATION(); |
1279 DISALLOW_COPY_AND_ASSIGN(Assembler); | 1290 DISALLOW_COPY_AND_ASSIGN(Assembler); |
1280 }; | 1291 }; |
1281 | 1292 |
1282 } // namespace dart | 1293 } // namespace dart |
1283 | 1294 |
1284 #endif // VM_ASSEMBLER_MIPS_H_ | 1295 #endif // VM_ASSEMBLER_MIPS_H_ |
OLD | NEW |