OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_ARM64_ASSEMBLER_ARM64_H_ | 5 #ifndef V8_ARM64_ASSEMBLER_ARM64_H_ |
6 #define V8_ARM64_ASSEMBLER_ARM64_H_ | 6 #define V8_ARM64_ASSEMBLER_ARM64_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 // RelocInfo and pools ------------------------------------------------------ | 864 // RelocInfo and pools ------------------------------------------------------ |
865 | 865 |
866 // Record relocation information for current pc_. | 866 // Record relocation information for current pc_. |
867 void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0); | 867 void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0); |
868 | 868 |
869 // Return the address in the constant pool of the code target address used by | 869 // Return the address in the constant pool of the code target address used by |
870 // the branch/call instruction at pc. | 870 // the branch/call instruction at pc. |
871 inline static Address target_pointer_address_at(Address pc); | 871 inline static Address target_pointer_address_at(Address pc); |
872 | 872 |
873 // Read/Modify the code target address in the branch/call instruction at pc. | 873 // Read/Modify the code target address in the branch/call instruction at pc. |
874 inline static Address target_address_at(Address pc, Address constant_pool); | 874 inline static Address target_address_at(Address pc, |
875 inline static void set_target_address_at( | 875 ConstantPoolArray* constant_pool); |
876 Address pc, Address constant_pool, Address target, | 876 inline static void set_target_address_at(Address pc, |
877 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED); | 877 ConstantPoolArray* constant_pool, |
| 878 Address target, |
| 879 ICacheFlushMode icache_flush_mode = |
| 880 FLUSH_ICACHE_IF_NEEDED); |
878 static inline Address target_address_at(Address pc, Code* code); | 881 static inline Address target_address_at(Address pc, Code* code); |
879 static inline void set_target_address_at(Address pc, | 882 static inline void set_target_address_at(Address pc, |
880 Code* code, | 883 Code* code, |
881 Address target, | 884 Address target, |
882 ICacheFlushMode icache_flush_mode = | 885 ICacheFlushMode icache_flush_mode = |
883 FLUSH_ICACHE_IF_NEEDED); | 886 FLUSH_ICACHE_IF_NEEDED); |
884 | 887 |
885 // Return the code target address at a call site from the return address of | 888 // Return the code target address at a call site from the return address of |
886 // that call in the instruction stream. | 889 // that call in the instruction stream. |
887 inline static Address target_address_from_return_address(Address pc); | 890 inline static Address target_address_from_return_address(Address pc); |
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1757 void EmitStringData(const char* string); | 1760 void EmitStringData(const char* string); |
1758 | 1761 |
1759 // Pseudo-instructions ------------------------------------------------------ | 1762 // Pseudo-instructions ------------------------------------------------------ |
1760 | 1763 |
1761 // Parameters are described in arm64/instructions-arm64.h. | 1764 // Parameters are described in arm64/instructions-arm64.h. |
1762 void debug(const char* message, uint32_t code, Instr params = BREAK); | 1765 void debug(const char* message, uint32_t code, Instr params = BREAK); |
1763 | 1766 |
1764 // Required by V8. | 1767 // Required by V8. |
1765 void dd(uint32_t data) { dc32(data); } | 1768 void dd(uint32_t data) { dc32(data); } |
1766 void db(uint8_t data) { dc8(data); } | 1769 void db(uint8_t data) { dc8(data); } |
1767 void dq(uint64_t data) { dc64(data); } | |
1768 void dp(uintptr_t data) { dc64(data); } | |
1769 | 1770 |
1770 // Code generation helpers -------------------------------------------------- | 1771 // Code generation helpers -------------------------------------------------- |
1771 | 1772 |
1772 bool IsConstPoolEmpty() const { return constpool_.IsEmpty(); } | 1773 bool IsConstPoolEmpty() const { return constpool_.IsEmpty(); } |
1773 | 1774 |
1774 Instruction* pc() const { return Instruction::Cast(pc_); } | 1775 Instruction* pc() const { return Instruction::Cast(pc_); } |
1775 | 1776 |
1776 Instruction* InstructionAt(ptrdiff_t offset) const { | 1777 Instruction* InstructionAt(ptrdiff_t offset) const { |
1777 return reinterpret_cast<Instruction*>(buffer_ + offset); | 1778 return reinterpret_cast<Instruction*>(buffer_ + offset); |
1778 } | 1779 } |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1901 | 1902 |
1902 private: | 1903 private: |
1903 Assembler* assem_; | 1904 Assembler* assem_; |
1904 | 1905 |
1905 DISALLOW_IMPLICIT_CONSTRUCTORS(BlockConstPoolScope); | 1906 DISALLOW_IMPLICIT_CONSTRUCTORS(BlockConstPoolScope); |
1906 }; | 1907 }; |
1907 | 1908 |
1908 // Check if is time to emit a constant pool. | 1909 // Check if is time to emit a constant pool. |
1909 void CheckConstPool(bool force_emit, bool require_jump); | 1910 void CheckConstPool(bool force_emit, bool require_jump); |
1910 | 1911 |
1911 void PatchConstantPoolAccessInstruction(int pc_offset, int offset, | 1912 // Allocate a constant pool of the correct size for the generated code. |
1912 ConstantPoolEntry::Access access, | 1913 Handle<ConstantPoolArray> NewConstantPool(Isolate* isolate); |
1913 ConstantPoolEntry::Type type) { | 1914 |
1914 // No embedded constant pool support. | 1915 // Generate the constant pool for the generated code. |
1915 UNREACHABLE(); | 1916 void PopulateConstantPool(ConstantPoolArray* constant_pool); |
1916 } | |
1917 | 1917 |
1918 // Returns true if we should emit a veneer as soon as possible for a branch | 1918 // Returns true if we should emit a veneer as soon as possible for a branch |
1919 // which can at most reach to specified pc. | 1919 // which can at most reach to specified pc. |
1920 bool ShouldEmitVeneer(int max_reachable_pc, | 1920 bool ShouldEmitVeneer(int max_reachable_pc, |
1921 int margin = kVeneerDistanceMargin); | 1921 int margin = kVeneerDistanceMargin); |
1922 bool ShouldEmitVeneers(int margin = kVeneerDistanceMargin) { | 1922 bool ShouldEmitVeneers(int margin = kVeneerDistanceMargin) { |
1923 return ShouldEmitVeneer(unresolved_branches_first_limit(), margin); | 1923 return ShouldEmitVeneer(unresolved_branches_first_limit(), margin); |
1924 } | 1924 } |
1925 | 1925 |
1926 // The maximum code size generated for a veneer. Currently one branch | 1926 // The maximum code size generated for a veneer. Currently one branch |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2320 class EnsureSpace BASE_EMBEDDED { | 2320 class EnsureSpace BASE_EMBEDDED { |
2321 public: | 2321 public: |
2322 explicit EnsureSpace(Assembler* assembler) { | 2322 explicit EnsureSpace(Assembler* assembler) { |
2323 assembler->CheckBufferSpace(); | 2323 assembler->CheckBufferSpace(); |
2324 } | 2324 } |
2325 }; | 2325 }; |
2326 | 2326 |
2327 } } // namespace v8::internal | 2327 } } // namespace v8::internal |
2328 | 2328 |
2329 #endif // V8_ARM64_ASSEMBLER_ARM64_H_ | 2329 #endif // V8_ARM64_ASSEMBLER_ARM64_H_ |
OLD | NEW |