| 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 // Count the fixups that produce a pointer offset, without processing | 256 // Count the fixups that produce a pointer offset, without processing |
| 257 // the fixups. | 257 // the fixups. |
| 258 intptr_t CountPointerOffsets() const { | 258 intptr_t CountPointerOffsets() const { |
| 259 return buffer_.CountPointerOffsets(); | 259 return buffer_.CountPointerOffsets(); |
| 260 } | 260 } |
| 261 | 261 |
| 262 const ZoneGrowableArray<intptr_t>& GetPointerOffsets() const { | 262 const ZoneGrowableArray<intptr_t>& GetPointerOffsets() const { |
| 263 return buffer_.pointer_offsets(); | 263 return buffer_.pointer_offsets(); |
| 264 } | 264 } |
| 265 | 265 |
| 266 const GrowableObjectArray& object_pool_data() const { | 266 ObjectPoolHelper& object_pool() { return object_pool_; } |
| 267 return object_pool_.data(); | |
| 268 } | |
| 269 | 267 |
| 270 ObjectPool& object_pool() { return object_pool_; } | 268 RawObjectPool* MakeObjectPool() { return object_pool_.MakeObjectPool(); } |
| 271 | 269 |
| 272 void FinalizeInstructions(const MemoryRegion& region) { | 270 void FinalizeInstructions(const MemoryRegion& region) { |
| 273 buffer_.FinalizeInstructions(region); | 271 buffer_.FinalizeInstructions(region); |
| 274 } | 272 } |
| 275 | 273 |
| 276 bool use_far_branches() const { | 274 bool use_far_branches() const { |
| 277 return FLAG_use_far_branches || use_far_branches_; | 275 return FLAG_use_far_branches || use_far_branches_; |
| 278 } | 276 } |
| 279 | 277 |
| 280 void set_use_far_branches(bool b) { | 278 void set_use_far_branches(bool b) { |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 921 } | 919 } |
| 922 | 920 |
| 923 void BranchLink(const ExternalLabel* label) { | 921 void BranchLink(const ExternalLabel* label) { |
| 924 ASSERT(!in_delay_slot_); | 922 ASSERT(!in_delay_slot_); |
| 925 LoadImmediate(T9, label->address()); | 923 LoadImmediate(T9, label->address()); |
| 926 jalr(T9); | 924 jalr(T9); |
| 927 } | 925 } |
| 928 | 926 |
| 929 void BranchLinkPatchable(const ExternalLabel* label) { | 927 void BranchLinkPatchable(const ExternalLabel* label) { |
| 930 ASSERT(!in_delay_slot_); | 928 ASSERT(!in_delay_slot_); |
| 931 const int32_t offset = Array::element_offset( | 929 const int32_t offset = ObjectPool::element_offset( |
| 932 object_pool_.FindExternalLabel(label, kPatchable)); | 930 object_pool_.FindExternalLabel(label, kPatchable)); |
| 933 LoadWordFromPoolOffset(T9, offset - kHeapObjectTag); | 931 LoadWordFromPoolOffset(T9, offset - kHeapObjectTag); |
| 934 jalr(T9); | 932 jalr(T9); |
| 935 delay_slot_available_ = false; // CodePatcher expects a nop. | 933 delay_slot_available_ = false; // CodePatcher expects a nop. |
| 936 } | 934 } |
| 937 | 935 |
| 938 void Drop(intptr_t stack_elements) { | 936 void Drop(intptr_t stack_elements) { |
| 939 ASSERT(stack_elements >= 0); | 937 ASSERT(stack_elements >= 0); |
| 940 if (stack_elements > 0) { | 938 if (stack_elements > 0) { |
| 941 addiu(SP, SP, Immediate(stack_elements * kWordSize)); | 939 addiu(SP, SP, Immediate(stack_elements * kWordSize)); |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1607 | 1605 |
| 1608 bool allow_constant_pool() const { | 1606 bool allow_constant_pool() const { |
| 1609 return allow_constant_pool_; | 1607 return allow_constant_pool_; |
| 1610 } | 1608 } |
| 1611 void set_allow_constant_pool(bool b) { | 1609 void set_allow_constant_pool(bool b) { |
| 1612 allow_constant_pool_ = b; | 1610 allow_constant_pool_ = b; |
| 1613 } | 1611 } |
| 1614 | 1612 |
| 1615 private: | 1613 private: |
| 1616 AssemblerBuffer buffer_; | 1614 AssemblerBuffer buffer_; |
| 1617 ObjectPool object_pool_; // Objects and patchable jump targets. | 1615 ObjectPoolHelper object_pool_; // Objects and patchable jump targets. |
| 1618 | 1616 |
| 1619 intptr_t prologue_offset_; | 1617 intptr_t prologue_offset_; |
| 1620 | 1618 |
| 1621 bool use_far_branches_; | 1619 bool use_far_branches_; |
| 1622 bool delay_slot_available_; | 1620 bool delay_slot_available_; |
| 1623 bool in_delay_slot_; | 1621 bool in_delay_slot_; |
| 1624 | 1622 |
| 1625 class CodeComment : public ZoneAllocated { | 1623 class CodeComment : public ZoneAllocated { |
| 1626 public: | 1624 public: |
| 1627 CodeComment(intptr_t pc_offset, const String& comment) | 1625 CodeComment(intptr_t pc_offset, const String& comment) |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1740 Register value, | 1738 Register value, |
| 1741 Label* no_update); | 1739 Label* no_update); |
| 1742 | 1740 |
| 1743 DISALLOW_ALLOCATION(); | 1741 DISALLOW_ALLOCATION(); |
| 1744 DISALLOW_COPY_AND_ASSIGN(Assembler); | 1742 DISALLOW_COPY_AND_ASSIGN(Assembler); |
| 1745 }; | 1743 }; |
| 1746 | 1744 |
| 1747 } // namespace dart | 1745 } // namespace dart |
| 1748 | 1746 |
| 1749 #endif // VM_ASSEMBLER_MIPS_H_ | 1747 #endif // VM_ASSEMBLER_MIPS_H_ |
| OLD | NEW |