Ignore:
Timestamp:
Dec 8, 2008, 9:27:10 PM (16 years ago)
Author:
[email protected]
Message:

2008-12-08 Sam Weinig <[email protected]>

Reviewed by Cameron Zwarich.

Fix for <rdar://problem/6428332> Remove the CTI return address table from CodeBlock

Step 1:

Remove use of jitReturnAddressVPCMap when looking for vPC to store Structures
in for cached lookup. Instead, use the offset in the StructureStubInfo that is
already required.

  • bytecode/CodeBlock.cpp: (JSC::CodeBlock::dumpStatistics): Fix extraneous semicolon.
  • interpreter/Interpreter.cpp: (JSC::Interpreter::tryCTICachePutByID): (JSC::Interpreter::tryCTICacheGetByID): (JSC::Interpreter::cti_op_get_by_id_self_fail): (JSC::Interpreter::cti_op_get_by_id_proto_list):
  • jit/JIT.h: (JSC::JIT::compileGetByIdSelf): (JSC::JIT::compileGetByIdProto): (JSC::JIT::compileGetByIdChain): (JSC::JIT::compilePutByIdReplace): (JSC::JIT::compilePutByIdTransition):
  • jit/JITPropertyAccess.cpp: (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::patchGetByIdSelf): (JSC::JIT::patchPutByIdReplace): (JSC::JIT::privateCompilePatchGetArrayLength): Remove extra call to getStubInfo. (JSC::JIT::privateCompileGetByIdSelf): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdChain): (JSC::JIT::privateCompilePutByIdReplace):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/interpreter/Interpreter.cpp

    r39083 r39123  
    40824082    }
    40834083
    4084     // In the interpreter the last structure is trapped here; in CTI we use the
    4085     // *_second method to achieve a similar (but not quite the same) effect.
    4086 
    4087     unsigned vPCIndex = codeBlock->jitReturnAddressVPCMap().get(returnAddress);
    4088     Instruction* vPC = codeBlock->instructions().begin() + vPCIndex;
    4089 
    4090     // Cache hit: Specialize instruction and ref Structures.
    4091 
    40924084    // If baseCell != base, then baseCell must be a proxy for another object.
    40934085    if (baseCell != slot.base()) {
     
    40954087        return;
    40964088    }
     4089
     4090    StructureStubInfo* stubInfo = &codeBlock->getStubInfo(returnAddress);
     4091    Instruction* vPC = codeBlock->instructions().begin() + stubInfo->bytecodeIndex;
     4092
     4093    // Cache hit: Specialize instruction and ref Structures.
    40974094
    40984095    // Structure transition, cache transition info
     
    41134110        vPC[7] = slot.cachedOffset();
    41144111        codeBlock->refStructures(vPC);
    4115         JIT::compilePutByIdTransition(callFrame->scopeChain()->globalData, codeBlock, structure->previousID(), structure, slot.cachedOffset(), chain, returnAddress);
     4112        JIT::compilePutByIdTransition(callFrame->scopeChain()->globalData, codeBlock, stubInfo, structure->previousID(), structure, slot.cachedOffset(), chain, returnAddress);
    41164113        return;
    41174114    }
     
    41244121#if USE(CTI_REPATCH_PIC)
    41254122    UNUSED_PARAM(callFrame);
    4126     JIT::patchPutByIdReplace(codeBlock, structure, slot.cachedOffset(), returnAddress);
     4123    JIT::patchPutByIdReplace(stubInfo, structure, slot.cachedOffset(), returnAddress);
    41274124#else
    4128     JIT::compilePutByIdReplace(callFrame->scopeChain()->globalData, callFrame, codeBlock, structure, slot.cachedOffset(), returnAddress);
     4125    JIT::compilePutByIdReplace(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, structure, slot.cachedOffset(), returnAddress);
    41294126#endif
    41304127}
     
    41734170    // *_second method to achieve a similar (but not quite the same) effect.
    41744171
    4175     unsigned vPCIndex = codeBlock->jitReturnAddressVPCMap().get(returnAddress);
    4176     Instruction* vPC = codeBlock->instructions().begin() + vPCIndex;
     4172    StructureStubInfo* stubInfo = &codeBlock->getStubInfo(returnAddress);
     4173    Instruction* vPC = codeBlock->instructions().begin() + stubInfo->bytecodeIndex;
    41774174
    41784175    // Cache hit: Specialize instruction and ref Structures.
     
    41864183       
    41874184#if USE(CTI_REPATCH_PIC)
    4188         JIT::patchGetByIdSelf(codeBlock, structure, slot.cachedOffset(), returnAddress);
     4185        JIT::patchGetByIdSelf(stubInfo, structure, slot.cachedOffset(), returnAddress);
    41894186#else
    4190         JIT::compileGetByIdSelf(callFrame->scopeChain()->globalData, callFrame, codeBlock, structure, slot.cachedOffset(), returnAddress);
     4187        JIT::compileGetByIdSelf(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, structure, slot.cachedOffset(), returnAddress);
    41914188#endif
    41924189        return;
     
    42124209        codeBlock->refStructures(vPC);
    42134210
    4214         JIT::compileGetByIdProto(callFrame->scopeChain()->globalData, callFrame, codeBlock, structure, slotBaseObject->structure(), slot.cachedOffset(), returnAddress);
     4211        JIT::compileGetByIdProto(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, structure, slotBaseObject->structure(), slot.cachedOffset(), returnAddress);
    42154212        return;
    42164213    }
     
    42344231    codeBlock->refStructures(vPC);
    42354232
    4236     JIT::compileGetByIdChain(callFrame->scopeChain()->globalData, callFrame, codeBlock, structure, chain, count, slot.cachedOffset(), returnAddress);
     4233    JIT::compileGetByIdChain(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, structure, chain, count, slot.cachedOffset(), returnAddress);
    42374234}
    42384235
     
    45804577
    45814578        CodeBlock* codeBlock = callFrame->codeBlock();
    4582         unsigned vPCIndex = codeBlock->jitReturnAddressVPCMap().get(CTI_RETURN_ADDRESS);
    4583         Instruction* vPC = codeBlock->instructions().begin() + vPCIndex;
     4579        StructureStubInfo* stubInfo = &codeBlock->getStubInfo(CTI_RETURN_ADDRESS);
     4580        Instruction* vPC = codeBlock->instructions().begin() + stubInfo->bytecodeIndex;
    45844581
    45854582        ASSERT(slot.slotBase()->isObject());
    4586 
    4587         StructureStubInfo* stubInfo = &codeBlock->getStubInfo(CTI_RETURN_ADDRESS);
    45884583
    45894584        PolymorphicAccessStructureList* polymorphicStructureList;
     
    46644659    Structure* structure = asCell(baseValue)->structure();
    46654660    CodeBlock* codeBlock = callFrame->codeBlock();
    4666     Instruction* vPC = codeBlock->instructions().begin() + codeBlock->jitReturnAddressVPCMap().get(CTI_RETURN_ADDRESS);
     4661    StructureStubInfo* stubInfo = &codeBlock->getStubInfo(CTI_RETURN_ADDRESS);
     4662    Instruction* vPC = codeBlock->instructions().begin() + stubInfo->bytecodeIndex;
    46674663
    46684664    ASSERT(slot.slotBase()->isObject());
     
    46804676        }
    46814677
    4682         StructureStubInfo* stubInfo = &codeBlock->getStubInfo(CTI_RETURN_ADDRESS);
    46834678        int listIndex;
    46844679        PolymorphicAccessStructureList* prototypeStructureList = getPolymorphicAccessStructureListSlot(ARG_globalData->interpreter, stubInfo, vPC, listIndex);
     
    46944689        ASSERT(chain);
    46954690
    4696         StructureStubInfo* stubInfo = &codeBlock->getStubInfo(CTI_RETURN_ADDRESS);
    46974691        int listIndex;
    46984692        PolymorphicAccessStructureList* prototypeStructureList = getPolymorphicAccessStructureListSlot(ARG_globalData->interpreter, stubInfo, vPC, listIndex);
Note: See TracChangeset for help on using the changeset viewer.