diff options
| author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-25 13:35:59 +0200 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-25 13:35:59 +0200 |
| commit | 79ad030d505ccf79cf10aa9f8189ca3e2f61f6f4 (patch) | |
| tree | 0287b1a69d84492c901e8bc820e635e7133809a0 /Source/JavaScriptCore/runtime/JSObject.h | |
| parent | 682ab87480e7757346802ce7f54cfdbdfeb2339e (diff) | |
| download | qtwebkit-79ad030d505ccf79cf10aa9f8189ca3e2f61f6f4.tar.gz | |
Imported WebKit commit c4b613825abd39ac739a47d7b4410468fcef66dc (http://svn.webkit.org/repository/webkit/trunk@121147)
New snapshot that includes Win32 debug build fix (use SVGAllInOne)
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSObject.h')
| -rw-r--r-- | Source/JavaScriptCore/runtime/JSObject.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Source/JavaScriptCore/runtime/JSObject.h b/Source/JavaScriptCore/runtime/JSObject.h index ac8601deb..fdb708dd9 100644 --- a/Source/JavaScriptCore/runtime/JSObject.h +++ b/Source/JavaScriptCore/runtime/JSObject.h @@ -46,6 +46,15 @@ namespace JSC { return 0; } + JS_EXPORT_PRIVATE JSCell* getCallableObjectSlow(JSCell*); + + inline JSCell* getCallableObject(JSValue value) + { + if (!value.isCell()) + return 0; + return getCallableObjectSlow(value.asCell()); + } + class GetterSetter; class HashEntry; class InternalFunction; @@ -759,20 +768,20 @@ inline bool JSObject::putOwnDataProperty(JSGlobalData& globalData, PropertyName ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(this)); ASSERT(!structure()->hasGetterSetterProperties()); - return putDirectInternal<PutModePut>(globalData, propertyName, value, 0, slot, getJSFunction(value)); + return putDirectInternal<PutModePut>(globalData, propertyName, value, 0, slot, getCallableObject(value)); } inline void JSObject::putDirect(JSGlobalData& globalData, PropertyName propertyName, JSValue value, unsigned attributes) { ASSERT(!value.isGetterSetter() && !(attributes & Accessor)); PutPropertySlot slot; - putDirectInternal<PutModeDefineOwnProperty>(globalData, propertyName, value, attributes, slot, getJSFunction(value)); + putDirectInternal<PutModeDefineOwnProperty>(globalData, propertyName, value, attributes, slot, getCallableObject(value)); } inline void JSObject::putDirect(JSGlobalData& globalData, PropertyName propertyName, JSValue value, PutPropertySlot& slot) { ASSERT(!value.isGetterSetter()); - putDirectInternal<PutModeDefineOwnProperty>(globalData, propertyName, value, 0, slot, getJSFunction(value)); + putDirectInternal<PutModeDefineOwnProperty>(globalData, propertyName, value, 0, slot, getCallableObject(value)); } inline void JSObject::putDirectWithoutTransition(JSGlobalData& globalData, PropertyName propertyName, JSValue value, unsigned attributes) @@ -781,7 +790,7 @@ inline void JSObject::putDirectWithoutTransition(JSGlobalData& globalData, Prope PropertyStorage newStorage = propertyStorage(); if (structure()->shouldGrowPropertyStorage()) newStorage = growPropertyStorage(globalData, structure()->propertyStorageCapacity(), structure()->suggestedNewPropertyStorageSize()); - size_t offset = structure()->addPropertyWithoutTransition(globalData, propertyName, attributes, getJSFunction(value)); + size_t offset = structure()->addPropertyWithoutTransition(globalData, propertyName, attributes, getCallableObject(value)); setPropertyStorage(globalData, newStorage, structure()); putDirectOffset(globalData, offset, value); } |
