| 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 | 236 |
| 237 class Assembler : public ValueObject { | 237 class Assembler : public ValueObject { |
| 238 public: | 238 public: |
| 239 explicit Assembler(bool use_far_branches = false) | 239 explicit Assembler(bool use_far_branches = false) |
| 240 : buffer_(), | 240 : buffer_(), |
| 241 prologue_offset_(-1), | 241 prologue_offset_(-1), |
| 242 use_far_branches_(use_far_branches), | 242 use_far_branches_(use_far_branches), |
| 243 delay_slot_available_(false), | 243 delay_slot_available_(false), |
| 244 in_delay_slot_(false), | 244 in_delay_slot_(false), |
| 245 comments_(), | 245 comments_(), |
| 246 constant_pool_allowed_(true) { } | 246 constant_pool_allowed_(true) { |
| 247 MonomorphicCheckedEntry(); |
| 248 } |
| 247 ~Assembler() { } | 249 ~Assembler() { } |
| 248 | 250 |
| 249 void PopRegister(Register r) { Pop(r); } | 251 void PopRegister(Register r) { Pop(r); } |
| 250 | 252 |
| 251 void Bind(Label* label); | 253 void Bind(Label* label); |
| 252 void Jump(Label* label) { b(label); } | 254 void Jump(Label* label) { b(label); } |
| 253 | 255 |
| 254 // Misc. functionality | 256 // Misc. functionality |
| 255 intptr_t CodeSize() const { return buffer_.Size(); } | 257 intptr_t CodeSize() const { return buffer_.Size(); } |
| 256 intptr_t prologue_offset() const { return prologue_offset_; } | 258 intptr_t prologue_offset() const { return prologue_offset_; } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 273 | 275 |
| 274 void FinalizeInstructions(const MemoryRegion& region) { | 276 void FinalizeInstructions(const MemoryRegion& region) { |
| 275 buffer_.FinalizeInstructions(region); | 277 buffer_.FinalizeInstructions(region); |
| 276 } | 278 } |
| 277 | 279 |
| 278 bool use_far_branches() const { | 280 bool use_far_branches() const { |
| 279 return FLAG_use_far_branches || use_far_branches_; | 281 return FLAG_use_far_branches || use_far_branches_; |
| 280 } | 282 } |
| 281 | 283 |
| 282 void set_use_far_branches(bool b) { | 284 void set_use_far_branches(bool b) { |
| 283 ASSERT(buffer_.Size() == 0); | |
| 284 use_far_branches_ = b; | 285 use_far_branches_ = b; |
| 285 } | 286 } |
| 286 | 287 |
| 287 void EnterFrame(); | 288 void EnterFrame(); |
| 288 void LeaveFrameAndReturn(); | 289 void LeaveFrameAndReturn(); |
| 289 | 290 |
| 290 // Set up a stub frame so that the stack traversal code can easily identify | 291 // Set up a stub frame so that the stack traversal code can easily identify |
| 291 // a stub frame. | 292 // a stub frame. |
| 292 void EnterStubFrame(intptr_t frame_size = 0); | 293 void EnterStubFrame(intptr_t frame_size = 0); |
| 293 void LeaveStubFrame(); | 294 void LeaveStubFrame(); |
| 294 // A separate macro for when a Ret immediately follows, so that we can use | 295 // A separate macro for when a Ret immediately follows, so that we can use |
| 295 // the branch delay slot. | 296 // the branch delay slot. |
| 296 void LeaveStubFrameAndReturn(Register ra = RA); | 297 void LeaveStubFrameAndReturn(Register ra = RA); |
| 297 | 298 |
| 299 void NoMonomorphicCheckedEntry(); |
| 300 void MonomorphicCheckedEntry(); |
| 301 |
| 298 void UpdateAllocationStats(intptr_t cid, | 302 void UpdateAllocationStats(intptr_t cid, |
| 299 Register temp_reg, | 303 Register temp_reg, |
| 300 Heap::Space space); | 304 Heap::Space space); |
| 301 | 305 |
| 302 void UpdateAllocationStatsWithSize(intptr_t cid, | 306 void UpdateAllocationStatsWithSize(intptr_t cid, |
| 303 Register size_reg, | 307 Register size_reg, |
| 304 Register temp_reg, | 308 Register temp_reg, |
| 305 Heap::Space space); | 309 Heap::Space space); |
| 306 | 310 |
| 307 | 311 |
| (...skipping 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1754 Register value, | 1758 Register value, |
| 1755 Label* no_update); | 1759 Label* no_update); |
| 1756 | 1760 |
| 1757 DISALLOW_ALLOCATION(); | 1761 DISALLOW_ALLOCATION(); |
| 1758 DISALLOW_COPY_AND_ASSIGN(Assembler); | 1762 DISALLOW_COPY_AND_ASSIGN(Assembler); |
| 1759 }; | 1763 }; |
| 1760 | 1764 |
| 1761 } // namespace dart | 1765 } // namespace dart |
| 1762 | 1766 |
| 1763 #endif // VM_ASSEMBLER_MIPS_H_ | 1767 #endif // VM_ASSEMBLER_MIPS_H_ |
| OLD | NEW |