Changeset 104899 in webkit


Ignore:
Timestamp:
Jan 12, 2012 10:44:31 PM (12 years ago)
Author:
barraclough@apple.com
Message:

../JavaScriptCore: [Chromium] JSExportMacros.h should be visible.
https://bugs.webkit.org/show_bug.cgi?id=76147

Patch by MORITA Hajime <morrita@google.com> on 2012-01-12
Reviewed by Tony Chang.

  • config.h:

../WebCore: Clean up putDirect (part 2)
https://bugs.webkit.org/show_bug.cgi?id=76232

Reviewed by Sam Weinig.

Rename putWithAttributes to putDirectVirtual.

  • bindings/js/JSDOMWindowShell.cpp:

(WebCore::JSDOMWindowShell::putDirectVirtual):

  • bindings/js/JSDOMWindowShell.h:
Location:
trunk/Source
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSObjectRef.cpp

    r99497 r104899  
    275275
    276276    if (attributes && !jsObject->hasProperty(exec, name))
    277         jsObject->methodTable()->putWithAttributes(jsObject, exec, name, jsValue, attributes);
     277        jsObject->methodTable()->putDirectVirtual(jsObject, exec, name, jsValue, attributes);
    278278    else {
    279279        PutPropertySlot slot;
  • trunk/Source/JavaScriptCore/ChangeLog

    r104897 r104899  
    2828        (WTF::HwndDC::~HwndDC):
    2929        (WTF::HwndDC::operator HDC):
     30
     312012-01-12  Gavin Barraclough  <barraclough@apple.com>
     32
     33        Clean up putDirect (part 2)
     34        https://bugs.webkit.org/show_bug.cgi?id=76232
     35
     36        Reviewed by Sam Weinig.
     37
     38        Rename putWithAttributes to putDirectVirtual, to identify that this
     39        has the same unchecked-DefineOwnProperty behaviour, change putDirectInternal
     40        to be templated on an enum indicating which behaviour it is supposed to be
     41        implementing, and change clients that are defining properties to call
     42        putDirectInternal correctly.
     43
     44        * API/JSObjectRef.cpp:
     45        (JSObjectSetProperty):
     46        * JavaScriptCore.exp:
     47        * debugger/DebuggerActivation.cpp:
     48        (JSC::DebuggerActivation::putDirectVirtual):
     49        * debugger/DebuggerActivation.h:
     50        * interpreter/Interpreter.cpp:
     51        (JSC::Interpreter::execute):
     52        * runtime/ClassInfo.h:
     53        * runtime/Error.cpp:
     54        (JSC::addErrorInfo):
     55        * runtime/JSActivation.cpp:
     56        (JSC::JSActivation::putDirectVirtual):
     57        * runtime/JSActivation.h:
     58        * runtime/JSCell.cpp:
     59        (JSC::JSCell::putDirectVirtual):
     60        * runtime/JSCell.h:
     61        * runtime/JSGlobalObject.cpp:
     62        (JSC::JSGlobalObject::putDirectVirtual):
     63        * runtime/JSGlobalObject.h:
     64        * runtime/JSObject.cpp:
     65        (JSC::JSObject::put):
     66        (JSC::JSObject::putDirectVirtual):
     67        (JSC::JSObject::defineGetter):
     68        (JSC::JSObject::initializeGetterSetterProperty):
     69        (JSC::JSObject::defineSetter):
     70        (JSC::putDescriptor):
     71        * runtime/JSObject.h:
     72        (JSC::JSObject::putDirectInternal):
     73        (JSC::JSObject::putOwnDataProperty):
     74        (JSC::JSObject::putDirect):
     75        * runtime/JSStaticScopeObject.cpp:
     76        (JSC::JSStaticScopeObject::putDirectVirtual):
     77        * runtime/JSStaticScopeObject.h:
     78        * runtime/JSVariableObject.cpp:
     79        (JSC::JSVariableObject::putDirectVirtual):
     80        * runtime/JSVariableObject.h:
    3081
    31822012-01-12  Gavin Barraclough  <barraclough@apple.com>
  • trunk/Source/JavaScriptCore/JavaScriptCore.exp

    r104604 r104899  
    169169__ZN3JSC14JSGlobalObject13visitChildrenEPNS_6JSCellERNS_11SlotVisitorE
    170170__ZN3JSC14JSGlobalObject16addStaticGlobalsEPNS0_18GlobalPropertyInfoEi
    171 __ZN3JSC14JSGlobalObject17putWithAttributesEPNS_8JSObjectEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueEj
     171__ZN3JSC14JSGlobalObject16putDirectVirtualEPNS_8JSObjectEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueEj
    172172__ZN3JSC14JSGlobalObject18getOwnPropertySlotEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
    173173__ZN3JSC14JSGlobalObject24getOwnPropertyDescriptorEPNS_8JSObjectEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
     
    323323__ZN3JSC8JSObject17defineOwnPropertyEPS0_PNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorEb
    324324__ZN3JSC8JSObject17preventExtensionsERNS_12JSGlobalDataE
    325 __ZN3JSC8JSObject17putWithAttributesEPNS_12JSGlobalDataERKNS_10IdentifierENS_7JSValueEj
    326 __ZN3JSC8JSObject17putWithAttributesEPS0_PNS_9ExecStateERKNS_10IdentifierENS_7JSValueEj
     325__ZN3JSC8JSObject16putDirectVirtualEPS0_PNS_9ExecStateERKNS_10IdentifierENS_7JSValueEj
    327326__ZN3JSC8JSObject19getOwnPropertyNamesEPS0_PNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE
    328327__ZN3JSC8JSObject21deletePropertyByIndexEPNS_6JSCellEPNS_9ExecStateEj
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def

    r104744 r104899  
    275275    ?putByIndex@JSByteArray@JSC@@SAXPAVJSCell@2@PAVExecState@2@IVJSValue@2@@Z
    276276    ?putByIndex@JSObject@JSC@@SAXPAVJSCell@2@PAVExecState@2@IVJSValue@2@@Z
    277     ?putDirectInternal@JSObject@JSC@@AAE_NAAVJSGlobalData@2@ABVIdentifier@2@VJSValue@2@I_NAAVPutPropertySlot@2@PAVJSCell@2@@Z
    278     ?putWithAttributes@JSGlobalObject@JSC@@SAXPAVJSObject@2@PAVExecState@2@ABVIdentifier@2@VJSValue@2@I@Z
    279     ?putWithAttributes@JSObject@JSC@@SAXPAV12@PAVExecState@2@ABVIdentifier@2@VJSValue@2@I@Z
     277    ?putDirectVirtual@JSGlobalObject@JSC@@SAXPAVJSObject@2@PAVExecState@2@ABVIdentifier@2@VJSValue@2@I@Z
     278    ?putDirectVirtual@JSObject@JSC@@SAXPAV12@PAVExecState@2@ABVIdentifier@2@VJSValue@2@I@Z
    280279    ?randomNumber@WTF@@YANXZ
    281280    ?recompileAllJSFunctions@Debugger@JSC@@QAEXPAVJSGlobalData@2@@Z
  • trunk/Source/JavaScriptCore/debugger/DebuggerActivation.cpp

    r103083 r104899  
    7878}
    7979
    80 void DebuggerActivation::putWithAttributes(JSObject* object, ExecState* exec, const Identifier& propertyName, JSValue value, unsigned attributes)
     80void DebuggerActivation::putDirectVirtual(JSObject* object, ExecState* exec, const Identifier& propertyName, JSValue value, unsigned attributes)
    8181{
    8282    DebuggerActivation* thisObject = jsCast<DebuggerActivation*>(object);
    83     thisObject->m_activation->methodTable()->putWithAttributes(thisObject->m_activation.get(), exec, propertyName, value, attributes);
     83    thisObject->m_activation->methodTable()->putDirectVirtual(thisObject->m_activation.get(), exec, propertyName, value, attributes);
    8484}
    8585
  • trunk/Source/JavaScriptCore/debugger/DebuggerActivation.h

    r103243 r104899  
    4646        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
    4747        static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
    48         static void putWithAttributes(JSObject*, ExecState*, const Identifier& propertyName, JSValue, unsigned attributes);
     48        static void putDirectVirtual(JSObject*, ExecState*, const Identifier& propertyName, JSValue, unsigned attributes);
    4949        static bool deleteProperty(JSCell*, ExecState*, const Identifier& propertyName);
    5050        static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r104886 r104899  
    906906                    globalObject->methodTable()->put(globalObject, callFrame, JSONPPath[0].m_pathEntryName, JSONPValue, slot);
    907907                } else
    908                     globalObject->methodTable()->putWithAttributes(globalObject, callFrame, JSONPPath[0].m_pathEntryName, JSONPValue, DontEnum | DontDelete);
     908                    globalObject->methodTable()->putDirectVirtual(globalObject, callFrame, JSONPPath[0].m_pathEntryName, JSONPValue, DontEnum | DontDelete);
    909909                // var declarations return undefined
    910910                result = jsUndefined();
  • trunk/Source/JavaScriptCore/runtime/ClassInfo.h

    r103083 r104899  
    8989
    9090        typedef void (*PutWithAttributesFunctionPtr)(JSObject*, ExecState*, const Identifier& propertyName, JSValue, unsigned attributes);
    91         PutWithAttributesFunctionPtr putWithAttributes;
     91        PutWithAttributesFunctionPtr putDirectVirtual;
    9292
    9393        typedef bool (*DefineOwnPropertyFunctionPtr)(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&, bool);
     
    136136        &ClassName::className, \
    137137        &ClassName::hasInstance, \
    138         &ClassName::putWithAttributes, \
     138        &ClassName::putDirectVirtual, \
    139139        &ClassName::defineOwnProperty, \
    140140        &ClassName::getOwnPropertyDescriptor, \
  • trunk/Source/JavaScriptCore/runtime/Error.cpp

    r103958 r104899  
    124124
    125125    if (line != -1)
    126         error->putWithAttributes(globalData, Identifier(globalData, linePropertyName), jsNumber(line), ReadOnly | DontDelete);
     126        error->putDirect(*globalData, Identifier(globalData, linePropertyName), jsNumber(line), ReadOnly | DontDelete);
    127127    if (sourceID != -1)
    128         error->putWithAttributes(globalData, Identifier(globalData, sourceIdPropertyName), jsNumber((double)sourceID), ReadOnly | DontDelete);
     128        error->putDirect(*globalData, Identifier(globalData, sourceIdPropertyName), jsNumber((double)sourceID), ReadOnly | DontDelete);
    129129    if (!sourceURL.isNull())
    130         error->putWithAttributes(globalData, Identifier(globalData, sourceURLPropertyName), jsString(globalData, sourceURL), ReadOnly | DontDelete);
     130        error->putDirect(*globalData, Identifier(globalData, sourceURLPropertyName), jsString(globalData, sourceURL), ReadOnly | DontDelete);
    131131
    132132    return error;
  • trunk/Source/JavaScriptCore/runtime/JSActivation.cpp

    r104886 r104899  
    189189
    190190// FIXME: Make this function honor ReadOnly (const) and DontEnum
    191 void JSActivation::putWithAttributes(JSObject* object, ExecState* exec, const Identifier& propertyName, JSValue value, unsigned attributes)
     191void JSActivation::putDirectVirtual(JSObject* object, ExecState* exec, const Identifier& propertyName, JSValue value, unsigned attributes)
    192192{
    193193    JSActivation* thisObject = jsCast<JSActivation*>(object);
     
    201201    // expose in the activation object.
    202202    ASSERT(!thisObject->hasGetterSetterProperties());
    203     JSObject::putWithAttributes(thisObject, exec, propertyName, value, attributes);
     203    JSObject::putDirectVirtual(thisObject, exec, propertyName, value, attributes);
    204204}
    205205
  • trunk/Source/JavaScriptCore/runtime/JSActivation.h

    r103697 r104899  
    6565        static void put(JSCell*, ExecState*, const Identifier&, JSValue, PutPropertySlot&);
    6666
    67         static void putWithAttributes(JSObject*, ExecState*, const Identifier&, JSValue, unsigned attributes);
     67        static void putDirectVirtual(JSObject*, ExecState*, const Identifier&, JSValue, unsigned attributes);
    6868        static bool deleteProperty(JSCell*, ExecState*, const Identifier& propertyName);
    6969
  • trunk/Source/JavaScriptCore/runtime/JSCell.cpp

    r103083 r104899  
    204204}
    205205
    206 void JSCell::putWithAttributes(JSObject*, ExecState*, const Identifier&, JSValue, unsigned)
     206void JSCell::putDirectVirtual(JSObject*, ExecState*, const Identifier&, JSValue, unsigned)
    207207{
    208208    ASSERT_NOT_REACHED();
  • trunk/Source/JavaScriptCore/runtime/JSCell.h

    r103243 r104899  
    160160        static UString className(const JSObject*);
    161161        static bool hasInstance(JSObject*, ExecState*, JSValue, JSValue prototypeProperty);
    162         static NO_RETURN_DUE_TO_ASSERT void putWithAttributes(JSObject*, ExecState*, const Identifier& propertyName, JSValue, unsigned attributes);
     162        static NO_RETURN_DUE_TO_ASSERT void putDirectVirtual(JSObject*, ExecState*, const Identifier& propertyName, JSValue, unsigned attributes);
    163163        static bool defineOwnProperty(JSObject*, ExecState*, const Identifier& propertyName, PropertyDescriptor&, bool shouldThrow);
    164164        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r103958 r104899  
    154154}
    155155
    156 void JSGlobalObject::putWithAttributes(JSObject* object, ExecState* exec, const Identifier& propertyName, JSValue value, unsigned attributes)
     156void JSGlobalObject::putDirectVirtual(JSObject* object, ExecState* exec, const Identifier& propertyName, JSValue value, unsigned attributes)
    157157{
    158158    JSGlobalObject* thisObject = jsCast<JSGlobalObject*>(object);
     
    168168        JSValue valueAfter = thisObject->getDirect(exec->globalData(), propertyName);
    169169        if (valueAfter)
    170             JSObject::putWithAttributes(thisObject, exec, propertyName, valueAfter, attributes);
     170            JSObject::putDirectVirtual(thisObject, exec, propertyName, valueAfter, attributes);
    171171    }
    172172}
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r103960 r104899  
    203203        static void put(JSCell*, ExecState*, const Identifier&, JSValue, PutPropertySlot&);
    204204
    205         static void putWithAttributes(JSObject*, ExecState*, const Identifier& propertyName, JSValue, unsigned attributes);
     205        static void putDirectVirtual(JSObject*, ExecState*, const Identifier& propertyName, JSValue, unsigned attributes);
    206206
    207207        static void defineGetter(JSObject*, ExecState*, const Identifier& propertyName, JSObject* getterFunc, unsigned attributes);
  • trunk/Source/JavaScriptCore/runtime/JSObject.cpp

    r104871 r104899  
    163163        prototype = obj->prototype();
    164164        if (prototype.isNull()) {
    165             if (!thisObject->putDirectInternal(globalData, propertyName, value, 0, true, slot, getJSFunction(value)) && slot.isStrictMode())
     165            if (!thisObject->putDirectInternal<PutModePut>(globalData, propertyName, value, 0, slot, getJSFunction(value)) && slot.isStrictMode())
    166166                throwTypeError(exec, StrictModeReadonlyPropertyWriteError);
    167167            return;
     
    206206    }
    207207   
    208     if (!thisObject->putDirectInternal(globalData, propertyName, value, 0, true, slot, getJSFunction(value)) && slot.isStrictMode())
     208    if (!thisObject->putDirectInternal<PutModePut>(globalData, propertyName, value, 0, slot, getJSFunction(value)) && slot.isStrictMode())
    209209        throwTypeError(exec, StrictModeReadonlyPropertyWriteError);
    210210    return;
     
    218218}
    219219
    220 void JSObject::putWithAttributes(JSObject* object, ExecState* exec, const Identifier& propertyName, JSValue value, unsigned attributes)
     220void JSObject::putDirectVirtual(JSObject* object, ExecState* exec, const Identifier& propertyName, JSValue value, unsigned attributes)
    221221{
    222222    PutPropertySlot slot;
    223     object->putDirectInternal(exec->globalData(), propertyName, value, attributes, true, slot, getJSFunction(value));
    224 }
    225 
    226 void JSObject::putWithAttributes(JSGlobalData* globalData, const Identifier& propertyName, JSValue value, unsigned attributes)
    227 {
    228     PutPropertySlot slot;
    229     putDirectInternal(*globalData, propertyName, value, attributes, true, slot, getJSFunction(value));
     223    object->putDirectInternal<PutModeDefineOwnProperty>(exec->globalData(), propertyName, value, attributes, slot, getJSFunction(value));
    230224}
    231225
     
    362356    PutPropertySlot slot;
    363357    GetterSetter* getterSetter = GetterSetter::create(exec);
    364     thisObject->putDirectInternal(globalData, propertyName, getterSetter, attributes | Accessor, true, slot, 0);
     358    thisObject->putDirectInternal<PutModeDefineOwnProperty>(globalData, propertyName, getterSetter, attributes | Accessor, slot, 0);
    365359
    366360    // putDirect will change our Structure if we add a new property. For
     
    382376    JSGlobalData& globalData = exec->globalData();
    383377    PutPropertySlot slot;
    384     putDirectInternal(globalData, propertyName, getterSetter, attributes, true, slot, 0);
     378    putDirectInternal<PutModeDefineOwnProperty>(globalData, propertyName, getterSetter, attributes, slot, 0);
    385379
    386380    // putDirect will change our Structure if we add a new property. For
     
    409403    PutPropertySlot slot;
    410404    GetterSetter* getterSetter = GetterSetter::create(exec);
    411     thisObject->putDirectInternal(exec->globalData(), propertyName, getterSetter, attributes | Accessor, true, slot, 0);
     405    thisObject->putDirectInternal<PutModeDefineOwnProperty>(exec->globalData(), propertyName, getterSetter, attributes | Accessor, slot, 0);
    412406
    413407    // putDirect will change our Structure if we add a new property. For
     
    694688                accessor->setSetter(exec->globalData(), oldDescriptor.setterObject());
    695689            }
    696             target->methodTable()->putWithAttributes(target, exec, propertyName, accessor, attributes);
     690            target->methodTable()->putDirectVirtual(target, exec, propertyName, accessor, attributes);
    697691            return true;
    698692        }
     
    702696        else if (oldDescriptor.value())
    703697            newValue = oldDescriptor.value();
    704         target->methodTable()->putWithAttributes(target, exec, propertyName, newValue, attributes & ~Accessor);
     698        target->methodTable()->putDirectVirtual(target, exec, propertyName, newValue, attributes & ~Accessor);
    705699        return true;
    706700    }
  • trunk/Source/JavaScriptCore/runtime/JSObject.h

    r104886 r104899  
    7777        friend bool setUpStaticFunctionSlot(ExecState* exec, const HashEntry* entry, JSObject* thisObj, const Identifier& propertyName, PropertySlot& slot);
    7878
     79        enum PutMode {
     80            PutModePut,
     81            PutModeDefineOwnProperty,
     82        };
     83
    7984    public:
    8085        typedef JSCell Base;
     
    108113        static void putByIndex(JSCell*, ExecState*, unsigned propertyName, JSValue);
    109114
    110         // putWithAttributes is effectively an unchecked vesion of 'defineOwnProperty':
     115        // putDirect is effectively an unchecked vesion of 'defineOwnProperty':
    111116        //  - the prototype chain is not consulted
    112117        //  - accessors are not called.
    113118        //  - attributes will be respected (after the call the property will exist with the given attributes)
    114         static void putWithAttributes(JSObject*, ExecState*, const Identifier& propertyName, JSValue, unsigned attributes);
    115         void putWithAttributes(JSGlobalData*, const Identifier& propertyName, JSValue, unsigned attributes);
     119        static void putDirectVirtual(JSObject*, ExecState*, const Identifier& propertyName, JSValue, unsigned attributes);
     120        void putDirect(JSGlobalData&, const Identifier& propertyName, JSValue, unsigned attributes = 0);
     121        void putDirect(JSGlobalData&, const Identifier& propertyName, JSValue, PutPropertySlot&);
     122        void putDirectWithoutTransition(JSGlobalData&, const Identifier& propertyName, JSValue, unsigned attributes = 0);
    116123
    117124        bool propertyIsEnumerable(ExecState*, const Identifier& propertyName) const;
     
    181188        // This is used by JSActivation.
    182189        bool putOwnDataProperty(JSGlobalData&, const Identifier& propertyName, JSValue, PutPropertySlot&);
    183 
    184         void putDirect(JSGlobalData&, const Identifier& propertyName, JSValue, unsigned attr = 0);
    185         bool putDirect(JSGlobalData&, const Identifier& propertyName, JSValue, PutPropertySlot&);
    186 
    187         void putDirectWithoutTransition(JSGlobalData&, const Identifier& propertyName, JSValue, unsigned attr = 0);
    188190
    189191        // Fast access to known property offsets.
     
    291293        }
    292294
    293         bool putDirectInternal(JSGlobalData&, const Identifier& propertyName, JSValue, unsigned attr, bool checkReadOnly, PutPropertySlot&, JSCell*);
     295        template<PutMode>
     296        bool putDirectInternal(JSGlobalData&, const Identifier& propertyName, JSValue, unsigned attr, PutPropertySlot&, JSCell*);
    294297
    295298        bool inlineGetOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
     
    638641}
    639642
    640 inline bool JSObject::putDirectInternal(JSGlobalData& globalData, const Identifier& propertyName, JSValue value, unsigned attributes, bool checkReadOnly, PutPropertySlot& slot, JSCell* specificFunction)
     643template<JSObject::PutMode mode>
     644inline bool JSObject::putDirectInternal(JSGlobalData& globalData, const Identifier& propertyName, JSValue value, unsigned attributes, PutPropertySlot& slot, JSCell* specificFunction)
    641645{
    642646    ASSERT(value);
     
    652656            if (currentSpecificFunction && (specificFunction != currentSpecificFunction))
    653657                structure()->despecifyDictionaryFunction(globalData, propertyName);
    654             if (checkReadOnly && currentAttributes & ReadOnly)
     658            if ((mode == PutModePut) && currentAttributes & ReadOnly)
    655659                return false;
    656660
     
    667671        }
    668672
    669         if (checkReadOnly && !isExtensible())
     673        if ((mode == PutModePut) && !isExtensible())
    670674            return false;
    671675
     
    703707    offset = structure()->get(globalData, propertyName, currentAttributes, currentSpecificFunction);
    704708    if (offset != WTF::notFound) {
    705         if (checkReadOnly && currentAttributes & ReadOnly)
     709        if ((mode == PutModePut) && currentAttributes & ReadOnly)
    706710            return false;
    707711
     
    731735    }
    732736
    733     if (checkReadOnly && !isExtensible())
     737    if ((mode == PutModePut) && !isExtensible())
    734738        return false;
    735739
     
    755759    ASSERT(!structure()->hasGetterSetterProperties());
    756760
    757     return putDirectInternal(globalData, propertyName, value, 0, true, slot, getJSFunction(value));
     761    return putDirectInternal<PutModePut>(globalData, propertyName, value, 0, slot, getJSFunction(value));
    758762}
    759763
     
    761765{
    762766    PutPropertySlot slot;
    763     putDirectInternal(globalData, propertyName, value, attributes, false, slot, getJSFunction(value));
    764 }
    765 
    766 inline bool JSObject::putDirect(JSGlobalData& globalData, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
    767 {
    768     return putDirectInternal(globalData, propertyName, value, 0, false, slot, getJSFunction(value));
     767    putDirectInternal<PutModeDefineOwnProperty>(globalData, propertyName, value, attributes, slot, getJSFunction(value));
     768}
     769
     770inline void JSObject::putDirect(JSGlobalData& globalData, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
     771{
     772    putDirectInternal<PutModeDefineOwnProperty>(globalData, propertyName, value, 0, slot, getJSFunction(value));
    769773}
    770774
  • trunk/Source/JavaScriptCore/runtime/JSStaticScopeObject.cpp

    r103697 r104899  
    7979}
    8080
    81 void JSStaticScopeObject::putWithAttributes(JSObject* object, ExecState* exec, const Identifier& propertyName, JSValue value, unsigned attributes)
     81void JSStaticScopeObject::putDirectVirtual(JSObject* object, ExecState* exec, const Identifier& propertyName, JSValue value, unsigned attributes)
    8282{
    8383    JSStaticScopeObject* thisObject = jsCast<JSStaticScopeObject*>(object);
  • trunk/Source/JavaScriptCore/runtime/JSStaticScopeObject.h

    r103243 r104899  
    4848        static void put(JSCell*, ExecState*, const Identifier&, JSValue, PutPropertySlot&);
    4949
    50         static void putWithAttributes(JSObject*, ExecState*, const Identifier&, JSValue, unsigned attributes);
     50        static void putDirectVirtual(JSObject*, ExecState*, const Identifier&, JSValue, unsigned attributes);
    5151
    5252        static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue proto) { return Structure::create(globalData, globalObject, proto, TypeInfo(StaticScopeObjectType, StructureFlags), &s_info); }
  • trunk/Source/JavaScriptCore/runtime/JSVariableObject.cpp

    r103083 r104899  
    7474}
    7575
    76 void JSVariableObject::putWithAttributes(JSObject*, ExecState*, const Identifier&, JSValue, unsigned)
     76void JSVariableObject::putDirectVirtual(JSObject*, ExecState*, const Identifier&, JSValue, unsigned)
    7777{
    7878    ASSERT_NOT_REACHED();
  • trunk/Source/JavaScriptCore/runtime/JSVariableObject.h

    r103697 r104899  
    5151        static void destroy(JSCell*);
    5252
    53         static NO_RETURN_DUE_TO_ASSERT void putWithAttributes(JSObject*, ExecState*, const Identifier&, JSValue, unsigned attributes);
     53        static NO_RETURN_DUE_TO_ASSERT void putDirectVirtual(JSObject*, ExecState*, const Identifier&, JSValue, unsigned attributes);
    5454
    5555        static bool deleteProperty(JSCell*, ExecState*, const Identifier&);
  • trunk/Source/WebCore/ChangeLog

    r104897 r104899  
     12012-01-12  Gavin Barraclough  <barraclough@apple.com>
     2
     3        Clean up putDirect (part 2)
     4        https://bugs.webkit.org/show_bug.cgi?id=76232
     5
     6        Reviewed by Sam Weinig.
     7
     8        Rename putWithAttributes to putDirectVirtual.
     9
     10        * bindings/js/JSDOMWindowShell.cpp:
     11        (WebCore::JSDOMWindowShell::putDirectVirtual):
     12        * bindings/js/JSDOMWindowShell.h:
     13
    1142012-01-12  MORITA Hajime  <morrita@google.com>
    215
  • trunk/Source/WebCore/bindings/js/JSDOMWindowShell.cpp

    r103083 r104899  
    110110}
    111111
    112 void JSDOMWindowShell::putWithAttributes(JSObject* object, ExecState* exec, const Identifier& propertyName, JSValue value, unsigned attributes)
     112void JSDOMWindowShell::putDirectVirtual(JSObject* object, ExecState* exec, const Identifier& propertyName, JSValue value, unsigned attributes)
    113113{
    114114    JSDOMWindowShell* thisObject = jsCast<JSDOMWindowShell*>(object);
    115     thisObject->window()->putWithAttributes(thisObject->window(), exec, propertyName, value, attributes);
     115    thisObject->window()->putDirectVirtual(thisObject->window(), exec, propertyName, value, attributes);
    116116}
    117117
  • trunk/Source/WebCore/bindings/js/JSDOMWindowShell.h

    r103083 r104899  
    8383        static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
    8484        static void put(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);
    85         static void putWithAttributes(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, unsigned attributes);
     85        static void putDirectVirtual(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, unsigned attributes);
    8686        static bool deleteProperty(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName);
    8787        static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode);
Note: See TracChangeset for help on using the changeset viewer.