Changeset 8453 in webkit for trunk/JavaScriptCore/kjs/object.cpp


Ignore:
Timestamp:
Jan 26, 2005, 1:38:10 PM (20 years ago)
Author:
rjw
Message:

JavaScriptCore:

Fixed <rdar://problem/3972522> (179-180) 40% slowdown on iBench JavaScript test

I added a member variable to ObjectImp. This changed it's size and consequently
hampered the optimizations built into the garbage collector. Objects no longer
fit within the allocators cell size, and thus allocation fell back to a slower
allocator.

As a result of this fix I also dramatically cleaned up how runtime objects are
accessed. The path mostly *removes* code.

Reviewed by Chris.

  • bindings/runtime_method.cpp: (RuntimeMethodImp::call):
  • bindings/runtime_object.cpp: (RuntimeObjectImp::get): (RuntimeObjectImp::put): (RuntimeObjectImp::canPut): (RuntimeObjectImp::hasProperty): (RuntimeObjectImp::defaultValue):
  • bindings/runtime_object.h:
  • kjs/object.cpp: (KJS::ObjectImp::ObjectImp):
  • kjs/object.h:

WebCore:

Fixed <rdar://problem/3972522> (179-180) 40% slowdown on iBench JavaScript test

I added a member variable to ObjectImp. This changed it's size and consequently
hampered the optimizations built into the garbage collector. Objects no longer
fit within the allocators cell size, and thus allocation fell back to a slower
allocator.

As a result of this fix I also dramatically cleaned up how runtime objects are
accessed. The path mostly *removes* code.

Reviewed by Chris.

  • khtml/ecma/kjs_dom.cpp: (DOMDocumentProtoFunc::tryCall): (DOMElementProtoFunc::tryCall): (KJS::getRuntimeObject):
  • khtml/ecma/kjs_dom.h:
  • khtml/ecma/kjs_html.cpp: (KJS::HTMLDocument::tryGet): (KJS::HTMLElement::tryGet): (KJS::HTMLElement::implementsCall): (KJS::HTMLElement::call): (KJS::HTMLElement::tryPut): (KJS::HTMLCollection::tryGet): (KJS::HTMLCollection::getNamedItems):
  • khtml/ecma/kjs_html.h:
  • khtml/ecma/kjs_window.cpp: (Window::get):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/object.cpp

    r8400 r8453  
    125125
    126126ObjectImp::ObjectImp(const Object &proto)
    127   : _proto(static_cast<ObjectImp*>(proto.imp())), _internalValue(0L), _forwardingScriptMessage(false)
     127  : _proto(static_cast<ObjectImp*>(proto.imp())), _internalValue(0L)
    128128{
    129129  //fprintf(stderr,"ObjectImp::ObjectImp %p\n",(void*)this);
     
    131131
    132132ObjectImp::ObjectImp(ObjectImp *proto)
    133   : _proto(proto), _internalValue(0L), _forwardingScriptMessage(false)
     133  : _proto(proto), _internalValue(0L)
    134134{
    135135  //fprintf(stderr,"ObjectImp::ObjectImp %p\n",(void*)this);
     
    141141  _proto = NullImp::staticNull;
    142142  _internalValue = 0L;
    143   _forwardingScriptMessage = false;
    144143}
    145144
Note: See TracChangeset for help on using the changeset viewer.