JavaScriptCore:
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Jul 2005 22:17:20 +0000 (22:17 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Jul 2005 22:17:20 +0000 (22:17 +0000)
commitc7d89076f9178487613b2e61757906b0b2f296c5
tree36112f7f283c07def88d86a121061b86b0c9a821
parent91d00ff291ff2c7268da2d517492da92ec955452
JavaScriptCore:

        Reviewed by Darin.

- http://bugzilla.opendarwin.org/show_bug.cgi?id=4124
(change JavaScript property access to avoid double lookup)

- 10% speedup on JavaScript iBench
- 5% speedup on 24fun BenchJS benchmark

Changed all get methods to getOwnProperty - they are no longer
responsible for prototype lookup, and determine if the property
was found as a side efect.

get() is now a nonvirtual ObjectImp method which calls the virtual
getOwnProperty and walks the prototype chain. A few selected
methods were inlined.

Changed ResolveNode::evaluate plus some other places to use
getProperty which does get() and hasProperty() in one lookup.

Also miscellaneous code cleanup.

* bindings/objc/objc_runtime.h:
        * bindings/objc/objc_runtime.mm:
        (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
        (ObjcFallbackObjectImp::getOwnProperty):
        * bindings/runtime_array.cpp:
        (RuntimeArrayImp::RuntimeArrayImp):
        (RuntimeArrayImp::getOwnProperty):
        * bindings/runtime_array.h:
        * bindings/runtime_method.cpp:
        (RuntimeMethodImp::getOwnProperty):
        * bindings/runtime_method.h:
        * bindings/runtime_object.cpp:
        (RuntimeObjectImp::getOwnProperty):
        * bindings/runtime_object.h:
        * kjs/array_instance.h:
        * kjs/array_object.cpp:
        (ArrayInstanceImp::getOwnProperty):
        (ArrayPrototypeImp::getOwnProperty):
        (ArrayProtoFuncImp::call):
        * kjs/array_object.h:
        * kjs/date_object.cpp:
        (DatePrototypeImp::getOwnProperty):
        * kjs/date_object.h:
        * kjs/function.cpp:
        (KJS::FunctionImp::getOwnProperty):
        (KJS::ArgumentsImp::getOwnProperty):
        (KJS::ActivationImp::getOwnProperty):
        * kjs/function.h:
        * kjs/lookup.h:
        (KJS::lookupGetOwnProperty):
        (KJS::lookupGetOwnFunction):
        (KJS::lookupGetOwnValue):
        * kjs/math_object.cpp:
        (MathObjectImp::getOwnProperty):
        (MathObjectImp::getValueProperty):
        * kjs/math_object.h:
        * kjs/nodes.cpp:
        (ResolveNode::evaluate):
        * kjs/number_object.cpp:
        (NumberObjectImp::getOwnProperty):
        * kjs/number_object.h:
        * kjs/object.cpp:
        (KJS::ObjectImp::get):
        (KJS::ObjectImp::getOwnProperty):
        (KJS::ObjectImp::getProperty):
        * kjs/object.h:
        (KJS::ObjectImp::getProperty):
        (KJS::ObjectImp::getOwnProperty):
        * kjs/object_object.cpp:
        (ObjectProtoFuncImp::call):
        * kjs/regexp_object.cpp:
        (RegExpObjectImp::getOwnProperty):
        * kjs/regexp_object.h:
        * kjs/string_object.cpp:
        (StringInstanceImp::getOwnProperty):
        (StringPrototypeImp::getOwnProperty):
        * kjs/string_object.h:

WebCore:

        Reviewed by Darin.

- http://bugzilla.opendarwin.org/show_bug.cgi?id=4124
(change JavaScript property access to avoid double lookup)

- 10% speedup on JavaScript iBench
- 5% speedup on 24fun BenchJS benchmark

Changed all get methods to getOwnProperty - they are no longer responsible for
prototype lookup, and determine if the property was found as a side efect.

Also miscellaneous code cleanup.

        * khtml/ecma/kjs_css.cpp:
        (KJS::DOMCSSStyleDeclaration::getOwnProperty):
        (KJS::DOMStyleSheet::getOwnProperty):
        (KJS::DOMStyleSheetList::getOwnProperty):
        (KJS::DOMMediaList::getOwnProperty):
        (KJS::DOMCSSStyleSheet::getOwnProperty):
        (KJS::DOMCSSRuleList::getOwnProperty):
        (KJS::DOMCSSRule::getOwnProperty):
        (KJS::DOMCSSRule::getValueProperty):
        (KJS::CSSRuleConstructor::getOwnProperty):
        (KJS::DOMCSSValue::getOwnProperty):
        (KJS::CSSValueConstructor::getOwnProperty):
        (KJS::DOMCSSPrimitiveValue::getOwnProperty):
        (KJS::CSSPrimitiveValueConstructor::getOwnProperty):
        (KJS::DOMCSSValueList::getOwnProperty):
        (KJS::DOMRGBColor::getOwnProperty):
        (KJS::DOMRect::getOwnProperty):
        (KJS::DOMCounter::getOwnProperty):
        * khtml/ecma/kjs_css.h:
        * khtml/ecma/kjs_dom.cpp:
        (KJS::DOMNode::getOwnProperty):
        (KJS::DOMNodeList::getOwnProperty):
        (KJS::DOMAttr::getOwnProperty):
        (KJS::DOMDocument::getOwnProperty):
        (KJS::DOMElement::getOwnProperty):
        (KJS::DOMDocumentType::getOwnProperty):
        (KJS::DOMNamedNodeMap::getOwnProperty):
        (KJS::DOMProcessingInstruction::getOwnProperty):
        (KJS::DOMNotation::getOwnProperty):
        (KJS::DOMEntity::getOwnProperty):
        (KJS::NodeConstructor::getOwnProperty):
        (KJS::DOMExceptionConstructor::getOwnProperty):
        (KJS::DOMNamedNodesCollection::getOwnProperty):
        (KJS::DOMCharacterData::getOwnProperty):
        * khtml/ecma/kjs_dom.h:
        * khtml/ecma/kjs_events.cpp:
        (KJS::EventConstructor::getOwnProperty):
        (KJS::DOMEvent::getOwnProperty):
        (KJS::EventExceptionConstructor::getOwnProperty):
        (KJS::DOMUIEvent::getOwnProperty):
        (KJS::DOMMouseEvent::getOwnProperty):
        (KJS::DOMKeyboardEvent::getOwnProperty):
        (KJS::MutationEventConstructor::getOwnProperty):
        (KJS::DOMMutationEvent::getOwnProperty):
        (KJS::DOMWheelEvent::getOwnProperty):
        (KJS::Clipboard::getOwnProperty):
        * khtml/ecma/kjs_events.h:
        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLDocument::getOwnProperty):
        (KJS::KJS::HTMLElement::getOwnProperty):
        (KJS::KJS::HTMLCollection::getOwnProperty):
        (KJS::KJS::HTMLSelectCollection::getOwnProperty):
        (KJS::Image::getOwnProperty):
        (KJS::Context2D::getOwnProperty):
        (KJS::Gradient::getOwnProperty):
        (KJS::ImagePattern::getOwnProperty):
        * khtml/ecma/kjs_html.h:
        * khtml/ecma/kjs_navigator.cpp:
        (KJS::Plugin::Plugin):
        (KJS::Navigator::getOwnProperty):
        (KJS::Plugins::getOwnProperty):
        (KJS::MimeTypes::getOwnProperty):
        (KJS::Plugin::getOwnProperty):
        (KJS::MimeType::getOwnProperty):
        * khtml/ecma/kjs_navigator.h:
        * khtml/ecma/kjs_range.cpp:
        (KJS::DOMRange::getOwnProperty):
        (KJS::RangeConstructor::getOwnProperty):
        * khtml/ecma/kjs_range.h:
        * khtml/ecma/kjs_traversal.cpp:
        (KJS::DOMNodeIterator::getOwnProperty):
        (KJS::NodeFilterConstructor::getOwnProperty):
        (KJS::DOMTreeWalker::getOwnProperty):
        * khtml/ecma/kjs_traversal.h:
        * khtml/ecma/kjs_views.cpp:
        (KJS::DOMAbstractView::getOwnProperty):
        * khtml/ecma/kjs_views.h:
        * khtml/ecma/kjs_window.cpp:
        (KJS::Screen::getOwnProperty):
        (KJS::Window::~Window):
        (KJS::Window::getOwnProperty):
        (KJS::Window::put):
        (KJS::FrameArray::getOwnProperty):
        (KJS::Location::Location):
        (KJS::Location::getOwnProperty):
        (KJS::Location::put):
        (KJS::Selection::Selection):
        (KJS::Selection::getOwnProperty):
        (KJS::BarInfo::getOwnProperty):
        (KJS::History::getOwnProperty):
        * khtml/ecma/kjs_window.h:
        * khtml/ecma/xmlhttprequest.cpp:
        (KJS::XMLHttpRequest::getOwnProperty):
        * khtml/ecma/xmlhttprequest.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9889 268f45cc-cd09-0410-ab3c-d52691b4dbfc
50 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/bindings/objc/objc_runtime.h
JavaScriptCore/bindings/objc/objc_runtime.mm
JavaScriptCore/bindings/runtime_array.cpp
JavaScriptCore/bindings/runtime_array.h
JavaScriptCore/bindings/runtime_method.cpp
JavaScriptCore/bindings/runtime_method.h
JavaScriptCore/bindings/runtime_object.cpp
JavaScriptCore/bindings/runtime_object.h
JavaScriptCore/kjs/array_instance.h
JavaScriptCore/kjs/array_object.cpp
JavaScriptCore/kjs/array_object.h
JavaScriptCore/kjs/date_object.cpp
JavaScriptCore/kjs/date_object.h
JavaScriptCore/kjs/function.cpp
JavaScriptCore/kjs/function.h
JavaScriptCore/kjs/lookup.h
JavaScriptCore/kjs/math_object.cpp
JavaScriptCore/kjs/math_object.h
JavaScriptCore/kjs/nodes.cpp
JavaScriptCore/kjs/number_object.cpp
JavaScriptCore/kjs/number_object.h
JavaScriptCore/kjs/object.cpp
JavaScriptCore/kjs/object.h
JavaScriptCore/kjs/object_object.cpp
JavaScriptCore/kjs/regexp_object.cpp
JavaScriptCore/kjs/regexp_object.h
JavaScriptCore/kjs/string_object.cpp
JavaScriptCore/kjs/string_object.h
WebCore/ChangeLog-2005-08-23
WebCore/khtml/ecma/kjs_css.cpp
WebCore/khtml/ecma/kjs_css.h
WebCore/khtml/ecma/kjs_dom.cpp
WebCore/khtml/ecma/kjs_dom.h
WebCore/khtml/ecma/kjs_events.cpp
WebCore/khtml/ecma/kjs_events.h
WebCore/khtml/ecma/kjs_html.cpp
WebCore/khtml/ecma/kjs_html.h
WebCore/khtml/ecma/kjs_navigator.cpp
WebCore/khtml/ecma/kjs_navigator.h
WebCore/khtml/ecma/kjs_range.cpp
WebCore/khtml/ecma/kjs_range.h
WebCore/khtml/ecma/kjs_traversal.cpp
WebCore/khtml/ecma/kjs_traversal.h
WebCore/khtml/ecma/kjs_views.cpp
WebCore/khtml/ecma/kjs_views.h
WebCore/khtml/ecma/kjs_window.cpp
WebCore/khtml/ecma/kjs_window.h
WebCore/khtml/ecma/xmlhttprequest.cpp
WebCore/khtml/ecma/xmlhttprequest.h