Ignore:
Timestamp:
Jun 17, 2009, 2:11:05 AM (16 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

2009-06-17 Gavin Barraclough <[email protected]>

Reviewed by Oliver Hunt.

<rdar://problem/6974175> ASSERT in JITStubs.cpp at appsaccess.apple.com

Remove PropertySlot::putValue - PropertySlots should only be used for getting,
not putting. Rename JSGlobalObject::getOwnPropertySlot to hasOwnPropertyForWrite,
which is what it really was being used to ask, and remove some other getOwnPropertySlot
& getOwnPropertySlotForWrite methods, which were unused and likely to lead to confusion.

  • runtime/JSGlobalObject.h: (JSC::JSGlobalObject::hasOwnPropertyForWrite):
  • runtime/JSObject.h:
  • runtime/JSStaticScopeObject.cpp:
  • runtime/JSStaticScopeObject.h:
  • runtime/PropertySlot.h:

WebCore:

2009-06-17 Gavin Barraclough <[email protected]>

Reviewed by Oliver Hunt.

<rdar://problem/6974175> ASSERT in JITStubs.cpp at appsaccess.apple.com

JSDOMWindowCustom was using PropertySlot::putValue, however this interface
appears to be fundaementally incorrect - PropertySlots are only used to get
values, all puts use PutPropertySlot. However PutPropertySlot cannot be
used in the fashion desired here - it only reports the caching type of a
write that has been performed.

(This caused a bug where the put should have triggered a transition, and
failed to do so.)

Removing the faulty case from the optimization leads to a ~0.5% progression
on in-browser SunSpider (presumably the very first case was not being hit
often, and the simplification here is beneficial).

  • bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::put):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSGlobalObject.h

    r44076 r44757  
    170170
    171171        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
    172         virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&, bool& slotIsWriteable);
     172        virtual bool hasOwnPropertyForWrite(ExecState*, const Identifier&);
    173173        virtual void put(ExecState*, const Identifier&, JSValue, PutPropertySlot&);
    174174        virtual void putWithAttributes(ExecState*, const Identifier& propertyName, JSValue value, unsigned attributes);
     
    326326    }
    327327
    328     inline bool JSGlobalObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot, bool& slotIsWriteable)
    329     {
    330         if (JSVariableObject::getOwnPropertySlotForWrite(exec, propertyName, slot, slotIsWriteable))
     328    inline bool JSGlobalObject::hasOwnPropertyForWrite(ExecState* exec, const Identifier& propertyName)
     329    {
     330        PropertySlot slot;
     331        if (JSVariableObject::getOwnPropertySlot(exec, propertyName, slot))
    331332            return true;
     333        bool slotIsWriteable;
    332334        return symbolTableGet(propertyName, slot, slotIsWriteable);
    333335    }
Note: See TracChangeset for help on using the changeset viewer.