Changeset 44711 in webkit for trunk/JavaScriptCore/bytecode


Ignore:
Timestamp:
Jun 15, 2009, 10:35:32 PM (16 years ago)
Author:
[email protected]
Message:

2009-06-15 Gavin Barraclough <[email protected]>

Reviewed by Sam Weinig.

Having moved most of their functionality into the RepatchBuffer class,
we can simplify the CodeLocation* classes.

The CodeLocation* classes are currently a tangle of templatey and friendly
badness, burried in the middle of AbstractMacroAssembler. Having moved
the ability to repatch out into RepatchBufer they are now do-nothing wrappers
on CodePtr (MacroAssemblerCodePtr), that only exist to provide type-safety.

Simplify the code, and move them off into their own header.

  • JavaScriptCore.xcodeproj/project.pbxproj:
  • assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::PatchBuffer::patch):
  • assembler/CodeLocation.h: Copied from assembler/AbstractMacroAssembler.h. (JSC::CodeLocationCommon::CodeLocationCommon): (JSC::CodeLocationInstruction::CodeLocationInstruction): (JSC::CodeLocationLabel::CodeLocationLabel): (JSC::CodeLocationJump::CodeLocationJump): (JSC::CodeLocationCall::CodeLocationCall): (JSC::CodeLocationNearCall::CodeLocationNearCall): (JSC::CodeLocationDataLabel32::CodeLocationDataLabel32): (JSC::CodeLocationDataLabelPtr::CodeLocationDataLabelPtr): (JSC::CodeLocationCommon::instructionAtOffset): (JSC::CodeLocationCommon::labelAtOffset): (JSC::CodeLocationCommon::jumpAtOffset): (JSC::CodeLocationCommon::callAtOffset): (JSC::CodeLocationCommon::nearCallAtOffset): (JSC::CodeLocationCommon::dataLabelPtrAtOffset): (JSC::CodeLocationCommon::dataLabel32AtOffset):
  • assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodePtr::operator!):
  • bytecode/CodeBlock.h: (JSC::getStructureStubInfoReturnLocation): (JSC::getCallLinkInfoReturnLocation): (JSC::getMethodCallLinkInfoReturnLocation):
  • bytecode/Instruction.h:
  • bytecode/JumpTable.h: (JSC::StringJumpTable::ctiForValue): (JSC::SimpleJumpTable::ctiForValue):
  • bytecode/StructureStubInfo.h:
  • bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitCatch):
  • jit/JIT.cpp: (JSC::JIT::privateCompile):
  • jit/JITStubs.cpp: (JSC::JITStubs::DEFINE_STUB_FUNCTION): (JSC::JITStubs::getPolymorphicAccessStructureListSlot):
