| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 void set_code(int code) { | 135 void set_code(int code) { |
| 136 reg_code = code; | 136 reg_code = code; |
| 137 DCHECK(is_valid()); | 137 DCHECK(is_valid()); |
| 138 } | 138 } |
| 139 | 139 |
| 140 // Unfortunately we can't make this private in a struct. | 140 // Unfortunately we can't make this private in a struct. |
| 141 int reg_code; | 141 int reg_code; |
| 142 }; | 142 }; |
| 143 | 143 |
| 144 // r7: context register | 144 // r7: context register |
| 145 // r8: constant pool pointer register if FLAG_enable_embedded_constant_pool. | |
| 146 // r9: lithium scratch | 145 // r9: lithium scratch |
| 147 #define DECLARE_REGISTER(R) constexpr Register R = {Register::kCode_##R}; | 146 #define DECLARE_REGISTER(R) constexpr Register R = {Register::kCode_##R}; |
| 148 GENERAL_REGISTERS(DECLARE_REGISTER) | 147 GENERAL_REGISTERS(DECLARE_REGISTER) |
| 149 #undef DECLARE_REGISTER | 148 #undef DECLARE_REGISTER |
| 150 constexpr Register no_reg = {Register::kCode_no_reg}; | 149 constexpr Register no_reg = {Register::kCode_no_reg}; |
| 151 | 150 |
| 152 constexpr bool kSimpleFPAliasing = false; | 151 constexpr bool kSimpleFPAliasing = false; |
| 153 constexpr bool kSimdMaskRegisters = false; | 152 constexpr bool kSimdMaskRegisters = false; |
| 154 | 153 |
| 155 // Single word VFP register. | 154 // Single word VFP register. |
| (...skipping 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1551 } | 1550 } |
| 1552 static Instr instr_at(byte* pc) { return *reinterpret_cast<Instr*>(pc); } | 1551 static Instr instr_at(byte* pc) { return *reinterpret_cast<Instr*>(pc); } |
| 1553 static void instr_at_put(byte* pc, Instr instr) { | 1552 static void instr_at_put(byte* pc, Instr instr) { |
| 1554 *reinterpret_cast<Instr*>(pc) = instr; | 1553 *reinterpret_cast<Instr*>(pc) = instr; |
| 1555 } | 1554 } |
| 1556 static Condition GetCondition(Instr instr); | 1555 static Condition GetCondition(Instr instr); |
| 1557 static bool IsBranch(Instr instr); | 1556 static bool IsBranch(Instr instr); |
| 1558 static int GetBranchOffset(Instr instr); | 1557 static int GetBranchOffset(Instr instr); |
| 1559 static bool IsLdrRegisterImmediate(Instr instr); | 1558 static bool IsLdrRegisterImmediate(Instr instr); |
| 1560 static bool IsVldrDRegisterImmediate(Instr instr); | 1559 static bool IsVldrDRegisterImmediate(Instr instr); |
| 1561 static Instr GetConsantPoolLoadPattern(); | |
| 1562 static Instr GetConsantPoolLoadMask(); | |
| 1563 static bool IsLdrPpRegOffset(Instr instr); | |
| 1564 static Instr GetLdrPpRegOffsetPattern(); | |
| 1565 static bool IsLdrPpImmediateOffset(Instr instr); | |
| 1566 static bool IsVldrDPpImmediateOffset(Instr instr); | |
| 1567 static int GetLdrRegisterImmediateOffset(Instr instr); | 1560 static int GetLdrRegisterImmediateOffset(Instr instr); |
| 1568 static int GetVldrDRegisterImmediateOffset(Instr instr); | 1561 static int GetVldrDRegisterImmediateOffset(Instr instr); |
| 1569 static Instr SetLdrRegisterImmediateOffset(Instr instr, int offset); | 1562 static Instr SetLdrRegisterImmediateOffset(Instr instr, int offset); |
| 1570 static Instr SetVldrDRegisterImmediateOffset(Instr instr, int offset); | 1563 static Instr SetVldrDRegisterImmediateOffset(Instr instr, int offset); |
| 1571 static bool IsStrRegisterImmediate(Instr instr); | 1564 static bool IsStrRegisterImmediate(Instr instr); |
| 1572 static Instr SetStrRegisterImmediateOffset(Instr instr, int offset); | 1565 static Instr SetStrRegisterImmediateOffset(Instr instr, int offset); |
| 1573 static bool IsAddRegisterImmediate(Instr instr); | 1566 static bool IsAddRegisterImmediate(Instr instr); |
| 1574 static Instr SetAddRegisterImmediateOffset(Instr instr, int offset); | 1567 static Instr SetAddRegisterImmediateOffset(Instr instr, int offset); |
| 1575 static Register GetRd(Instr instr); | 1568 static Register GetRd(Instr instr); |
| 1576 static Register GetRn(Instr instr); | 1569 static Register GetRn(Instr instr); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1621 | 1614 |
| 1622 // Check if is time to emit a constant pool. | 1615 // Check if is time to emit a constant pool. |
| 1623 void CheckConstPool(bool force_emit, bool require_jump); | 1616 void CheckConstPool(bool force_emit, bool require_jump); |
| 1624 | 1617 |
| 1625 void MaybeCheckConstPool() { | 1618 void MaybeCheckConstPool() { |
| 1626 if (pc_offset() >= next_buffer_check_) { | 1619 if (pc_offset() >= next_buffer_check_) { |
| 1627 CheckConstPool(false, true); | 1620 CheckConstPool(false, true); |
| 1628 } | 1621 } |
| 1629 } | 1622 } |
| 1630 | 1623 |
| 1631 int EmitEmbeddedConstantPool() { | |
| 1632 DCHECK(FLAG_enable_embedded_constant_pool); | |
| 1633 return constant_pool_builder_.Emit(this); | |
| 1634 } | |
| 1635 | |
| 1636 bool ConstantPoolAccessIsInOverflow() const { | |
| 1637 return constant_pool_builder_.NextAccess(ConstantPoolEntry::INTPTR) == | |
| 1638 ConstantPoolEntry::OVERFLOWED; | |
| 1639 } | |
| 1640 | |
| 1641 void PatchConstantPoolAccessInstruction(int pc_offset, int offset, | 1624 void PatchConstantPoolAccessInstruction(int pc_offset, int offset, |
| 1642 ConstantPoolEntry::Access access, | 1625 ConstantPoolEntry::Access access, |
| 1643 ConstantPoolEntry::Type type); | 1626 ConstantPoolEntry::Type type) { |
| 1627 // No embedded constant pool support. |
| 1628 UNREACHABLE(); |
| 1629 } |
| 1644 | 1630 |
| 1645 protected: | 1631 protected: |
| 1646 // Relocation for a type-recording IC has the AST id added to it. This | 1632 // Relocation for a type-recording IC has the AST id added to it. This |
| 1647 // member variable is a way to pass the information from the call site to | 1633 // member variable is a way to pass the information from the call site to |
| 1648 // the relocation info. | 1634 // the relocation info. |
| 1649 TypeFeedbackId recorded_ast_id_; | 1635 TypeFeedbackId recorded_ast_id_; |
| 1650 | 1636 |
| 1651 int buffer_space() const { return reloc_info_writer.pos() - pc_; } | 1637 int buffer_space() const { return reloc_info_writer.pos() - pc_; } |
| 1652 | 1638 |
| 1653 // Decode branch instruction at pos and return branch target pos | 1639 // Decode branch instruction at pos and return branch target pos |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1756 | 1742 |
| 1757 // Emission of the constant pool may be blocked in some code sequences. | 1743 // Emission of the constant pool may be blocked in some code sequences. |
| 1758 int const_pool_blocked_nesting_; // Block emission if this is not zero. | 1744 int const_pool_blocked_nesting_; // Block emission if this is not zero. |
| 1759 int no_const_pool_before_; // Block emission before this pc offset. | 1745 int no_const_pool_before_; // Block emission before this pc offset. |
| 1760 | 1746 |
| 1761 // Keep track of the first instruction requiring a constant pool entry | 1747 // Keep track of the first instruction requiring a constant pool entry |
| 1762 // since the previous constant pool was emitted. | 1748 // since the previous constant pool was emitted. |
| 1763 int first_const_pool_32_use_; | 1749 int first_const_pool_32_use_; |
| 1764 int first_const_pool_64_use_; | 1750 int first_const_pool_64_use_; |
| 1765 | 1751 |
| 1766 ConstantPoolBuilder constant_pool_builder_; | |
| 1767 | |
| 1768 // The bound position, before this we cannot do instruction elimination. | 1752 // The bound position, before this we cannot do instruction elimination. |
| 1769 int last_bound_pos_; | 1753 int last_bound_pos_; |
| 1770 | 1754 |
| 1771 inline void CheckBuffer(); | 1755 inline void CheckBuffer(); |
| 1772 void GrowBuffer(); | 1756 void GrowBuffer(); |
| 1773 | 1757 |
| 1774 // 32-bit immediate values | 1758 // 32-bit immediate values |
| 1775 void move_32_bit_immediate(Register rd, | 1759 void move_32_bit_immediate(Register rd, |
| 1776 const Operand& x, | 1760 const Operand& x, |
| 1777 Condition cond = al); | 1761 Condition cond = al); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1815 | 1799 |
| 1816 void Emit(Address addr); | 1800 void Emit(Address addr); |
| 1817 void FlushICache(Isolate* isolate); | 1801 void FlushICache(Isolate* isolate); |
| 1818 }; | 1802 }; |
| 1819 | 1803 |
| 1820 | 1804 |
| 1821 } // namespace internal | 1805 } // namespace internal |
| 1822 } // namespace v8 | 1806 } // namespace v8 |
| 1823 | 1807 |
| 1824 #endif // V8_ARM_ASSEMBLER_ARM_H_ | 1808 #endif // V8_ARM_ASSEMBLER_ARM_H_ |
| OLD | NEW |