Title: [272191] trunk/Source/_javascript_Core
Revision
272191
Author
[email protected]
Date
2021-02-01 23:46:20 -0800 (Mon, 01 Feb 2021)

Log Message

Sign m_offset in AssemblerLabel
https://bugs.webkit.org/show_bug.cgi?id=221237

Reviewed by Mark Lam.

* assembler/ARM64Assembler.h:
(JSC::ARM64Assembler::labelForWatchpoint):
(JSC::ARM64Assembler::label):
(JSC::ARM64Assembler::getRelocatedAddress):
(JSC::ARM64Assembler::getDifferenceBetweenLabels):
(JSC::ARM64Assembler::getCallReturnOffset):
(JSC::ARM64Assembler::linkJump):
(JSC::ARM64Assembler::addressOf):
* assembler/ARMv7Assembler.h:
(JSC::ARMv7Assembler::labelForWatchpoint):
(JSC::ARMv7Assembler::label):
(JSC::ARMv7Assembler::getRelocatedAddress):
(JSC::ARMv7Assembler::getDifferenceBetweenLabels):
(JSC::ARMv7Assembler::getCallReturnOffset):
(JSC::ARMv7Assembler::linkJump):
(JSC::ARMv7Assembler::linkCall):
(JSC::ARMv7Assembler::linkPointer):
* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::Jump::link const):
(JSC::AbstractMacroAssembler::Jump::linkTo const):
* assembler/AssemblerBuffer.h:
(JSC::AssemblerLabel::AssemblerLabel):
(JSC::AssemblerLabel::operator=):
(JSC::AssemblerLabel::isSet const):
(JSC::AssemblerLabel::labelAtOffset const):
(JSC::AssemblerLabel::operator== const):
(JSC::AssemblerLabel::offset const):
(JSC::AssemblerLabel::setOffset):
* assembler/LinkBuffer.h:
(JSC::LinkBuffer::offsetOf):
(JSC::LinkBuffer::applyOffset):
* assembler/MIPSAssembler.h:
(JSC::MIPSAssembler::labelForWatchpoint):
(JSC::MIPSAssembler::label):
(JSC::MIPSAssembler::getRelocatedAddress):
(JSC::MIPSAssembler::getDifferenceBetweenLabels):
(JSC::MIPSAssembler::getCallReturnOffset):
(JSC::MIPSAssembler::linkJump):
(JSC::MIPSAssembler::linkCall):
(JSC::MIPSAssembler::linkPointer):
* assembler/X86Assembler.h:
(JSC::X86Assembler::labelForWatchpoint):
(JSC::X86Assembler::label):
(JSC::X86Assembler::linkJump):
(JSC::X86Assembler::linkCall):
(JSC::X86Assembler::linkPointer):
(JSC::X86Assembler::getCallReturnOffset):
(JSC::X86Assembler::getRelocatedAddress):
(JSC::X86Assembler::getDifferenceBetweenLabels):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (272190 => 272191)