Location:
trunk/JavaScriptCore/bytecode
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bytecode/CodeBlock.h

    r44705 r44711  
    6060        uint32_t scopeDepth;
    6161#if ENABLE(JIT)
    62         MacroAssembler::CodeLocationLabel nativeCode;
     62        CodeLocationLabel nativeCode;
    6363#endif
    6464    };
     
    9696   
    9797        unsigned bytecodeIndex;
    98         MacroAssembler::CodeLocationNearCall callReturnLocation;
    99         MacroAssembler::CodeLocationDataLabelPtr hotPathBegin;
    100         MacroAssembler::CodeLocationNearCall hotPathOther;
     98        CodeLocationNearCall callReturnLocation;
     99        CodeLocationDataLabelPtr hotPathBegin;
     100        CodeLocationNearCall hotPathOther;
    101101        CodeBlock* callee;
    102102        unsigned position;
     
    112112        }
    113113
    114         MacroAssembler::CodeLocationCall callReturnLocation;
    115         MacroAssembler::CodeLocationDataLabelPtr structureLabel;
     114        CodeLocationCall callReturnLocation;
     115        CodeLocationDataLabelPtr structureLabel;
    116116        Structure* cachedStructure;
    117117    };
     
    160160    inline void* getStructureStubInfoReturnLocation(StructureStubInfo* structureStubInfo)
    161161    {
    162         return structureStubInfo->callReturnLocation.calleeReturnAddressValue();
     162        return structureStubInfo->callReturnLocation.executableAddress();
    163163    }
    164164
    165165    inline void* getCallLinkInfoReturnLocation(CallLinkInfo* callLinkInfo)
    166166    {
    167         return callLinkInfo->callReturnLocation.calleeReturnAddressValue();
     167        return callLinkInfo->callReturnLocation.executableAddress();
    168168    }
    169169
    170170    inline void* getMethodCallLinkInfoReturnLocation(MethodCallLinkInfo* methodCallLinkInfo)
    171171    {
    172         return methodCallLinkInfo->callReturnLocation.calleeReturnAddressValue();
     172        return methodCallLinkInfo->callReturnLocation.executableAddress();
    173173    }
    174174
  • trunk/JavaScriptCore/bytecode/Instruction.h

    r43855 r44711  
    3939namespace JSC {
    4040
    41     // *Sigh*, If the JIT is enabled we need to track the stubRountine (of type MacroAssembler::CodeLocationLabel),
     41    // *Sigh*, If the JIT is enabled we need to track the stubRountine (of type CodeLocationLabel),
    4242    // If the JIT is not in use we don't actually need the variable (that said, if the JIT is not in use we don't
    4343    // curently actually use PolymorphicAccessStructureLists, which we should).  Anyway, this seems like the best
    4444    // solution for now - will need to something smarter if/when we actually want mixed-mode operation.
    4545#if ENABLE(JIT)
    46     typedef MacroAssembler::CodeLocationLabel PolymorphicAccessStructureListStubRoutineType;
     46    typedef CodeLocationLabel PolymorphicAccessStructureListStubRoutineType;
    4747#else
    4848    typedef void* PolymorphicAccessStructureListStubRoutineType;
  • trunk/JavaScriptCore/bytecode/JumpTable.h

    r40854 r44711  
    4141        int32_t branchOffset;
    4242#if ENABLE(JIT)
    43         MacroAssembler::CodeLocationLabel ctiOffset;
     43        CodeLocationLabel ctiOffset;
    4444#endif
    4545    };
     
    4949        StringOffsetTable offsetTable;
    5050#if ENABLE(JIT)
    51         MacroAssembler::CodeLocationLabel ctiDefault; // FIXME: it should not be necessary to store this.
     51        CodeLocationLabel ctiDefault; // FIXME: it should not be necessary to store this.
    5252#endif
    5353
     
    6262
    6363#if ENABLE(JIT)
    64         inline MacroAssembler::CodeLocationLabel ctiForValue(UString::Rep* value)
     64        inline CodeLocationLabel ctiForValue(UString::Rep* value)
    6565        {
    6666            StringOffsetTable::const_iterator end = offsetTable.end();
     
    7878        int32_t min;
    7979#if ENABLE(JIT)
    80         Vector<MacroAssembler::CodeLocationLabel> ctiOffsets;
    81         MacroAssembler::CodeLocationLabel ctiDefault;
     80        Vector<CodeLocationLabel> ctiOffsets;
     81        CodeLocationLabel ctiDefault;
    8282#endif
    8383
     
    9090
    9191#if ENABLE(JIT)
    92         inline MacroAssembler::CodeLocationLabel ctiForValue(int32_t value)
     92        inline CodeLocationLabel ctiForValue(int32_t value)
    9393        {
    9494            if (value >= min && static_cast<uint32_t>(value - min) < ctiOffsets.size())
  • trunk/JavaScriptCore/bytecode/StructureStubInfo.h

    r40846 r44711  
    145145        } u;
    146146
    147         MacroAssembler::CodeLocationLabel stubRoutine;
    148         MacroAssembler::CodeLocationCall callReturnLocation;
    149         MacroAssembler::CodeLocationLabel hotPathBegin;
     147        CodeLocationLabel stubRoutine;
     148        CodeLocationCall callReturnLocation;
     149        CodeLocationLabel hotPathBegin;
    150150    };
    151151
Note: See TracChangeset for help on using the changeset viewer.