Chromium Code Reviews| 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_ARM_H_ | 5 #ifndef VM_ASSEMBLER_ARM_H_ |
| 6 #define VM_ASSEMBLER_ARM_H_ | 6 #define VM_ASSEMBLER_ARM_H_ |
| 7 | 7 |
| 8 #ifndef VM_ASSEMBLER_H_ | 8 #ifndef VM_ASSEMBLER_H_ |
| 9 #error Do not include assembler_arm.h directly; use assembler.h instead. | 9 #error Do not include assembler_arm.h directly; use assembler.h instead. |
| 10 #endif | 10 #endif |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 316 const ZoneGrowableArray<intptr_t>& GetPointerOffsets() const { | 316 const ZoneGrowableArray<intptr_t>& GetPointerOffsets() const { |
| 317 ASSERT(buffer_.pointer_offsets().length() == 0); // No pointers in code. | 317 ASSERT(buffer_.pointer_offsets().length() == 0); // No pointers in code. |
| 318 return buffer_.pointer_offsets(); | 318 return buffer_.pointer_offsets(); |
| 319 } | 319 } |
| 320 const GrowableObjectArray& object_pool() const { return object_pool_; } | 320 const GrowableObjectArray& object_pool() const { return object_pool_; } |
| 321 | 321 |
| 322 bool use_far_branches() const { | 322 bool use_far_branches() const { |
| 323 return FLAG_use_far_branches || use_far_branches_; | 323 return FLAG_use_far_branches || use_far_branches_; |
| 324 } | 324 } |
| 325 | 325 |
| 326 void set_use_far_branches(bool b) { | |
|
srdjan
2013/12/10 18:02:25
Add comment: to be used by tests only. It is quit
| |
| 327 ASSERT(buffer_.Size() == 0); | |
| 328 use_far_branches_ = b; | |
| 329 } | |
| 330 | |
| 326 void FinalizeInstructions(const MemoryRegion& region) { | 331 void FinalizeInstructions(const MemoryRegion& region) { |
| 327 buffer_.FinalizeInstructions(region); | 332 buffer_.FinalizeInstructions(region); |
| 328 } | 333 } |
| 329 | 334 |
| 330 // Debugging and bringup support. | 335 // Debugging and bringup support. |
| 331 void Stop(const char* message); | 336 void Stop(const char* message); |
| 332 void Unimplemented(const char* message); | 337 void Unimplemented(const char* message); |
| 333 void Untested(const char* message); | 338 void Untested(const char* message); |
| 334 void Unreachable(const char* message); | 339 void Unreachable(const char* message); |
| 335 | 340 |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 743 // On some other platforms, we draw a distinction between safe and unsafe | 748 // On some other platforms, we draw a distinction between safe and unsafe |
| 744 // smis. | 749 // smis. |
| 745 static bool IsSafe(const Object& object) { return true; } | 750 static bool IsSafe(const Object& object) { return true; } |
| 746 static bool IsSafeSmi(const Object& object) { return object.IsSmi(); } | 751 static bool IsSafeSmi(const Object& object) { return object.IsSmi(); } |
| 747 | 752 |
| 748 private: | 753 private: |
| 749 AssemblerBuffer buffer_; // Contains position independent code. | 754 AssemblerBuffer buffer_; // Contains position independent code. |
| 750 GrowableObjectArray& object_pool_; // Objects and patchable jump targets. | 755 GrowableObjectArray& object_pool_; // Objects and patchable jump targets. |
| 751 int32_t prologue_offset_; | 756 int32_t prologue_offset_; |
| 752 | 757 |
| 753 const bool use_far_branches_; | 758 bool use_far_branches_; |
| 754 | 759 |
| 755 int32_t AddObject(const Object& obj); | 760 int32_t AddObject(const Object& obj); |
| 756 int32_t AddExternalLabel(const ExternalLabel* label); | 761 int32_t AddExternalLabel(const ExternalLabel* label); |
| 757 | 762 |
| 758 class CodeComment : public ZoneAllocated { | 763 class CodeComment : public ZoneAllocated { |
| 759 public: | 764 public: |
| 760 CodeComment(intptr_t pc_offset, const String& comment) | 765 CodeComment(intptr_t pc_offset, const String& comment) |
| 761 : pc_offset_(pc_offset), comment_(comment) { } | 766 : pc_offset_(pc_offset), comment_(comment) { } |
| 762 | 767 |
| 763 intptr_t pc_offset() const { return pc_offset_; } | 768 intptr_t pc_offset() const { return pc_offset_; } |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 880 Register value, | 885 Register value, |
| 881 Label* no_update); | 886 Label* no_update); |
| 882 | 887 |
| 883 DISALLOW_ALLOCATION(); | 888 DISALLOW_ALLOCATION(); |
| 884 DISALLOW_COPY_AND_ASSIGN(Assembler); | 889 DISALLOW_COPY_AND_ASSIGN(Assembler); |
| 885 }; | 890 }; |
| 886 | 891 |
| 887 } // namespace dart | 892 } // namespace dart |
| 888 | 893 |
| 889 #endif // VM_ASSEMBLER_ARM_H_ | 894 #endif // VM_ASSEMBLER_ARM_H_ |
| OLD | NEW |