| 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 RUNTIME_VM_ASSEMBLER_MIPS_H_ | 5 #ifndef RUNTIME_VM_ASSEMBLER_MIPS_H_ |
| 6 #define RUNTIME_VM_ASSEMBLER_MIPS_H_ | 6 #define RUNTIME_VM_ASSEMBLER_MIPS_H_ |
| 7 | 7 |
| 8 #ifndef RUNTIME_VM_ASSEMBLER_H_ | 8 #ifndef RUNTIME_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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 | 232 |
| 233 uword bits_; | 233 uword bits_; |
| 234 }; | 234 }; |
| 235 | 235 |
| 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 has_single_entry_point_(true), |
| 242 use_far_branches_(use_far_branches), | 243 use_far_branches_(use_far_branches), |
| 243 delay_slot_available_(false), | 244 delay_slot_available_(false), |
| 244 in_delay_slot_(false), | 245 in_delay_slot_(false), |
| 245 comments_(), | 246 comments_(), |
| 246 constant_pool_allowed_(true) { | 247 constant_pool_allowed_(true) { |
| 247 MonomorphicCheckedEntry(); | |
| 248 } | 248 } |
| 249 ~Assembler() { } | 249 ~Assembler() { } |
| 250 | 250 |
| 251 void PopRegister(Register r) { Pop(r); } | 251 void PopRegister(Register r) { Pop(r); } |
| 252 | 252 |
| 253 void Bind(Label* label); | 253 void Bind(Label* label); |
| 254 void Jump(Label* label) { b(label); } | 254 void Jump(Label* label) { b(label); } |
| 255 | 255 |
| 256 // Misc. functionality | 256 // Misc. functionality |
| 257 intptr_t CodeSize() const { return buffer_.Size(); } | 257 intptr_t CodeSize() const { return buffer_.Size(); } |
| 258 intptr_t prologue_offset() const { return prologue_offset_; } | 258 intptr_t prologue_offset() const { return prologue_offset_; } |
| 259 bool has_single_entry_point() const { return has_single_entry_point_; } |
| 259 | 260 |
| 260 // Count the fixups that produce a pointer offset, without processing | 261 // Count the fixups that produce a pointer offset, without processing |
| 261 // the fixups. | 262 // the fixups. |
| 262 intptr_t CountPointerOffsets() const { | 263 intptr_t CountPointerOffsets() const { |
| 263 return buffer_.CountPointerOffsets(); | 264 return buffer_.CountPointerOffsets(); |
| 264 } | 265 } |
| 265 | 266 |
| 266 const ZoneGrowableArray<intptr_t>& GetPointerOffsets() const { | 267 const ZoneGrowableArray<intptr_t>& GetPointerOffsets() const { |
| 267 return buffer_.pointer_offsets(); | 268 return buffer_.pointer_offsets(); |
| 268 } | 269 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 289 void LeaveFrameAndReturn(); | 290 void LeaveFrameAndReturn(); |
| 290 | 291 |
| 291 // Set up a stub frame so that the stack traversal code can easily identify | 292 // Set up a stub frame so that the stack traversal code can easily identify |
| 292 // a stub frame. | 293 // a stub frame. |
| 293 void EnterStubFrame(intptr_t frame_size = 0); | 294 void EnterStubFrame(intptr_t frame_size = 0); |
| 294 void LeaveStubFrame(); | 295 void LeaveStubFrame(); |
| 295 // A separate macro for when a Ret immediately follows, so that we can use | 296 // A separate macro for when a Ret immediately follows, so that we can use |
| 296 // the branch delay slot. | 297 // the branch delay slot. |
| 297 void LeaveStubFrameAndReturn(Register ra = RA); | 298 void LeaveStubFrameAndReturn(Register ra = RA); |
| 298 | 299 |
| 299 void NoMonomorphicCheckedEntry(); | |
| 300 void MonomorphicCheckedEntry(); | 300 void MonomorphicCheckedEntry(); |
| 301 | 301 |
| 302 void UpdateAllocationStats(intptr_t cid, | 302 void UpdateAllocationStats(intptr_t cid, |
| 303 Register temp_reg, | 303 Register temp_reg, |
| 304 Heap::Space space); | 304 Heap::Space space); |
| 305 | 305 |
| 306 void UpdateAllocationStatsWithSize(intptr_t cid, | 306 void UpdateAllocationStatsWithSize(intptr_t cid, |
| 307 Register size_reg, | 307 Register size_reg, |
| 308 Register temp_reg, | 308 Register temp_reg, |
| 309 Heap::Space space); | 309 Heap::Space space); |
| (...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1639 } | 1639 } |
| 1640 void set_constant_pool_allowed(bool b) { | 1640 void set_constant_pool_allowed(bool b) { |
| 1641 constant_pool_allowed_ = b; | 1641 constant_pool_allowed_ = b; |
| 1642 } | 1642 } |
| 1643 | 1643 |
| 1644 private: | 1644 private: |
| 1645 AssemblerBuffer buffer_; | 1645 AssemblerBuffer buffer_; |
| 1646 ObjectPoolWrapper object_pool_wrapper_; | 1646 ObjectPoolWrapper object_pool_wrapper_; |
| 1647 | 1647 |
| 1648 intptr_t prologue_offset_; | 1648 intptr_t prologue_offset_; |
| 1649 | 1649 bool has_single_entry_point_; |
| 1650 bool use_far_branches_; | 1650 bool use_far_branches_; |
| 1651 bool delay_slot_available_; | 1651 bool delay_slot_available_; |
| 1652 bool in_delay_slot_; | 1652 bool in_delay_slot_; |
| 1653 | 1653 |
| 1654 class CodeComment : public ZoneAllocated { | 1654 class CodeComment : public ZoneAllocated { |
| 1655 public: | 1655 public: |
| 1656 CodeComment(intptr_t pc_offset, const String& comment) | 1656 CodeComment(intptr_t pc_offset, const String& comment) |
| 1657 : pc_offset_(pc_offset), comment_(comment) { } | 1657 : pc_offset_(pc_offset), comment_(comment) { } |
| 1658 | 1658 |
| 1659 intptr_t pc_offset() const { return pc_offset_; } | 1659 intptr_t pc_offset() const { return pc_offset_; } |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1777 Register value, | 1777 Register value, |
| 1778 Label* no_update); | 1778 Label* no_update); |
| 1779 | 1779 |
| 1780 DISALLOW_ALLOCATION(); | 1780 DISALLOW_ALLOCATION(); |
| 1781 DISALLOW_COPY_AND_ASSIGN(Assembler); | 1781 DISALLOW_COPY_AND_ASSIGN(Assembler); |
| 1782 }; | 1782 }; |
| 1783 | 1783 |
| 1784 } // namespace dart | 1784 } // namespace dart |
| 1785 | 1785 |
| 1786 #endif // RUNTIME_VM_ASSEMBLER_MIPS_H_ | 1786 #endif // RUNTIME_VM_ASSEMBLER_MIPS_H_ |
| OLD | NEW |