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/JSObject.h

    r44445 r44757  
    204204        }
    205205
    206     protected:
    207         bool getOwnPropertySlotForWrite(ExecState*, const Identifier&, PropertySlot&, bool& slotIsWriteable);
    208 
    209206    private:
    210207        ConstPropertyStorage propertyStorage() const { return (isUsingInlineStorage() ? m_inlineStorage : m_externalStorage); }
     
    323320    if (propertyName == exec->propertyNames().underscoreProto) {
    324321        slot.setValue(prototype());
    325         return true;
    326     }
    327 
    328     return false;
    329 }
    330 
    331 ALWAYS_INLINE bool JSObject::getOwnPropertySlotForWrite(ExecState* exec, const Identifier& propertyName, PropertySlot& slot, bool& slotIsWriteable)
    332 {
    333     unsigned attributes;
    334     if (JSValue* location = getDirectLocation(propertyName, attributes)) {
    335         if (m_structure->hasGetterSetterProperties() && location[0].isGetterSetter()) {
    336             slotIsWriteable = false;
    337             fillGetterPropertySlot(slot, location);
    338         } else {
    339             slotIsWriteable = !(attributes & ReadOnly);
    340             slot.setValueSlot(this, location, offsetForLocation(location));
    341         }
    342         return true;
    343     }
    344 
    345     // non-standard Netscape extension
    346     if (propertyName == exec->propertyNames().underscoreProto) {
    347         slot.setValue(prototype());
    348         slotIsWriteable = false;
    349322        return true;
    350323    }
Note: See TracChangeset for help on using the changeset viewer.