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