Changeset 40879 in webkit for trunk/JavaScriptCore/assembler


Ignore:
Timestamp:
Feb 11, 2009, 4:37:35 PM (16 years ago)
Author:
[email protected]
Message:

2009-02-11 Sam Weinig <[email protected]>

Reviewed by Gavin Barraclough.

Style cleanup.

  • assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::CodeLocationCommon::CodeLocationCommon): (JSC::AbstractMacroAssembler::CodeLocationCommon::operator bool): (JSC::AbstractMacroAssembler::CodeLocationCommon::reset): (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForSwitch): (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForExceptionHandler): (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForJSR): (JSC::AbstractMacroAssembler::CodeLocationLabel::getJumpDestination): (JSC::AbstractMacroAssembler::CodeLocationJump::relink): (JSC::AbstractMacroAssembler::CodeLocationJump::CodeLocationJump): (JSC::AbstractMacroAssembler::CodeLocationCall::relink): (JSC::AbstractMacroAssembler::CodeLocationCall::calleeReturnAddressValue): (JSC::AbstractMacroAssembler::CodeLocationCall::CodeLocationCall): (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::repatch): (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::CodeLocationDataLabel32): (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::repatch): (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::CodeLocationDataLabelPtr): (JSC::AbstractMacroAssembler::ProcessorReturnAddress::ProcessorReturnAddress): (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToFunction): (JSC::AbstractMacroAssembler::ProcessorReturnAddress::operator void*): (JSC::AbstractMacroAssembler::PatchBuffer::link): (JSC::::CodeLocationCommon::labelAtOffset): (JSC::::CodeLocationCommon::jumpAtOffset): (JSC::::CodeLocationCommon::callAtOffset): (JSC::::CodeLocationCommon::dataLabelPtrAtOffset): (JSC::::CodeLocationCommon::dataLabel32AtOffset):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/assembler/AbstractMacroAssembler.h

    r40867 r40879  
    197197        friend class AbstractMacroAssembler;
    198198        friend class PatchBuffer;
    199 
    200199    public:
    201200        Label()
     
    220219        friend class AbstractMacroAssembler;
    221220        friend class PatchBuffer;
    222 
    223221    public:
    224222        DataLabelPtr()
     
    243241        friend class AbstractMacroAssembler;
    244242        friend class PatchBuffer;
    245 
    246243    public:
    247244        DataLabel32()
     
    268265        template<class AssemblerType_T>
    269266        friend class AbstractMacroAssembler;
    270 
    271267    public:
    272268        Call()
     
    314310        template<class AssemblerType_T>
    315311        friend class AbstractMacroAssembler;
    316 
    317312    public:
    318313        Jump()
     
    401396    public:
    402397        CodeLocationCommon()
    403             : location(0)
     398            : m_location(0)
    404399        {
    405400        }
     
    416411        CodeLocationDataLabel32 dataLabel32AtOffset(int offset);
    417412
    418         operator bool() { return location; }
    419         void reset() { location = 0; }
     413        operator bool() { return m_location; }
     414        void reset() { m_location = 0; }
    420415
    421416    protected:
    422417        explicit CodeLocationCommon(void* location)
    423             : location(location)
    424         {
    425         }
    426 
    427         void* location;
     418            : m_location(location)
     419        {
     420        }
     421
     422        void* m_location;
    428423    };
    429424
     
    435430        friend class CodeLocationJump;
    436431        friend class PatchBuffer;
    437 
    438432    public:
    439433        CodeLocationLabel()
     
    441435        }
    442436
    443         void* addressForSwitch() { return this->location; }
    444         void* addressForExceptionHandler() { return this->location; }
    445         void* addressForJSR() { return this->location; }
     437        void* addressForSwitch() { return this->m_location; }
     438        void* addressForExceptionHandler() { return this->m_location; }
     439        void* addressForJSR() { return this->m_location; }
    446440
    447441    private:
     
    451445        }
    452446
    453         void* getJumpDestination() { return this->location; }
     447        void* getJumpDestination() { return this->m_location; }
    454448    };
    455449
     
    467461        void relink(CodeLocationLabel destination)
    468462        {
    469             AssemblerType::patchBranchOffset(reinterpret_cast<intptr_t>(this->location), destination.location);
    470         }
    471 
    472     private:
    473         explicit CodeLocationJump(void* location) : CodeLocationCommon(location) {}
     463            AssemblerType::patchBranchOffset(reinterpret_cast<intptr_t>(this->m_location), destination.m_location);
     464        }
     465
     466    private:
     467        explicit CodeLocationJump(void* location)
     468            : CodeLocationCommon(location)
     469        {
     470        }
    474471    };
    475472
     
    488485        void relink(FunctionSig* function)
    489486        {
    490             AssemblerType::patchBranchOffset(reinterpret_cast<intptr_t>(this->location), reinterpret_cast<void*>(function));
     487            AssemblerType::patchBranchOffset(reinterpret_cast<intptr_t>(this->m_location), reinterpret_cast<void*>(function));
    491488        }
    492489
     
    495492        void* calleeReturnAddressValue()
    496493        {
    497             return this->location;
    498         }
    499 
    500     private:
    501         explicit CodeLocationCall(void* location) : CodeLocationCommon(location) {}
     494            return this->m_location;
     495        }
     496
     497    private:
     498        explicit CodeLocationCall(void* location)
     499            : CodeLocationCommon(location)
     500        {
     501        }
    502502    };
    503503
     
    515515        void repatch(int32_t value)
    516516        {
    517             AssemblerType::patchImmediate(reinterpret_cast<intptr_t>(this->location), value);
    518         }
    519 
    520     private:
    521         explicit CodeLocationDataLabel32(void* location) : CodeLocationCommon(location) {}
     517            AssemblerType::patchImmediate(reinterpret_cast<intptr_t>(this->m_location), value);
     518        }
     519
     520    private:
     521        explicit CodeLocationDataLabel32(void* location)
     522            : CodeLocationCommon(location)
     523        {
     524        }
    522525    };
    523526
     
    535538        void repatch(void* value)
    536539        {
    537             AssemblerType::patchPointer(reinterpret_cast<intptr_t>(this->location), reinterpret_cast<intptr_t>(value));
    538         }
    539 
    540     private:
    541         explicit CodeLocationDataLabelPtr(void* location) : CodeLocationCommon(location) {}
     540            AssemblerType::patchPointer(reinterpret_cast<intptr_t>(this->m_location), reinterpret_cast<intptr_t>(value));
     541        }
     542
     543    private:
     544        explicit CodeLocationDataLabelPtr(void* location)
     545            : CodeLocationCommon(location)
     546        {
     547        }
    542548    };
    543549
     
    547553    class ProcessorReturnAddress {
    548554    public:
    549         ProcessorReturnAddress(void* location) : location(location) {}
    550        
     555        ProcessorReturnAddress(void* location)
     556            : m_location(location)
     557        {
     558        }
     559
    551560        template<typename FunctionSig>
    552561        void relinkCallerToFunction(FunctionSig* newCalleeFunction)
    553562        {
    554             AssemblerType::patchBranchOffset(reinterpret_cast<intptr_t>(this->location), reinterpret_cast<void*>(newCalleeFunction));
     563            AssemblerType::patchBranchOffset(reinterpret_cast<intptr_t>(this->m_location), reinterpret_cast<void*>(newCalleeFunction));
    555564        }
    556565       
    557566        operator void*()
    558567        {
    559             return location;
    560         }
    561 
    562     private:
    563         void* location;
     568            return m_location;
     569        }
     570
     571    private:
     572        void* m_location;
    564573    };
    565574
     
    625634        void link(Jump jump, CodeLocationLabel label)
    626635        {
    627             AssemblerType::link(m_code, jump.m_jmp, label.location);
     636            AssemblerType::link(m_code, jump.m_jmp, label.m_location);
    628637        }
    629638
     
    631640        {
    632641            for (unsigned i = 0; i < list.m_jumps.size(); ++i)
    633                 AssemblerType::link(m_code, list.m_jumps[i].m_jmp, label.location);
     642                AssemblerType::link(m_code, list.m_jumps[i].m_jmp, label.m_location);
    634643        }
    635644
     
    728737
    729738protected:
    730 
    731739    AssemblerType m_assembler;
    732740};
     
    734742
    735743template <class AssemblerType>
    736 typename AbstractMacroAssembler<AssemblerType>::CodeLocationLabel AbstractMacroAssembler<AssemblerType>::CodeLocationCommon::labelAtOffset(int offset) {
    737     return typename AbstractMacroAssembler::CodeLocationLabel(reinterpret_cast<char*>(location) + offset);
     744typename AbstractMacroAssembler<AssemblerType>::CodeLocationLabel AbstractMacroAssembler<AssemblerType>::CodeLocationCommon::labelAtOffset(int offset)
     745{
     746    return typename AbstractMacroAssembler::CodeLocationLabel(reinterpret_cast<char*>(m_location) + offset);
    738747}
     748
    739749template <class AssemblerType>
    740 typename AbstractMacroAssembler<AssemblerType>::CodeLocationJump AbstractMacroAssembler<AssemblerType>::CodeLocationCommon::jumpAtOffset(int offset) {
    741     return typename AbstractMacroAssembler::CodeLocationJump(reinterpret_cast<char*>(location) + offset);
     750typename AbstractMacroAssembler<AssemblerType>::CodeLocationJump AbstractMacroAssembler<AssemblerType>::CodeLocationCommon::jumpAtOffset(int offset)
     751{
     752    return typename AbstractMacroAssembler::CodeLocationJump(reinterpret_cast<char*>(m_location) + offset);
    742753}
     754
    743755template <class AssemblerType>
    744 typename AbstractMacroAssembler<AssemblerType>::CodeLocationCall AbstractMacroAssembler<AssemblerType>::CodeLocationCommon::callAtOffset(int offset) {
    745     return typename AbstractMacroAssembler::CodeLocationCall(reinterpret_cast<char*>(location) + offset);
     756typename AbstractMacroAssembler<AssemblerType>::CodeLocationCall AbstractMacroAssembler<AssemblerType>::CodeLocationCommon::callAtOffset(int offset)
     757{
     758    return typename AbstractMacroAssembler::CodeLocationCall(reinterpret_cast<char*>(m_location) + offset);
    746759}
     760
    747761template <class AssemblerType>
    748 typename AbstractMacroAssembler<AssemblerType>::CodeLocationDataLabelPtr AbstractMacroAssembler<AssemblerType>::CodeLocationCommon::dataLabelPtrAtOffset(int offset) {
    749     return typename AbstractMacroAssembler::CodeLocationDataLabelPtr(reinterpret_cast<char*>(location) + offset);
     762typename AbstractMacroAssembler<AssemblerType>::CodeLocationDataLabelPtr AbstractMacroAssembler<AssemblerType>::CodeLocationCommon::dataLabelPtrAtOffset(int offset)
     763{
     764    return typename AbstractMacroAssembler::CodeLocationDataLabelPtr(reinterpret_cast<char*>(m_location) + offset);
    750765}
     766
    751767template <class AssemblerType>
    752 typename AbstractMacroAssembler<AssemblerType>::CodeLocationDataLabel32 AbstractMacroAssembler<AssemblerType>::CodeLocationCommon::dataLabel32AtOffset(int offset) {
    753     return typename AbstractMacroAssembler::CodeLocationDataLabel32(reinterpret_cast<char*>(location) + offset);
     768typename AbstractMacroAssembler<AssemblerType>::CodeLocationDataLabel32 AbstractMacroAssembler<AssemblerType>::CodeLocationCommon::dataLabel32AtOffset(int offset)
     769{
     770    return typename AbstractMacroAssembler::CodeLocationDataLabel32(reinterpret_cast<char*>(m_location) + offset);
    754771}
    755772
Note: See TracChangeset for help on using the changeset viewer.