Ignore:
Timestamp:
Jan 15, 2010, 12:48:52 PM (15 years ago)
Author:
[email protected]
Message:

2010-01-14 Geoffrey Garen <[email protected]>

Reviewed by Oliver Hunt.

REGRESISON: Google maps buttons not working properly
https://bugs.webkit.org/show_bug.cgi?id=31871

REGRESSION(r52948): JavaScript exceptions thrown on Google Maps when
getting directions for a second time
https://bugs.webkit.org/show_bug.cgi?id=33446


SunSpider and v8 report no change.

  • interpreter/Interpreter.cpp: (JSC::Interpreter::tryCacheGetByID): Update our cached offset in case flattening the dictionary changed any of its offsets.
  • jit/JITStubs.cpp: (JSC::JITThunks::tryCacheGetByID): (JSC::DEFINE_STUB_FUNCTION):
  • runtime/Operations.h: (JSC::normalizePrototypeChain): ditto

2010-01-15 Geoffrey Garen <[email protected]>

Reviewed by Oliver Hunt.

REGRESISON: Google maps buttons not working properly
https://bugs.webkit.org/show_bug.cgi?id=31871

REGRESSION(r52948): JavaScript exceptions thrown on Google Maps when
getting directions for a second time
https://bugs.webkit.org/show_bug.cgi?id=33446


Added a test for these bugs.

  • fast/js/pic/undictionary-expected.txt: Added.
  • fast/js/pic/undictionary.html: Added.
File:
1 edited

Legend:

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

    r53151 r53341  
    890890
    891891        JSObject* slotBaseObject = asObject(slot.slotBase());
    892 
     892        size_t offset = slot.cachedOffset();
     893       
    893894        // Since we're accessing a prototype in a loop, it's a good bet that it
    894895        // should not be treated as a dictionary.
    895         if (slotBaseObject->structure()->isDictionary())
     896        if (slotBaseObject->structure()->isDictionary()) {
    896897            slotBaseObject->flattenDictionaryObject();
     898            offset = slotBaseObject->structure()->get(propertyName);
     899        }
    897900       
    898901        stubInfo->initGetByIdProto(structure, slotBaseObject->structure());
     
    900903        ASSERT(!structure->isDictionary());
    901904        ASSERT(!slotBaseObject->structure()->isDictionary());
    902         JIT::compileGetByIdProto(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, structure, slotBaseObject->structure(), slot.cachedOffset(), returnAddress);
     905        JIT::compileGetByIdProto(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, structure, slotBaseObject->structure(), offset, returnAddress);
    903906        return;
    904907    }
    905908
    906     size_t count = normalizePrototypeChain(callFrame, baseValue, slot.slotBase());
     909    size_t offset = slot.cachedOffset();
     910    size_t count = normalizePrototypeChain(callFrame, baseValue, slot.slotBase(), propertyName, offset);
    907911    if (!count) {
    908912        stubInfo->accessType = access_get_by_id_generic;
     
    912916    StructureChain* prototypeChain = structure->prototypeChain(callFrame);
    913917    stubInfo->initGetByIdChain(structure, prototypeChain);
    914     JIT::compileGetByIdChain(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, structure, prototypeChain, count, slot.cachedOffset(), returnAddress);
     918    JIT::compileGetByIdChain(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, structure, prototypeChain, count, offset, returnAddress);
    915919}
    916920
     
    14371441
    14381442    CallFrame* callFrame = stackFrame.callFrame;
     1443    const Identifier& propertyName = stackFrame.args[1].identifier();
    14391444
    14401445    JSValue baseValue = stackFrame.args[0].jsValue();
    14411446    PropertySlot slot(baseValue);
    1442     JSValue result = baseValue.get(callFrame, stackFrame.args[1].identifier(), slot);
     1447    JSValue result = baseValue.get(callFrame, propertyName, slot);
    14431448
    14441449    CHECK_FOR_EXCEPTION();
     
    14551460    ASSERT(slot.slotBase().isObject());
    14561461    JSObject* slotBaseObject = asObject(slot.slotBase());
     1462   
     1463    size_t offset = slot.cachedOffset();
    14571464
    14581465    if (slot.slotBase() == baseValue)
     
    14621469        // Since we're accessing a prototype in a loop, it's a good bet that it
    14631470        // should not be treated as a dictionary.
    1464         if (slotBaseObject->structure()->isDictionary())
     1471        if (slotBaseObject->structure()->isDictionary()) {
    14651472            slotBaseObject->flattenDictionaryObject();
     1473            offset = slotBaseObject->structure()->get(propertyName);
     1474        }
    14661475
    14671476        int listIndex;
    14681477        PolymorphicAccessStructureList* prototypeStructureList = getPolymorphicAccessStructureListSlot(stubInfo, listIndex);
    14691478
    1470         JIT::compileGetByIdProtoList(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, prototypeStructureList, listIndex, structure, slotBaseObject->structure(), slot.cachedOffset());
     1479        JIT::compileGetByIdProtoList(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, prototypeStructureList, listIndex, structure, slotBaseObject->structure(), offset);
    14711480
    14721481        if (listIndex == (POLYMORPHIC_LIST_CACHE_SIZE - 1))
    14731482            ctiPatchCallByReturnAddress(codeBlock, STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_proto_list_full));
    1474     } else if (size_t count = normalizePrototypeChain(callFrame, baseValue, slot.slotBase())) {
     1483    } else if (size_t count = normalizePrototypeChain(callFrame, baseValue, slot.slotBase(), propertyName, offset)) {
    14751484        ASSERT(!asCell(baseValue)->structure()->isDictionary());
    14761485        int listIndex;
     
    14781487
    14791488        StructureChain* protoChain = structure->prototypeChain(callFrame);
    1480         JIT::compileGetByIdChainList(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, prototypeStructureList, listIndex, structure, protoChain, count, slot.cachedOffset());
     1489        JIT::compileGetByIdChainList(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, prototypeStructureList, listIndex, structure, protoChain, count, offset);
    14811490
    14821491        if (listIndex == (POLYMORPHIC_LIST_CACHE_SIZE - 1))
Note: See TracChangeset for help on using the changeset viewer.