OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
6 // are met: | 6 // are met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 1708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1719 // containers for constants and code target addresses until they are emitted | 1719 // containers for constants and code target addresses until they are emitted |
1720 // to the constant pool. These records are temporarily stored in a separate | 1720 // to the constant pool. These records are temporarily stored in a separate |
1721 // buffer until a constant pool is emitted. | 1721 // buffer until a constant pool is emitted. |
1722 // If every instruction in a long sequence is accessing the pool, we need one | 1722 // If every instruction in a long sequence is accessing the pool, we need one |
1723 // pending relocation entry per instruction. | 1723 // pending relocation entry per instruction. |
1724 | 1724 |
1725 // The buffers of pending constant pool entries. | 1725 // The buffers of pending constant pool entries. |
1726 std::vector<ConstantPoolEntry> pending_32_bit_constants_; | 1726 std::vector<ConstantPoolEntry> pending_32_bit_constants_; |
1727 std::vector<ConstantPoolEntry> pending_64_bit_constants_; | 1727 std::vector<ConstantPoolEntry> pending_64_bit_constants_; |
1728 | 1728 |
1729 // Map of address of handle to index in pending_32_bit_constants_. | |
1730 std::map<Address, int> handle_to_index_map_; | |
1731 | |
1732 private: | 1729 private: |
1733 // Avoid overflows for displacements etc. | 1730 // Avoid overflows for displacements etc. |
1734 static const int kMaximalBufferSize = 512 * MB; | 1731 static const int kMaximalBufferSize = 512 * MB; |
1735 | 1732 |
1736 int next_buffer_check_; // pc offset of next buffer check | 1733 int next_buffer_check_; // pc offset of next buffer check |
1737 | 1734 |
1738 // Constant pool generation | 1735 // Constant pool generation |
1739 // Pools are emitted in the instruction stream, preferably after unconditional | 1736 // Pools are emitted in the instruction stream, preferably after unconditional |
1740 // jumps or after returns from functions (in dead code locations). | 1737 // jumps or after returns from functions (in dead code locations). |
1741 // If a long code sequence does not contain unconditional jumps, it is | 1738 // If a long code sequence does not contain unconditional jumps, it is |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1780 void addrmod4(Instr instr, Register rn, RegList rl); | 1777 void addrmod4(Instr instr, Register rn, RegList rl); |
1781 void addrmod5(Instr instr, CRegister crd, const MemOperand& x); | 1778 void addrmod5(Instr instr, CRegister crd, const MemOperand& x); |
1782 | 1779 |
1783 // Labels | 1780 // Labels |
1784 void print(Label* L); | 1781 void print(Label* L); |
1785 void bind_to(Label* L, int pos); | 1782 void bind_to(Label* L, int pos); |
1786 void next(Label* L); | 1783 void next(Label* L); |
1787 | 1784 |
1788 // Record reloc info for current pc_ | 1785 // Record reloc info for current pc_ |
1789 void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0); | 1786 void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0); |
1790 void ConstantPoolAddEntry(int position, RelocInfo::Mode rmode, | 1787 ConstantPoolEntry::Access ConstantPoolAddEntry(int position, |
1791 intptr_t value); | 1788 RelocInfo::Mode rmode, |
1792 void ConstantPoolAddEntry(int position, double value); | 1789 intptr_t value); |
| 1790 ConstantPoolEntry::Access ConstantPoolAddEntry(int position, double value); |
1793 | 1791 |
1794 friend class RelocInfo; | 1792 friend class RelocInfo; |
1795 friend class CodePatcher; | 1793 friend class CodePatcher; |
1796 friend class BlockConstPoolScope; | 1794 friend class BlockConstPoolScope; |
1797 friend class EnsureSpace; | 1795 friend class EnsureSpace; |
1798 }; | 1796 }; |
1799 | 1797 |
1800 constexpr int kNoCodeAgeSequenceLength = 3 * Assembler::kInstrSize; | 1798 constexpr int kNoCodeAgeSequenceLength = 3 * Assembler::kInstrSize; |
1801 | 1799 |
1802 class EnsureSpace BASE_EMBEDDED { | 1800 class EnsureSpace BASE_EMBEDDED { |
1803 public: | 1801 public: |
1804 INLINE(explicit EnsureSpace(Assembler* assembler)); | 1802 INLINE(explicit EnsureSpace(Assembler* assembler)); |
1805 }; | 1803 }; |
1806 | 1804 |
1807 class PatchingAssembler : public Assembler { | 1805 class PatchingAssembler : public Assembler { |
1808 public: | 1806 public: |
1809 PatchingAssembler(IsolateData isolate_data, byte* address, int instructions); | 1807 PatchingAssembler(IsolateData isolate_data, byte* address, int instructions); |
1810 ~PatchingAssembler(); | 1808 ~PatchingAssembler(); |
1811 | 1809 |
1812 void Emit(Address addr); | 1810 void Emit(Address addr); |
1813 void FlushICache(Isolate* isolate); | 1811 void FlushICache(Isolate* isolate); |
1814 }; | 1812 }; |
1815 | 1813 |
1816 | 1814 |
1817 } // namespace internal | 1815 } // namespace internal |
1818 } // namespace v8 | 1816 } // namespace v8 |
1819 | 1817 |
1820 #endif // V8_ARM_ASSEMBLER_ARM_H_ | 1818 #endif // V8_ARM_ASSEMBLER_ARM_H_ |
OLD | NEW |