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):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/jit/JITStubs.cpp

    r44705 r44711  
    932932        if (stubInfo->opcodeID == op_get_by_id_self) {
    933933            ASSERT(!stubInfo->stubRoutine);
    934             polymorphicStructureList = new PolymorphicAccessStructureList(MacroAssembler::CodeLocationLabel(), stubInfo->u.getByIdSelf.baseObjectStructure);
     934            polymorphicStructureList = new PolymorphicAccessStructureList(CodeLocationLabel(), stubInfo->u.getByIdSelf.baseObjectStructure);
    935935            stubInfo->initGetByIdSelfList(polymorphicStructureList, 2);
    936936        } else {
     
    958958    case op_get_by_id_proto:
    959959        prototypeStructureList = new PolymorphicAccessStructureList(stubInfo->stubRoutine, stubInfo->u.getByIdProto.baseObjectStructure, stubInfo->u.getByIdProto.prototypeStructure);
    960         stubInfo->stubRoutine.reset();
     960        stubInfo->stubRoutine = CodeLocationLabel();
    961961        stubInfo->initGetByIdProtoList(prototypeStructureList, 2);
    962962        break;
    963963    case op_get_by_id_chain:
    964964        prototypeStructureList = new PolymorphicAccessStructureList(stubInfo->stubRoutine, stubInfo->u.getByIdChain.baseObjectStructure, stubInfo->u.getByIdChain.chain);
    965         stubInfo->stubRoutine.reset();
     965        stubInfo->stubRoutine = CodeLocationLabel();
    966966        stubInfo->initGetByIdProtoList(prototypeStructureList, 2);
    967967        break;
     
    23342334
    23352335    stackFrame.callFrame = callFrame;
    2336     void* catchRoutine = handler->nativeCode.addressForExceptionHandler();
     2336    void* catchRoutine = handler->nativeCode.executableAddress();
    23372337    ASSERT(catchRoutine);
    23382338    STUB_SET_RETURN_ADDRESS(catchRoutine);
     
    25422542
    25432543    if (scrutinee.isInt32Fast())
    2544         return codeBlock->immediateSwitchJumpTable(tableIndex).ctiForValue(scrutinee.getInt32Fast()).addressForSwitch();
     2544        return codeBlock->immediateSwitchJumpTable(tableIndex).ctiForValue(scrutinee.getInt32Fast()).executableAddress();
    25452545    else {
    25462546        double value;
    25472547        int32_t intValue;
    25482548        if (scrutinee.getNumber(value) && ((intValue = static_cast<int32_t>(value)) == value))
    2549             return codeBlock->immediateSwitchJumpTable(tableIndex).ctiForValue(intValue).addressForSwitch();
     2549            return codeBlock->immediateSwitchJumpTable(tableIndex).ctiForValue(intValue).executableAddress();
    25502550        else
    2551             return codeBlock->immediateSwitchJumpTable(tableIndex).ctiDefault.addressForSwitch();
     2551            return codeBlock->immediateSwitchJumpTable(tableIndex).ctiDefault.executableAddress();
    25522552    }
    25532553}
     
    25622562    CodeBlock* codeBlock = callFrame->codeBlock();
    25632563
    2564     void* result = codeBlock->characterSwitchJumpTable(tableIndex).ctiDefault.addressForSwitch();
     2564    void* result = codeBlock->characterSwitchJumpTable(tableIndex).ctiDefault.executableAddress();
    25652565
    25662566    if (scrutinee.isString()) {
    25672567        UString::Rep* value = asString(scrutinee)->value().rep();
    25682568        if (value->size() == 1)
    2569             result = codeBlock->characterSwitchJumpTable(tableIndex).ctiForValue(value->data()[0]).addressForSwitch();
     2569            result = codeBlock->characterSwitchJumpTable(tableIndex).ctiForValue(value->data()[0]).executableAddress();
    25702570    }
    25712571
     
    25822582    CodeBlock* codeBlock = callFrame->codeBlock();
    25832583
    2584     void* result = codeBlock->stringSwitchJumpTable(tableIndex).ctiDefault.addressForSwitch();
     2584    void* result = codeBlock->stringSwitchJumpTable(tableIndex).ctiDefault.executableAddress();
    25852585
    25862586    if (scrutinee.isString()) {
    25872587        UString::Rep* value = asString(scrutinee)->value().rep();
    2588         result = codeBlock->stringSwitchJumpTable(tableIndex).ctiForValue(value).addressForSwitch();
     2588        result = codeBlock->stringSwitchJumpTable(tableIndex).ctiForValue(value).executableAddress();
    25892589    }
    25902590
     
    26902690
    26912691    stackFrame.callFrame = callFrame;
    2692     void* catchRoutine = handler->nativeCode.addressForExceptionHandler();
     2692    void* catchRoutine = handler->nativeCode.executableAddress();
    26932693    ASSERT(catchRoutine);
    26942694    STUB_SET_RETURN_ADDRESS(catchRoutine);
Note: See TracChangeset for help on using the changeset viewer.