Ignore:
Timestamp:
May 11, 2009, 2:49:43 PM (16 years ago)
Author:
[email protected]
Message:

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

Reviewed by Geoffrey "1" Garen.

Rip out the !USE(CTI_REPATCH_PIC) code. It was untested and unused.

  • jit/JIT.h: (JSC::JIT::compileGetByIdChainList): (JSC::JIT::compileGetByIdChain): (JSC::JIT::compileCTIMachineTrampolines):
  • jit/JITPropertyAccess.cpp: (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain):
  • jit/JITStubs.cpp: (JSC::JITStubs::tryCachePutByID): (JSC::JITStubs::tryCacheGetByID):
File:
1 edited

Legend:

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

    r43481 r43516  
    395395}
    396396
    397 void JIT::privateCompileGetByIdSelf(StructureStubInfo* stubInfo, Structure* structure, size_t cachedOffset, ProcessorReturnAddress returnAddress)
    398 {
    399     // Check eax is an object of the right Structure.
    400     Jump failureCases1 = emitJumpIfNotJSCell(regT0);
    401     Jump failureCases2 = checkStructure(regT0, structure);
    402 
    403     // Checks out okay! - getDirectOffset
    404     compileGetDirectOffset(regT0, regT0, structure, cachedOffset);
    405     ret();
    406 
    407     Call failureCases1Call = makeTailRecursiveCall(failureCases1);
    408     Call failureCases2Call = makeTailRecursiveCall(failureCases2);
    409 
    410     void* code = m_assembler.executableCopy(m_codeBlock->executablePool());
    411     PatchBuffer patchBuffer(code);
    412 
    413     patchBuffer.link(failureCases1Call, JITStubs::cti_op_get_by_id_self_fail);
    414     patchBuffer.link(failureCases2Call, JITStubs::cti_op_get_by_id_self_fail);
    415 
    416     stubInfo->stubRoutine = patchBuffer.entry();
    417 
    418     returnAddress.relinkCallerToFunction(code);
    419 }
    420 
    421397void JIT::privateCompileGetByIdProto(StructureStubInfo* stubInfo, Structure* structure, Structure* prototypeStructure, size_t cachedOffset, ProcessorReturnAddress returnAddress, CallFrame* callFrame)
    422398{
    423 #if USE(CTI_REPATCH_PIC)
    424399    // We don't want to patch more than once - in future go to cti_op_put_by_id_generic.
    425400    returnAddress.relinkCallerToFunction(JITStubs::cti_op_get_by_id_proto_list);
     
    464439    CodeLocationJump jumpLocation = stubInfo->hotPathBegin.jumpAtOffset(patchOffsetGetByIdBranchToSlowCase);
    465440    jumpLocation.relink(entryLabel);
    466 #else
    467     // The prototype object definitely exists (if this stub exists the CodeBlock is referencing a Structure that is
    468     // referencing the prototype object - let's speculatively load it's table nice and early!)
    469     JSObject* protoObject = asObject(structure->prototypeForLookup(callFrame));
    470 
    471     // Check eax is an object of the right Structure.
    472     Jump failureCases1 = emitJumpIfNotJSCell(regT0);
    473     Jump failureCases2 = checkStructure(regT0, structure);
    474 
    475     // Check the prototype object's Structure had not changed.
    476     Structure** prototypeStructureAddress = &(protoObject->m_structure);
    477     Jump failureCases3 = branchPtr(NotEqual, AbsoluteAddress(prototypeStructureAddress), ImmPtr(prototypeStructure));
    478 
    479     // Checks out okay! - getDirectOffset
    480     compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset);
    481 
    482     ret();
    483 
    484     void* code = m_assembler.executableCopy(m_codeBlock->executablePool());
    485     PatchBuffer patchBuffer(code);
    486 
    487     patchBuffer.link(failureCases1, JITStubs::cti_op_get_by_id_proto_fail);
    488     patchBuffer.link(failureCases2, JITStubs::cti_op_get_by_id_proto_fail);
    489     patchBuffer.link(failureCases3, JITStubs::cti_op_get_by_id_proto_fail);
    490 
    491     stubInfo->stubRoutine = patchBuffer.entry();
    492 
    493     returnAddress.relinkCallerToFunction(code);
    494 #endif
    495 }
    496 
    497 #if USE(CTI_REPATCH_PIC)
     441}
     442
    498443void JIT::privateCompileGetByIdSelfList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* polymorphicStructures, int currentIndex, Structure* structure, size_t cachedOffset)
    499444{
     
    624569    jumpLocation.relink(entryLabel);
    625570}
    626 #endif
    627571
    628572void JIT::privateCompileGetByIdChain(StructureStubInfo* stubInfo, Structure* structure, StructureChain* chain, size_t count, size_t cachedOffset, ProcessorReturnAddress returnAddress, CallFrame* callFrame)
    629573{
    630 #if USE(CTI_REPATCH_PIC)
    631574    // We don't want to patch more than once - in future go to cti_op_put_by_id_generic.
    632575    returnAddress.relinkCallerToFunction(JITStubs::cti_op_get_by_id_proto_list);
     
    676619    CodeLocationJump jumpLocation = stubInfo->hotPathBegin.jumpAtOffset(patchOffsetGetByIdBranchToSlowCase);
    677620    jumpLocation.relink(entryLabel);
    678 #else
    679     ASSERT(count);
    680    
    681     JumpList bucketsOfFail;
    682 
    683     // Check eax is an object of the right Structure.
    684     bucketsOfFail.append(emitJumpIfNotJSCell(regT0));
    685     bucketsOfFail.append(checkStructure(regT0, structure));
    686 
    687     Structure* currStructure = structure;
    688     RefPtr<Structure>* chainEntries = chain->head();
    689     JSObject* protoObject = 0;
    690     for (unsigned i = 0; i < count; ++i) {
    691         protoObject = asObject(currStructure->prototypeForLookup(callFrame));
    692         currStructure = chainEntries[i].get();
    693 
    694         // Check the prototype object's Structure had not changed.
    695         Structure** prototypeStructureAddress = &(protoObject->m_structure);
    696 #if PLATFORM(X86_64)
    697         move(ImmPtr(currStructure), regT3);
    698         bucketsOfFail.append(branchPtr(NotEqual, regT3, AbsoluteAddress(prototypeStructureAddress)));
    699 #else
    700         bucketsOfFail.append(branchPtr(NotEqual, AbsoluteAddress(prototypeStructureAddress), ImmPtr(currStructure)));
    701 #endif
    702     }
    703     ASSERT(protoObject);
    704 
    705     compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset);
    706     compilePutDirectOffset(regT0, regT1, structure, cachedOffset);
    707     ret();
    708 
    709     void* code = m_assembler.executableCopy(m_codeBlock->executablePool());
    710 
    711     patchBuffer.link(bucketsOfFail, JITStubs::cti_op_get_by_id_proto_fail);
    712 
    713     stubInfo->stubRoutine = patchBuffer.entry();
    714 
    715     returnAddress.relinkCallerToFunction(code);
    716 #endif
    717 }
    718 
    719 void JIT::privateCompilePutByIdReplace(StructureStubInfo* stubInfo, Structure* structure, size_t cachedOffset, ProcessorReturnAddress returnAddress)
    720 {
    721     // Check eax is an object of the right Structure.
    722     Jump failureCases1 = emitJumpIfNotJSCell(regT0);
    723     Jump failureCases2 = checkStructure(regT0, structure);
    724 
    725     // checks out okay! - putDirectOffset
    726     compilePutDirectOffset(regT0, regT1, structure, cachedOffset);
    727     ret();
    728 
    729     Call failureCases1Call = makeTailRecursiveCall(failureCases1);
    730     Call failureCases2Call = makeTailRecursiveCall(failureCases2);
    731 
    732     void* code = m_assembler.executableCopy(m_codeBlock->executablePool());
    733     PatchBuffer patchBuffer(code);
    734    
    735     patchBuffer.link(failureCases1Call, JITStubs::cti_op_put_by_id_fail);
    736     patchBuffer.link(failureCases2Call, JITStubs::cti_op_put_by_id_fail);
    737 
    738     stubInfo->stubRoutine = patchBuffer.entry();
    739    
    740     returnAddress.relinkCallerToFunction(code);
    741 }
    742 
    743 #endif
     621}
     622
     623#endif // !ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS)
    744624
    745625} // namespace JSC
Note: See TracChangeset for help on using the changeset viewer.