Ignore:
Timestamp:
Feb 23, 2008, 9:01:27 PM (17 years ago)
Author:
Darin Adler
Message:

JavaScriptCore:

Reviewed by Anders.

  • API/JSCallbackObject.h: Removed attribute arguments.
  • API/JSCallbackObjectFunctions.h: (KJS::JSCallbackObject<Base>::put): Ditto.
  • API/JSObjectRef.cpp: (JSObjectSetProperty): Use initializeVariable or putDirect when necessary to set attribute values.
  • JavaScriptCore.exp: Updated.
  • bindings/objc/objc_runtime.h: Removed attribute arguments.
  • bindings/objc/objc_runtime.mm: (ObjcFallbackObjectImp::put): Ditto.
  • bindings/runtime_array.cpp: (RuntimeArray::put): Ditto.
  • bindings/runtime_array.h: Ditto.
  • bindings/runtime_object.cpp: (RuntimeObjectImp::put): Ditto.
  • bindings/runtime_object.h: Ditto. Also removed canPut which was only called from one place in WebCore that can use hasProperty instead.
  • kjs/Activation.h: Removed attribute argument from put and added the new initializeVariable function that's used to put variables in variable objects. Also made isActivationObject a const member.
  • kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::put): Removed attribute argument. (KJS::JSGlobalObject::initializeVariable): Added. Used to give variables their initial values, which can include the read-only property. (KJS::JSGlobalObject::reset): Removed obsolete comments about flags. Removed Internal flag, which is no longer needed.
  • kjs/JSGlobalObject.h: More of the same.
  • kjs/JSVariableObject.h: Added pure virtual initializeVariable function. (KJS::JSVariableObject::symbolTablePut): Removed checkReadOnly flag; we always check read-only. (KJS::JSVariableObject::symbolTableInitializeVariable): Added.
  • kjs/array_instance.cpp: (KJS::ArrayInstance::put): Removed attribute argument.
  • kjs/array_instance.h: Ditto.
  • kjs/function.cpp: (KJS::FunctionImp::put): Ditto. (KJS::Arguments::put): Ditto. (KJS::ActivationImp::put): Ditto. (KJS::ActivationImp::initializeVariable): Added.
  • kjs/function.h: Removed attribute arguments.
  • kjs/function_object.cpp: (KJS::FunctionObjectImp::construct): Removed Internal flag.
  • kjs/lookup.h: (KJS::lookupPut): Removed attributes argument. Also changed to use putDirect instead of calling JSObject::put. (KJS::cacheGlobalObject): Ditto.
  • kjs/nodes.cpp: (KJS::ConstDeclNode::handleSlowCase): Call initializeVariable to initialize the constant. (KJS::ConstDeclNode::evaluateSingle): Ditto. (KJS::TryNode::execute): Use putDirect to set up the new object. (KJS::FunctionBodyNode::processDeclarations): Removed Internal. (KJS::ProgramNode::processDeclarations): Ditto. (KJS::EvalNode::processDeclarations): Call initializeVariable to initialize the variables and functions. (KJS::FuncDeclNode::makeFunction): Removed Internal. (KJS::FuncExprNode::evaluate): Ditto.
  • kjs/object.cpp: Removed canPut, which was only being used in one code path, not the normal high speed one. (KJS::JSObject::put): Removed attribute argument. Moved the logic from canPut here, in the one code ath that was still using it.
  • kjs/object.h: Removed Internal attribute, ad canPut function. Removed the attributes argument to the put function. Made isActivationObject const.
  • kjs/regexp_object.cpp: (KJS::RegExpImp::put): Removed attributes argument. (KJS::RegExpImp::putValueProperty): Ditto. (KJS::RegExpObjectImp::put): Ditto. (KJS::RegExpObjectImp::putValueProperty): Ditto.
  • kjs/regexp_object.h: Ditto.
  • kjs/string_object.cpp: (KJS::StringInstance::put): Removed attributes argument.
  • kjs/string_object.h: Ditto.

WebCore:

