• darin@apple.com's avatar
    JavaScriptCore: · e25e04e3
    darin@apple.com authored
            Reviewed by Anders.
    
            - http://bugs.webkit.org/show_bug.cgi?id=17067
              eliminate attributes parameter from JSObject::put for speed/clarity
    
            * 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.
    
            - http://bugs.webkit.org/show_bug.cgi?id=17067
              eliminate attributes parameter from JSObject::put for speed/clarity
    
            * 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.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30534 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    e25e04e3
kjs_events.cpp 16.4 KB