--- trunk/Source/_javascript_Core/ChangeLog	2021-02-02 05:18:54 UTC (rev 272190)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-02-02 07:46:20 UTC (rev 272191)
@@ -1,3 +1,60 @@
+2021-02-01  Saam Barati  <[email protected]>
+
+        Sign m_offset in AssemblerLabel
+        https://bugs.webkit.org/show_bug.cgi?id=221237
+
+        Reviewed by Mark Lam.
+
+        * assembler/ARM64Assembler.h:
+        (JSC::ARM64Assembler::labelForWatchpoint):
+        (JSC::ARM64Assembler::label):
+        (JSC::ARM64Assembler::getRelocatedAddress):
+        (JSC::ARM64Assembler::getDifferenceBetweenLabels):
+        (JSC::ARM64Assembler::getCallReturnOffset):
+        (JSC::ARM64Assembler::linkJump):
+        (JSC::ARM64Assembler::addressOf):
+        * assembler/ARMv7Assembler.h:
+        (JSC::ARMv7Assembler::labelForWatchpoint):
+        (JSC::ARMv7Assembler::label):
+        (JSC::ARMv7Assembler::getRelocatedAddress):
+        (JSC::ARMv7Assembler::getDifferenceBetweenLabels):
+        (JSC::ARMv7Assembler::getCallReturnOffset):
+        (JSC::ARMv7Assembler::linkJump):
+        (JSC::ARMv7Assembler::linkCall):
+        (JSC::ARMv7Assembler::linkPointer):
+        * assembler/AbstractMacroAssembler.h:
+        (JSC::AbstractMacroAssembler::Jump::link const):
+        (JSC::AbstractMacroAssembler::Jump::linkTo const):
+        * assembler/AssemblerBuffer.h:
+        (JSC::AssemblerLabel::AssemblerLabel):
+        (JSC::AssemblerLabel::operator=):
+        (JSC::AssemblerLabel::isSet const):
+        (JSC::AssemblerLabel::labelAtOffset const):
+        (JSC::AssemblerLabel::operator== const):
+        (JSC::AssemblerLabel::offset const):
+        (JSC::AssemblerLabel::setOffset):
+        * assembler/LinkBuffer.h:
+        (JSC::LinkBuffer::offsetOf):
+        (JSC::LinkBuffer::applyOffset):
+        * assembler/MIPSAssembler.h:
+        (JSC::MIPSAssembler::labelForWatchpoint):
+        (JSC::MIPSAssembler::label):
+        (JSC::MIPSAssembler::getRelocatedAddress):
+        (JSC::MIPSAssembler::getDifferenceBetweenLabels):
+        (JSC::MIPSAssembler::getCallReturnOffset):
+        (JSC::MIPSAssembler::linkJump):
+        (JSC::MIPSAssembler::linkCall):
+        (JSC::MIPSAssembler::linkPointer):
+        * assembler/X86Assembler.h:
+        (JSC::X86Assembler::labelForWatchpoint):
+        (JSC::X86Assembler::label):
+        (JSC::X86Assembler::linkJump):
+        (JSC::X86Assembler::linkCall):
+        (JSC::X86Assembler::linkPointer):
+        (JSC::X86Assembler::getCallReturnOffset):
+        (JSC::X86Assembler::getRelocatedAddress):
+        (JSC::X86Assembler::getDifferenceBetweenLabels):
+
 2021-02-01  Yusuke Suzuki  <[email protected]>
 
         [JSC] TypedArray#fill should be implemented in C++

Modified: trunk/Source/_javascript_Core/assembler/ARM64Assembler.h (272190 => 272191)


--- trunk/Source/_javascript_Core/assembler/ARM64Assembler.h	2021-02-02 05:18:54 UTC (rev 272190)
+++ trunk/Source/_javascript_Core/assembler/ARM64Assembler.h	2021-02-02 07:46:20 UTC (rev 272191)
@@ -2501,10 +2501,10 @@
     AssemblerLabel labelForWatchpoint()
     {
         AssemblerLabel result = m_buffer.label();
-        if (static_cast<int>(result.m_offset) != m_indexOfLastWatchpoint)
+        if (static_cast<int>(result.offset()) != m_indexOfLastWatchpoint)
             result = label();
-        m_indexOfLastWatchpoint = result.m_offset;
-        m_indexOfTailOfLastWatchpoint = result.m_offset + maxJumpReplacementSize();
+        m_indexOfLastWatchpoint = result.offset();
+        m_indexOfTailOfLastWatchpoint = result.offset() + maxJumpReplacementSize();
         return result;
     }
 