Reviewed by Anders.

  • bindings/js/JSCSSStyleDeclarationCustom.cpp: (WebCore::JSCSSStyleDeclaration::customPut): Remove attributes argument.
  • bindings/js/JSCanvasPixelArrayCustom.cpp: (WebCore::JSCanvasPixelArray::indexGetter): Use early exit idiom. (WebCore::JSCanvasPixelArray::indexSetter): Moved length check into the CanvasPixelArray object, for consistency with the getter. Removed attributes argument.
  • bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::customPut): Removed special case for variable initialization, which is not needed since that does use put any more. Removed attributes argument.
  • bindings/js/JSEventTargetBase.h: (WebCore::JSEventTargetBase::putValueProperty): Removed attributes argument. (WebCore::JSEventTargetBase::put): Ditto. (WebCore::JSEventTargetPrototype::self): Removed Internal flag.
  • bindings/js/JSEventTargetNode.cpp: (WebCore::JSEventTargetNode::put): Removed attributes argument. (WebCore::JSEventTargetNode::putValueProperty): Ditto.
  • bindings/js/JSEventTargetNode.h: Ditto.
  • bindings/js/JSHTMLAppletElementCustom.cpp: (WebCore::JSHTMLAppletElement::customPut): Ditto.
  • bindings/js/JSHTMLEmbedElementCustom.cpp: (WebCore::JSHTMLEmbedElement::customPut): Ditto.
  • bindings/js/JSHTMLInputElementBase.cpp: (WebCore::JSHTMLInputElementBase::put): Ditto. (WebCore::JSHTMLInputElementBase::putValueProperty): Ditto.
  • bindings/js/JSHTMLInputElementBase.h: Ditto.
  • bindings/js/JSHTMLObjectElementCustom.cpp: (WebCore::JSHTMLObjectElement::customPut): Ditto.
  • bindings/js/JSHTMLOptionsCollectionCustom.cpp: (WebCore::JSHTMLOptionsCollection::indexSetter): Ditto.
  • bindings/js/JSHTMLSelectElementCustom.cpp: (WebCore::JSHTMLSelectElement::indexSetter): Ditto.
  • bindings/js/JSHistoryCustom.cpp: (WebCore::JSHistory::customPut): Ditto.
  • bindings/js/JSLocation.cpp: (WebCore::JSLocation::put): Ditto.
  • bindings/js/JSLocation.h: Ditto.
  • bindings/js/JSXMLHttpRequest.cpp: (WebCore::JSXMLHttpRequest::put): Ditto. (WebCore::JSXMLHttpRequest::putValueProperty): Ditto.
  • bindings/js/JSXMLHttpRequest.h: Ditto.
  • bindings/js/kjs_dom.cpp: (WebCore::getRuntimeObject): Changed return type to JSObject*.
  • bindings/js/kjs_dom.h: Ditto.
  • bindings/js/kjs_events.cpp: (WebCore::JSClipboard::put): Removed attributes argument. (WebCore::JSClipboard::putValueProperty): Ditto.
  • bindings/js/kjs_events.h: Ditto.
  • bindings/js/kjs_html.cpp: (WebCore::runtimeObjectGetter): Updated for change to getRuntimeObject to return a JSObject. Used early exit idiom. (WebCore::runtimeObjectPropertyGetter): Ditto. (WebCore::runtimeObjectCustomGetOwnPropertySlot): Ditto. (WebCore::runtimeObjectCustomPut): Use hasProperty to check for properties that we should put with the property syntax instead of canPut. (WebCore::runtimeObjectImplementsCall): Ditto. (WebCore::runtimeObjectCallAsFunction): Ditto.
  • bindings/js/kjs_html.h: Removed attributes argument to runtimeObjectCustomPut.
  • bindings/js/kjs_window.cpp: (KJS::Window::put): Removed attributes argument.
  • bindings/js/kjs_window.h: Ditto.
  • bindings/scripts/CodeGeneratorJS.pm: Removed attributes argument from put, putValueProperty, customPut, and indexSetter.
  • html/CanvasPixelArray.h: (WebCore::CanvasPixelArray::set): Added index checking here, as in the get function. Before, the checking was done in the JavaScript bindings for set.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/JSVariableObject.h

    r29943 r30534  
    4343        void saveLocalStorage(SavedProperties&) const;
    4444        void restoreLocalStorage(const SavedProperties&);
     45
     46        virtual void initializeVariable(ExecState*, const Identifier&, JSValue*, unsigned attributes) = 0;
    4547       
    4648        virtual bool deleteProperty(ExecState*, const Identifier&);
     
    7880
    7981        bool symbolTableGet(const Identifier&, PropertySlot&);
    80         bool symbolTablePut(const Identifier&, JSValue*, bool checkReadOnly);
     82        bool symbolTablePut(const Identifier&, JSValue*);
     83        bool symbolTableInitializeVariable(const Identifier&, JSValue*, unsigned attributes);
    8184
    8285        JSVariableObjectData* d;
     
    105108    }
    106109
    107     inline bool JSVariableObject::symbolTablePut(const Identifier& propertyName, JSValue* value, bool checkReadOnly)
     110    inline bool JSVariableObject::symbolTablePut(const Identifier& propertyName, JSValue* value)
    108111    {
    109112        size_t index = symbolTable().get(propertyName.ustring().rep());
     
    111114            return false;
    112115        LocalStorageEntry& entry = d->localStorage[index];
    113         if (checkReadOnly && (entry.attributes & ReadOnly))
     116        if (entry.attributes & ReadOnly)
    114117            return true;
    115118        entry.value = value;
     119        return true;
     120    }
     121
     122    inline bool JSVariableObject::symbolTableInitializeVariable(const Identifier& propertyName, JSValue* value, unsigned attributes)
     123    {
     124        size_t index = symbolTable().get(propertyName.ustring().rep());
     125        if (index == missingSymbolMarker())
     126            return false;
     127        LocalStorageEntry& entry = d->localStorage[index];
     128        entry.value = value;
     129        entry.attributes = attributes;
    116130        return true;
    117131    }
Note: See TracChangeset for help on using the changeset viewer.