Ignore:
Timestamp:
Jun 23, 2009, 7:47:48 PM (16 years ago)
Author:
[email protected]
Message:

<rdar://problem/6992806> REGRESSION: Enumeration can skip new properties in cases of prototypes that have more than 64 (26593)
<https://bugs.webkit.org/show_bug.cgi?id=26593>

Reviewed by Gavin Barraclough.

Add tests to ensure we correctly invalidate caching that depends on structure chains
that include dictionaries.

File:
1 edited

Legend:

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

    r44889 r45039  
    384384    if (slot.type() == PutPropertySlot::NewProperty) {
    385385        StructureChain* prototypeChain = structure->prototypeChain(callFrame);
     386        if (!prototypeChain->isCacheable()) {
     387            ctiPatchCallByReturnAddress(returnAddress, FunctionPtr(JITStubs::cti_op_put_by_id_generic));
     388            return;
     389        }
    386390        stubInfo->initPutByIdTransition(structure->previousID(), structure, prototypeChain);
    387391        JIT::compilePutByIdTransition(callFrame->scopeChain()->globalData, codeBlock, stubInfo, structure->previousID(), structure, slot.cachedOffset(), prototypeChain, returnAddress);
     
    471475
    472476    StructureChain* prototypeChain = structure->prototypeChain(callFrame);
     477    if (!prototypeChain->isCacheable()) {
     478        ctiPatchCallByReturnAddress(returnAddress, FunctionPtr(JITStubs::cti_op_get_by_id_generic));
     479        return;
     480    }
    473481    stubInfo->initGetByIdChain(structure, prototypeChain);
    474482    JIT::compileGetByIdChain(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, structure, prototypeChain, count, slot.cachedOffset(), returnAddress);
     
    10441052            ctiPatchCallByReturnAddress(STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_proto_list_full));
    10451053    } else if (size_t count = countPrototypeChainEntriesAndCheckForProxies(callFrame, baseValue, slot)) {
     1054        StructureChain* protoChain = structure->prototypeChain(callFrame);
     1055        if (!protoChain->isCacheable()) {
     1056            ctiPatchCallByReturnAddress(STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_proto_fail));
     1057            return JSValue::encode(result);
     1058        }
     1059       
    10461060        int listIndex;
    10471061        PolymorphicAccessStructureList* prototypeStructureList = getPolymorphicAccessStructureListSlot(stubInfo, listIndex);
    1048         JIT::compileGetByIdChainList(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, prototypeStructureList, listIndex, structure, structure->prototypeChain(callFrame), count, slot.cachedOffset());
     1062        JIT::compileGetByIdChainList(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, prototypeStructureList, listIndex, structure, protoChain, count, slot.cachedOffset());
    10491063
    10501064        if (listIndex == (POLYMORPHIC_LIST_CACHE_SIZE - 1))
Note: See TracChangeset for help on using the changeset viewer.