Ignore:
Timestamp:
Dec 23, 2013, 4:11:25 PM (12 years ago)
Author:
[email protected]
Message:

Refactor PutPropertySlot to be aware of custom properties
https://bugs.webkit.org/show_bug.cgi?id=126187

Reviewed by msaboff.

Source/JavaScriptCore:

Refactor PutPropertySlot, making the constructor take the thisValue
used as a target. This results in a wide range of boilerplate changes
to pass the new parameter.

  • API/JSObjectRef.cpp:

(JSObjectSetProperty):

  • dfg/DFGOperations.cpp:

(JSC::DFG::operationPutByValInternal):

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::execute):

  • jit/JITOperations.cpp:
  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • runtime/Arguments.cpp:

(JSC::Arguments::putByIndex):

  • runtime/ArrayPrototype.cpp:

(JSC::putProperty):
(JSC::arrayProtoFuncPush):

  • runtime/JSCJSValue.cpp:

(JSC::JSValue::putToPrimitiveByIndex):

  • runtime/JSCell.cpp:

(JSC::JSCell::putByIndex):

  • runtime/JSFunction.cpp:

(JSC::JSFunction::put):

  • runtime/JSGenericTypedArrayViewInlines.h:

(JSC::JSGenericTypedArrayView<Adaptor>::putByIndex):

  • runtime/JSONObject.cpp:

(JSC::Walker::walk):

  • runtime/JSObject.cpp:

(JSC::JSObject::putByIndex):
(JSC::JSObject::putDirectNonIndexAccessor):
(JSC::JSObject::deleteProperty):

  • runtime/JSObject.h:

(JSC::JSObject::putDirect):

  • runtime/Lookup.h:

(JSC::putEntry):
(JSC::lookupPut):

  • runtime/PutPropertySlot.h:

(JSC::PutPropertySlot::PutPropertySlot):
(JSC::PutPropertySlot::setCustomProperty):
(JSC::PutPropertySlot::thisValue):
(JSC::PutPropertySlot::isCacheable):

Source/WebCore:

Update the bindings code generation and custom objects
to the new function signatures

  • bindings/js/JSDOMWindowCustom.cpp:

(WebCore::JSDOMWindow::put):

  • bindings/objc/WebScriptObject.mm:

(-[WebScriptObject setValue:forKey:]):

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateImplementation):

  • bindings/scripts/test/JS/JSTestInterface.cpp:

(WebCore::JSTestInterface::putByIndex):

  • bridge/NP_jsobject.cpp:

(_NPN_SetProperty):

Source/WebKit/mac:

Update for new method signatures.

  • Plugins/Hosted/NetscapePluginInstanceProxy.mm:

(WebKit::NetscapePluginInstanceProxy::setProperty):

Source/WebKit2:

Update for new method signatures.

  • WebProcess/Plugins/Netscape/NPJSObject.cpp:

(WebKit::NPJSObject::setProperty):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/PutPropertySlot.h

    r154199 r161033  
    2828#define PutPropertySlot_h
    2929
     30#include "JSCJSValue.h"
     31
    3032#include <wtf/Assertions.h>
    3133
     
    3739    class PutPropertySlot {
    3840    public:
    39         enum Type { Uncachable, ExistingProperty, NewProperty };
     41        enum Type { Uncachable, ExistingProperty, NewProperty, CustomProperty };
    4042        enum Context { UnknownContext, PutById, PutByIdEval };
     43        typedef void (*PutValueFunc)(ExecState*, EncodedJSValue base, EncodedJSValue value);
    4144
    42         PutPropertySlot(bool isStrictMode = false, Context context = UnknownContext)
     45        PutPropertySlot(JSValue thisValue, bool isStrictMode = false, Context context = UnknownContext)
    4346            : m_type(Uncachable)
    4447            , m_base(0)
     48            , m_thisValue(thisValue)
    4549            , m_isStrictMode(isStrictMode)
    4650            , m_context(context)
     51            , m_putFunction(nullptr)
    4752        {
    4853        }
     
    6166            m_offset = offset;
    6267        }
     68
     69        void setCustomProperty(JSObject* base, PutValueFunc function)
     70        {
     71            m_type = CustomProperty;
     72            m_base = base;
     73            m_putFunction = function;
     74        }
    6375       
    6476        Context context() const { return static_cast<Context>(m_context); }
     
    6678        Type type() const { return m_type; }
    6779        JSObject* base() const { return m_base; }
     80        JSValue thisValue() const { return m_thisValue; }
    6881
    6982        bool isStrictMode() const { return m_isStrictMode; }
    70         bool isCacheable() const { return m_type != Uncachable; }
     83        bool isCacheable() const { return m_type != Uncachable && m_type != CustomProperty; }
    7184        PropertyOffset cachedOffset() const
    7285        {
     
    7891        Type m_type;
    7992        JSObject* m_base;
     93        JSValue m_thisValue;
    8094        PropertyOffset m_offset;
    8195        bool m_isStrictMode;
    8296        uint8_t m_context;
     97        PutValueFunc m_putFunction;
     98
    8399    };
    84100
Note: See TracChangeset for help on using the changeset viewer.