@@ -2511,7 +2511,7 @@
     AssemblerLabel label()
     {
         AssemblerLabel result = m_buffer.label();
-        while (UNLIKELY(static_cast<int>(result.m_offset) < m_indexOfTailOfLastWatchpoint)) {
+        while (UNLIKELY(static_cast<int>(result.offset()) < m_indexOfTailOfLastWatchpoint)) {
             nop();
             result = m_buffer.label();
         }
@@ -2529,12 +2529,12 @@
     static void* getRelocatedAddress(void* code, AssemblerLabel label)
     {
         ASSERT(label.isSet());
-        return reinterpret_cast<void*>(reinterpret_cast<ptrdiff_t>(code) + label.m_offset);
+        return reinterpret_cast<void*>(reinterpret_cast<ptrdiff_t>(code) + label.offset());
     }
     
     static int getDifferenceBetweenLabels(AssemblerLabel a, AssemblerLabel b)
     {
-        return b.m_offset - a.m_offset;
+        return b.offset() - a.offset();
     }
 
     size_t codeSize() const { return m_buffer.codeSize(); }
@@ -2542,7 +2542,7 @@
     static unsigned getCallReturnOffset(AssemblerLabel call)
     {
         ASSERT(call.isSet());
-        return call.m_offset;
+        return call.offset();
     }
 
     // Linking & patching:
@@ -2557,7 +2557,7 @@
     {
         ASSERT(to.isSet());
         ASSERT(from.isSet());
-        m_jumpsToLink.append(LinkRecord(this, from.m_offset, to.m_offset, type, condition));
+        m_jumpsToLink.append(LinkRecord(this, from.offset(), to.offset(), type, condition));
     }
 
     void linkJump(AssemblerLabel from, AssemblerLabel to, JumpType type, Condition condition, bool is64Bit, RegisterID compareRegister)
@@ -2564,7 +2564,7 @@
     {
         ASSERT(to.isSet());
         ASSERT(from.isSet());
-        m_jumpsToLink.append(LinkRecord(this, from.m_offset, to.m_offset, type, condition, is64Bit, compareRegister));
+        m_jumpsToLink.append(LinkRecord(this, from.offset(), to.offset(), type, condition, is64Bit, compareRegister));
     }
 
     void linkJump(AssemblerLabel from, AssemblerLabel to, JumpType type, Condition condition, unsigned bitNumber, RegisterID compareRegister)
@@ -2571,7 +2571,7 @@
     {
         ASSERT(to.isSet());
         ASSERT(from.isSet());
-        m_jumpsToLink.append(LinkRecord(this, from.m_offset, to.m_offset, type, condition, bitNumber, compareRegister));
+        m_jumpsToLink.append(LinkRecord(this, from.offset(), to.offset(), type, condition, bitNumber, compareRegister));
     }
 
     static void linkJump(void* code, AssemblerLabel from, void* to)
@@ -3203,7 +3203,7 @@
 
     static int* addressOf(void* code, AssemblerLabel label)
     {
-        return reinterpret_cast<int*>(static_cast<char*>(code) + label.m_offset);
+        return reinterpret_cast<int*>(static_cast<char*>(code) + label.offset());
     }
 
     static RegisterID disassembleXOrSp(int reg) { return reg == 31 ? ARM64Registers::sp : static_cast<RegisterID>(reg); }

Modified: trunk/Source/_javascript_Core/assembler/ARMv7Assembler.h (272190 => 272191)


--- trunk/Source/_javascript_Core/assembler/ARMv7Assembler.h	2021-02-02 05:18:54 UTC (rev 272190)
+++ trunk/Source/_javascript_Core/assembler/ARMv7Assembler.h	2021-02-02 07:46:20 UTC (rev 272191)
@@ -2029,10 +2029,10 @@
     AssemblerLabel labelForWatchpoint()
     {
         AssemblerLabel result = m_formatter.label();
-        if (static_cast<int>(result.m_offset) != m_indexOfLastWatchpoint)
+        if (static_cast<int>(result.offset()) != m_indexOfLastWatchpoint)
             result = label();
-        m_indexOfLastWatchpoint = result.m_offset;
-        m_indexOfTailOfLastWatchpoint = result.m_offset + maxJumpReplacementSize();
+        m_indexOfLastWatchpoint = result.offset();
+        m_indexOfTailOfLastWatchpoint = result.offset() + maxJumpReplacementSize();
         return result;
     }
 
@@ -2039,8 +2039,8 @@
     AssemblerLabel label()
     {
         AssemblerLabel result = m_formatter.label();
-        while (UNLIKELY(static_cast<int>(result.m_offset) < m_indexOfTailOfLastWatchpoint)) {
-            if (UNLIKELY(static_cast<int>(result.m_offset) + 4 <= m_indexOfTailOfLastWatchpoint))
+        while (UNLIKELY(static_cast<int>(result.offset()) < m_indexOfTailOfLastWatchpoint)) {
+            if (UNLIKELY(static_cast<int>(result.offset()) + 4 <= m_indexOfTailOfLastWatchpoint))
                 nopw();
             else
                 nop();
@@ -2060,12 +2060,12 @@
     static void* getRelocatedAddress(void* code, AssemblerLabel label)
     {
         ASSERT(label.isSet());
-        return reinterpret_cast<void*>(reinterpret_cast<ptrdiff_t>(code) + label.m_offset);
+        return reinterpret_cast<void*>(reinterpret_cast<ptrdiff_t>(code) + label.offset());
     }
     
     static int getDifferenceBetweenLabels(AssemblerLabel a, AssemblerLabel b)
     {
-        return b.m_offset - a.m_offset;
+        return b.offset() - a.offset();
     }
 
     static int jumpSizeDelta(JumpType jumpType, JumpLinkType jumpLinkType) { return JUMP_ENUM_SIZE(jumpType) - JUMP_ENUM_SIZE(jumpLinkType); }
@@ -2180,7 +2180,7 @@
     static unsigned getCallReturnOffset(AssemblerLabel call)
     {
         ASSERT(call.isSet());
-        return call.m_offset;
+        return call.offset();
     }
 
     // Linking & patching:
@@ -2195,7 +2195,7 @@
     {
         ASSERT(to.isSet());
         ASSERT(from.isSet());
-        m_jumpsToLink.append(LinkRecord(from.m_offset, to.m_offset, type, condition));
+        m_jumpsToLink.append(LinkRecord(from.offset(), to.offset(), type, condition));
     }
 
     static void linkJump(void* code, AssemblerLabel from, void* to)
@@ -2202,7 +2202,7 @@
     {
         ASSERT(from.isSet());
         
-        uint16_t* location = reinterpret_cast<uint16_t*>(reinterpret_cast<intptr_t>(code) + from.m_offset);
+        uint16_t* location = reinterpret_cast<uint16_t*>(reinterpret_cast<intptr_t>(code) + from.offset());
         linkJumpAbsolute(location, location, to);
     }
 
@@ -2211,12 +2211,12 @@
         ASSERT(!(reinterpret_cast<intptr_t>(code) & 1));
         ASSERT(from.isSet());
 
-        setPointer(reinterpret_cast<uint16_t*>(reinterpret_cast<intptr_t>(code) + from.m_offset) - 1, to, false);
+        setPointer(reinterpret_cast<uint16_t*>(reinterpret_cast<intptr_t>(code) + from.offset()) - 1, to, false);
     }
 
     static void linkPointer(void* code, AssemblerLabel where, void* value)
     {
-        setPointer(reinterpret_cast<char*>(code) + where.m_offset, value, false);
+        setPointer(reinterpret_cast<char*>(code) + where.offset(), value, false);
     }
 
     // The static relink and replace methods can use can use |from| for both

Modified: trunk/Source/_javascript_Core/assembler/AbstractMacroAssembler.h (272190 => 272191)


--- trunk/Source/_javascript_Core/assembler/AbstractMacroAssembler.h	2021-02-02 05:18:54 UTC (rev 272190)
+++ trunk/Source/_javascript_Core/assembler/AbstractMacroAssembler.h	2021-02-02 07:46:20 UTC (rev 272191)
@@ -637,7 +637,7 @@
             masm->invalidateAllTempRegisters();
 
 #if ENABLE(DFG_REGISTER_ALLOCATION_VALIDATION)
-            masm->checkRegisterAllocationAgainstBranchRange(m_label.m_offset, masm->debugOffset());
+            masm->checkRegisterAllocationAgainstBranchRange(m_label.offset(), masm->debugOffset());
 #endif
 
 #if CPU(ARM_THUMB2)
@@ -657,7 +657,7 @@
         void linkTo(Label label, AbstractMacroAssemblerType* masm) const
         {
 #if ENABLE(DFG_REGISTER_ALLOCATION_VALIDATION)
-            masm->checkRegisterAllocationAgainstBranchRange(label.m_label.m_offset, m_label.m_offset);
+            masm->checkRegisterAllocationAgainstBranchRange(label.m_label.offset(), m_label.offset());
 #endif
 
 #if CPU(ARM_THUMB2)

Modified: trunk/Source/_javascript_Core/assembler/AssemblerBuffer.h (272190 => 272191)


--- trunk/Source/_javascript_Core/assembler/AssemblerBuffer.h	2021-02-02 05:18:54 UTC (rev 272190)
+++ trunk/Source/_javascript_Core/assembler/AssemblerBuffer.h	2021-02-02 07:46:20 UTC (rev 272191)
@@ -53,26 +53,47 @@
     DECLARE_ALLOCATOR_WITH_HEAP_IDENTIFIER(AssemblerData);
 
     struct AssemblerLabel {
-        AssemblerLabel()
-            : m_offset(std::numeric_limits<uint32_t>::max())
+        inline AssemblerLabel() { setOffset(std::numeric_limits<uint32_t>::max()); }
+        inline AssemblerLabel(const AssemblerLabel& other) { setOffset(other.offset()); }
+        inline AssemblerLabel(AssemblerLabel&& other) { setOffset(other.offset()); }
+        inline explicit AssemblerLabel(uint32_t offset) { setOffset(offset); }
+
+        AssemblerLabel& operator=(const AssemblerLabel& other) { setOffset(other.offset()); return *this; }
+        AssemblerLabel& operator=(AssemblerLabel&& other) { setOffset(other.offset()); return *this; }
+
+        bool isSet() const { return (offset() != std::numeric_limits<uint32_t>::max()); }
+
+        inline AssemblerLabel labelAtOffset(int offset) const
         {
+            return AssemblerLabel(this->offset() + offset);
         }
 
-        explicit AssemblerLabel(uint32_t offset)
-            : m_offset(offset)
+        bool operator==(const AssemblerLabel& other) const { return offset() == other.offset(); }
+
+        inline uint32_t offset() const
         {
+#if CPU(ARM64E)
+            return static_cast<uint32_t>(untagInt(m_offset, bitwise_cast<PtrTag>(this)));
+#else
+            return m_offset;
+#endif
         }
 
-        bool isSet() const { return (m_offset != std::numeric_limits<uint32_t>::max()); }
-
-        AssemblerLabel labelAtOffset(int offset) const
+    private:
+        inline void setOffset(uint32_t offset)
         {
-            return AssemblerLabel(m_offset + offset);
+#if CPU(ARM64E)
+            m_offset = tagInt(static_cast<uint64_t>(offset), bitwise_cast<PtrTag>(this));
+#else
+            m_offset = offset;
+#endif
         }
 
-        bool operator==(const AssemblerLabel& other) const { return m_offset == other.m_offset; }
-
+#if CPU(ARM64E)
+        uint64_t m_offset;
+#else
         uint32_t m_offset;
+#endif
     };
 
     class AssemblerData {

Modified: trunk/Source/_javascript_Core/assembler/LinkBuffer.h (272190 => 272191)


--- trunk/Source/_javascript_Core/assembler/LinkBuffer.h	2021-02-02 05:18:54 UTC (rev 272190)
+++ trunk/Source/_javascript_Core/assembler/LinkBuffer.h	2021-02-02 07:46:20 UTC (rev 272191)
@@ -253,12 +253,12 @@
 
     uint32_t offsetOf(Label label)
     {
-        return applyOffset(label.m_label).m_offset;
+        return applyOffset(label.m_label).offset();
     }
 
     unsigned offsetOf(PatchableJump jump)
     {
-        return applyOffset(jump.m_jump.m_label).m_offset;
+        return applyOffset(jump.m_jump.m_label).offset();
     }
 
     // Upon completion of all patching 'FINALIZE_CODE()' should be called once to
@@ -318,7 +318,7 @@
     template <typename T> T applyOffset(T src)
     {
 #if ENABLE(BRANCH_COMPACTION)
-        src.m_offset -= executableOffsetFor(src.m_offset);
+        src = ""
 #endif
         return src;
     }

Modified: trunk/Source/_javascript_Core/assembler/MIPSAssembler.h (272190 => 272191)


--- trunk/Source/_javascript_Core/assembler/MIPSAssembler.h	2021-02-02 05:18:54 UTC (rev 272190)
+++ trunk/Source/_javascript_Core/assembler/MIPSAssembler.h	2021-02-02 07:46:20 UTC (rev 272191)
@@ -674,10 +674,10 @@
     AssemblerLabel labelForWatchpoint()
     {
         AssemblerLabel result = m_buffer.label();
-        if (static_cast<int>(result.m_offset) != m_indexOfLastWatchpoint)
+        if (static_cast<int>(result.offset()) != m_indexOfLastWatchpoint)
             result = label();
-        m_indexOfLastWatchpoint = result.m_offset;
-        m_indexOfTailOfLastWatchpoint = result.m_offset + maxJumpReplacementSize();
+        m_indexOfLastWatchpoint = result.offset();
+        m_indexOfTailOfLastWatchpoint = result.offset() + maxJumpReplacementSize();
         return result;
     }
 
@@ -684,7 +684,7 @@
     AssemblerLabel label()
     {
         AssemblerLabel result = m_buffer.label();
-        while (UNLIKELY(static_cast<int>(result.m_offset) < m_indexOfTailOfLastWatchpoint)) {
+        while (UNLIKELY(static_cast<int>(result.offset()) < m_indexOfTailOfLastWatchpoint)) {
             nop();
             result = m_buffer.label();
         }
@@ -701,12 +701,12 @@
 
     static void* getRelocatedAddress(void* code, AssemblerLabel label)
     {
-        return reinterpret_cast<void*>(reinterpret_cast<char*>(code) + label.m_offset);
+        return reinterpret_cast<void*>(reinterpret_cast<char*>(code) + label.offset());
     }
 
     static int getDifferenceBetweenLabels(AssemblerLabel a, AssemblerLabel b)
     {
-        return b.m_offset - a.m_offset;
+        return b.offset() - a.offset();
     }
 
     // Assembler admin methods:
@@ -744,7 +744,7 @@
     static unsigned getCallReturnOffset(AssemblerLabel call)
     {
         // The return address is after a call and a delay slot instruction
-        return call.m_offset;
+        return call.offset();
     }
 
     // Linking & patching:
@@ -788,8 +788,8 @@
     {
         ASSERT(to.isSet());
         ASSERT(from.isSet());
-        MIPSWord* insn = reinterpret_cast<MIPSWord*>(reinterpret_cast<intptr_t>(m_buffer.data()) + from.m_offset);
-        MIPSWord* toPos = reinterpret_cast<MIPSWord*>(reinterpret_cast<intptr_t>(m_buffer.data()) + to.m_offset);
+        MIPSWord* insn = reinterpret_cast<MIPSWord*>(reinterpret_cast<intptr_t>(m_buffer.data()) + from.offset());
+        MIPSWord* toPos = reinterpret_cast<MIPSWord*>(reinterpret_cast<intptr_t>(m_buffer.data()) + to.offset());
 
         ASSERT(!(*(insn - 1)) && !(*(insn - 2)) && !(*(insn - 3)) && !(*(insn - 5)));
         insn = insn - 6;
@@ -799,7 +799,7 @@
     static void linkJump(void* code, AssemblerLabel from, void* to)
     {
         ASSERT(from.isSet());
-        MIPSWord* insn = reinterpret_cast<MIPSWord*>(reinterpret_cast<intptr_t>(code) + from.m_offset);
+        MIPSWord* insn = reinterpret_cast<MIPSWord*>(reinterpret_cast<intptr_t>(code) + from.offset());
 
         ASSERT(!(*(insn - 1)) && !(*(insn - 2)) && !(*(insn - 3)) && !(*(insn - 5)));
         insn = insn - 6;
@@ -808,13 +808,13 @@
 
     static void linkCall(void* code, AssemblerLabel from, void* to)
     {
-        MIPSWord* insn = reinterpret_cast<MIPSWord*>(reinterpret_cast<intptr_t>(code) + from.m_offset);
+        MIPSWord* insn = reinterpret_cast<MIPSWord*>(reinterpret_cast<intptr_t>(code) + from.offset());
         linkCallInternal(insn, to);
     }
 
     static void linkPointer(void* code, AssemblerLabel from, void* to)
     {
-        MIPSWord* insn = reinterpret_cast<MIPSWord*>(reinterpret_cast<intptr_t>(code) + from.m_offset);
+        MIPSWord* insn = reinterpret_cast<MIPSWord*>(reinterpret_cast<intptr_t>(code) + from.offset());
         ASSERT((*insn & 0xffe00000) == 0x3c000000); // lui
         *insn = (*insn & 0xffff0000) | ((reinterpret_cast<intptr_t>(to) >> 16) & 0xffff);
         insn++;
@@ -969,7 +969,7 @@
     {
         // Check each jump
         for (Jumps::Iterator iter = m_jumps.begin(); iter != m_jumps.end(); ++iter) {
-            int pos = iter->m_offset;
+            int pos = iter->offset();
             MIPSWord* insn = reinterpret_cast<MIPSWord*>(reinterpret_cast<intptr_t>(newBase) + pos);
             insn = insn + 2;
             // Need to make sure we have 5 valid instructions after pos

Modified: trunk/Source/_javascript_Core/assembler/X86Assembler.h (272190 => 272191)


--- trunk/Source/_javascript_Core/assembler/X86Assembler.h	2021-02-02 05:18:54 UTC (rev 272190)
+++ trunk/Source/_javascript_Core/assembler/X86Assembler.h	2021-02-02 07:46:20 UTC (rev 272191)
@@ -3693,10 +3693,10 @@
     AssemblerLabel labelForWatchpoint()
     {
         AssemblerLabel result = m_formatter.label();
-        if (static_cast<int>(result.m_offset) != m_indexOfLastWatchpoint)
+        if (static_cast<int>(result.offset()) != m_indexOfLastWatchpoint)
             result = label();
-        m_indexOfLastWatchpoint = result.m_offset;
-        m_indexOfTailOfLastWatchpoint = result.m_offset + maxJumpReplacementSize();
+        m_indexOfLastWatchpoint = result.offset();
+        m_indexOfTailOfLastWatchpoint = result.offset() + maxJumpReplacementSize();
         return result;
     }
     
@@ -3708,7 +3708,7 @@
     AssemblerLabel label()
     {
         AssemblerLabel result = m_formatter.label();
-        while (UNLIKELY(static_cast<int>(result.m_offset) < m_indexOfTailOfLastWatchpoint)) {
+        while (UNLIKELY(static_cast<int>(result.offset()) < m_indexOfTailOfLastWatchpoint)) {
             nop();
             result = m_formatter.label();
         }
@@ -3737,8 +3737,8 @@
         ASSERT(to.isSet());
 
         char* code = reinterpret_cast<char*>(m_formatter.data());
-        ASSERT(!WTF::unalignedLoad<int32_t>(bitwise_cast<int32_t*>(code + from.m_offset) - 1));
-        setRel32(code + from.m_offset, code + to.m_offset);
+        ASSERT(!WTF::unalignedLoad<int32_t>(bitwise_cast<int32_t*>(code + from.offset()) - 1));
+        setRel32(code + from.offset(), code + to.offset());
     }
     
     static void linkJump(void* code, AssemblerLabel from, void* to)
@@ -3745,7 +3745,7 @@
     {
         ASSERT(from.isSet());
 
-        setRel32(reinterpret_cast<char*>(code) + from.m_offset, to);
+        setRel32(reinterpret_cast<char*>(code) + from.offset(), to);
     }
 
     static void linkCall(void* code, AssemblerLabel from, void* to)
@@ -3752,7 +3752,7 @@
     {
         ASSERT(from.isSet());
 
-        setRel32(reinterpret_cast<char*>(code) + from.m_offset, to);
+        setRel32(reinterpret_cast<char*>(code) + from.offset(), to);
     }
 
     static void linkPointer(void* code, AssemblerLabel where, void* value)
@@ -3759,7 +3759,7 @@
     {
         ASSERT(where.isSet());
 
-        setPointer(reinterpret_cast<char*>(code) + where.m_offset, value);
+        setPointer(reinterpret_cast<char*>(code) + where.offset(), value);
     }
 
     static void relinkJump(void* from, void* to)
@@ -3939,18 +3939,18 @@
     static unsigned getCallReturnOffset(AssemblerLabel call)
     {
         ASSERT(call.isSet());
-        return call.m_offset;
+        return call.offset();
     }
 
     static void* getRelocatedAddress(void* code, AssemblerLabel label)
     {
         ASSERT(label.isSet());
-        return reinterpret_cast<void*>(reinterpret_cast<ptrdiff_t>(code) + label.m_offset);
+        return reinterpret_cast<void*>(reinterpret_cast<ptrdiff_t>(code) + label.offset());
     }
     
     static int getDifferenceBetweenLabels(AssemblerLabel a, AssemblerLabel b)
     {
-        return b.m_offset - a.m_offset;
+        return b.offset() - a.offset();
     }
     
     unsigned debugOffset() { return m_formatter.debugOffset(); }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to