Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: src/arm64/assembler-arm64.h

Issue 1131783003: Embedded constant pools. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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, 874 inline static Address target_address_at(Address pc, Address constant_pool);
875 ConstantPoolArray* constant_pool); 875 inline static void set_target_address_at(
876 inline static void set_target_address_at(Address pc, 876 Address pc, Address constant_pool, Address target,
877 ConstantPoolArray* constant_pool, 877 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED);
878 Address target,
879 ICacheFlushMode icache_flush_mode =
880 FLUSH_ICACHE_IF_NEEDED);
881 static inline Address target_address_at(Address pc, Code* code); 878 static inline Address target_address_at(Address pc, Code* code);
882 static inline void set_target_address_at(Address pc, 879 static inline void set_target_address_at(Address pc,
883 Code* code, 880 Code* code,
884 Address target, 881 Address target,
885 ICacheFlushMode icache_flush_mode = 882 ICacheFlushMode icache_flush_mode =
886 FLUSH_ICACHE_IF_NEEDED); 883 FLUSH_ICACHE_IF_NEEDED);
887 884
888 // Return the code target address at a call site from the return address of 885 // Return the code target address at a call site from the return address of
889 // that call in the instruction stream. 886 // that call in the instruction stream.
890 inline static Address target_address_from_return_address(Address pc); 887 inline static Address target_address_from_return_address(Address pc);
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
1760 void EmitStringData(const char* string); 1757 void EmitStringData(const char* string);
1761 1758
1762 // Pseudo-instructions ------------------------------------------------------ 1759 // Pseudo-instructions ------------------------------------------------------
1763 1760
1764 // Parameters are described in arm64/instructions-arm64.h. 1761 // Parameters are described in arm64/instructions-arm64.h.
1765 void debug(const char* message, uint32_t code, Instr params = BREAK); 1762 void debug(const char* message, uint32_t code, Instr params = BREAK);
1766 1763
1767 // Required by V8. 1764 // Required by V8.
1768 void dd(uint32_t data) { dc32(data); } 1765 void dd(uint32_t data) { dc32(data); }
1769 void db(uint8_t data) { dc8(data); } 1766 void db(uint8_t data) { dc8(data); }
1767 void dq(uint64_t data) { dc64(data); }
1768 void dp(uintptr_t data) { dc64(data); }
1770 1769
1771 // Code generation helpers -------------------------------------------------- 1770 // Code generation helpers --------------------------------------------------
1772 1771
1773 bool IsConstPoolEmpty() const { return constpool_.IsEmpty(); } 1772 bool IsConstPoolEmpty() const { return constpool_.IsEmpty(); }
1774 1773
1775 Instruction* pc() const { return Instruction::Cast(pc_); } 1774 Instruction* pc() const { return Instruction::Cast(pc_); }
1776 1775
1777 Instruction* InstructionAt(int offset) const { 1776 Instruction* InstructionAt(int offset) const {
1778 return reinterpret_cast<Instruction*>(buffer_ + offset); 1777 return reinterpret_cast<Instruction*>(buffer_ + offset);
1779 } 1778 }
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1901 1900
1902 private: 1901 private:
1903 Assembler* assem_; 1902 Assembler* assem_;
1904 1903
1905 DISALLOW_IMPLICIT_CONSTRUCTORS(BlockConstPoolScope); 1904 DISALLOW_IMPLICIT_CONSTRUCTORS(BlockConstPoolScope);
1906 }; 1905 };
1907 1906
1908 // Check if is time to emit a constant pool. 1907 // Check if is time to emit a constant pool.
1909 void CheckConstPool(bool force_emit, bool require_jump); 1908 void CheckConstPool(bool force_emit, bool require_jump);
1910 1909
1911 // Allocate a constant pool of the correct size for the generated code. 1910 void SetConstantPoolOffset(int pos, int offset,
1912 Handle<ConstantPoolArray> NewConstantPool(Isolate* isolate); 1911 ConstantPoolEntry::Access access,
1913 1912 ConstantPoolEntry::Type type) {
1914 // Generate the constant pool for the generated code. 1913 // No embedded constant pool support.
1915 void PopulateConstantPool(ConstantPoolArray* constant_pool); 1914 UNREACHABLE();
1915 }
1916 1916
1917 // Returns true if we should emit a veneer as soon as possible for a branch 1917 // Returns true if we should emit a veneer as soon as possible for a branch
1918 // which can at most reach to specified pc. 1918 // which can at most reach to specified pc.
1919 bool ShouldEmitVeneer(int max_reachable_pc, 1919 bool ShouldEmitVeneer(int max_reachable_pc,
1920 int margin = kVeneerDistanceMargin); 1920 int margin = kVeneerDistanceMargin);
1921 bool ShouldEmitVeneers(int margin = kVeneerDistanceMargin) { 1921 bool ShouldEmitVeneers(int margin = kVeneerDistanceMargin) {
1922 return ShouldEmitVeneer(unresolved_branches_first_limit(), margin); 1922 return ShouldEmitVeneer(unresolved_branches_first_limit(), margin);
1923 } 1923 }
1924 1924
1925 // The maximum code size generated for a veneer. Currently one branch 1925 // The maximum code size generated for a veneer. Currently one branch
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
2319 class EnsureSpace BASE_EMBEDDED { 2319 class EnsureSpace BASE_EMBEDDED {
2320 public: 2320 public:
2321 explicit EnsureSpace(Assembler* assembler) { 2321 explicit EnsureSpace(Assembler* assembler) {
2322 assembler->CheckBufferSpace(); 2322 assembler->CheckBufferSpace();
2323 } 2323 }
2324 }; 2324 };
2325 2325
2326 } } // namespace v8::internal 2326 } } // namespace v8::internal
2327 2327
2328 #endif // V8_ARM64_ASSEMBLER_ARM64_H_ 2328 #endif // V8_ARM64_ASSEMBLER_ARM64_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698