1. 22 Nov, 2002 2 commits
    • darin's avatar
      JavaScriptCore: · 7b978750
      darin authored
      	- change ScopeChain to be a singly linked list shares tails, gives 11% gain on iBench
      
              * kjs/context.h:
              (ContextImp::pushScope): Make inline, use push instead of prepend, and pass imp pointer.
              (ContextImp::popScope): Make inline, use pop instead of removeFirst.
              * kjs/function.cpp: (DeclaredFunctionImp::DeclaredFunctionImp): No need to copy.
              * kjs/function_object.cpp: (FunctionObjectImp::construct): Use push instead of
      	prepend, and pass imp pointer.
              * kjs/internal.cpp: (ContextImp::ContextImp): Use clear, push instead of prepend,
      	and pass imp pointers.
              * kjs/nodes.cpp: (ResolveNode::evaluateReference): Use isEmpty, pop, and top instead
      	of ScopeChainIterator.
              * kjs/object.h: Change _scope to be a NoRefScopeChain.
              * kjs/object.cpp: No need to initialize _scope any more, since it's not a NoRefScopeChain.
      
              * kjs/scope_chain.h: Rewrite, different implementation and interface.
              * kjs/scope_chain.cpp: More of the same.
      
      WebCore:
      
              * khtml/ecma/kjs_dom.cpp: (DOMNode::pushEventHandlerScope): Change to push handlers
      	on an existing scope chain rather than returning one. Name change too.
              * khtml/ecma/kjs_dom.h: More of the same.
              * khtml/ecma/kjs_html.cpp: (KJS::HTMLElement::pushEventHandlerScope): And here.
              * khtml/ecma/kjs_html.h: And here.
      
              * khtml/ecma/kjs_events.cpp: (JSEventListener::handleEvent): Use the pushEventHandlerScope
      	function, and also don't worry about optimizing the "no change" case, because that already
      	works pretty efficiently.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7b978750
    • mjs's avatar
      - a simple change for .4% gain on ibench - instead of unmarking · f67a9641
      mjs authored
      	all objects at the start of collection, instead unmark as part of
      	the sweep phase
      
              * kjs/collector.cpp:
              (Collector::collect): Remove separate unmarking pass and instead
      	unmark the objects that don't get collected during the sweep
      	phase.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2822 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f67a9641
  2. 21 Nov, 2002 9 commits
    • darin's avatar
      top level: · 36614a72
      darin authored
              * Site/Internal/Design/CFURL.rtf: Added.
      
      Tools:
      
              * Scripts/last-update: Added. Script for Trey that tells you when
      	you last did a cvs update, based on most-recently updated ChangeLog.
      
      JavaScriptCore:
      
      	- stop garbage collecting the ActivationImp objects, gets 3% on iBench
      	- pave the way to separate the argument lists from scope chains
      
              * kjs/context.h: Added. Moved ContextImp here so it can use things defined
      	in function.h
      
              * kjs/scope_chain.h: Added. Starting as a copy of List, to be improved.
              * kjs/scope_chain.cpp: Added. Starting as a copy of List, to be improved.
      
              * JavaScriptCore.pbproj/project.pbxproj: Rearranged things, added context.h.
      
              * kjs/function.cpp:
              (FunctionImp::call): Pass InterpreterImp, not ExecState, to ContextImp.
              (DeclaredFunctionImp::DeclaredFunctionImp): List -> ScopeChain.
              (ActivationImp::createArgumentsObject): ArgumentList -> List.
              (GlobalFuncImp::call): Pass InterpreterImp, not an ExecState, to ContextImp.
              * kjs/function.h: List -> ScopeChain.
              * kjs/function_object.cpp: (FunctionObjectImp::construct): List -> ScopeChain.
              * kjs/internal.cpp:
              (ContextImp::ContextImp): Set the context in the interpreter.
              (ContextImp::~ContextImp): Set the context in the interpreter to the caller.
              (ContextImp::mark): Mark all the activation objects.
              (InterpreterImp::InterpreterImp): Initialize context to 0.
              (InterpreterImp::mark): Mark the top context.
              (InterpreterImp::evaluate): Pass InterpreterImp to ContextImp.
              * kjs/internal.h: Move ContextImp to its own header. Add setContext to InterpreterImp.
              * kjs/interpreter.cpp: (Context::scopeChain): List -> ScopeChain.
              * kjs/interpreter.h: List -> ScopeChain.
              * kjs/nodes.cpp:
              (ResolveNode::evaluateReference): List -> ScopeChain.
              (FuncDeclNode::processFuncDecl): List -> ScopeChain.
              (FuncExprNode::evaluate): List -> ScopeChain.
              * kjs/object.cpp: List -> ScopeChain.
              * kjs/object.h: List -> ScopeChain.
      
              * kjs/types.h: Remove needsMarking features from List.
              * kjs/types.cpp: Ditto.
      
      WebCore:
      
              * khtml/ecma/kjs_dom.cpp: (DOMNode::eventHandlerScope): List -> ScopeChain.
              * khtml/ecma/kjs_dom.h: List -> ScopeChain.
              * khtml/ecma/kjs_events.cpp: (JSEventListener::handleEvent): List -> ScopeChain.
              * khtml/ecma/kjs_html.cpp: (KJS::HTMLElement::eventHandlerScope): List -> ScopeChain.
              * khtml/ecma/kjs_html.h: List -> ScopeChain.
      
              * force-js-clean-timestamp: Not sure this is required, but better safe than sorry.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2821 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      36614a72
    • mjs's avatar
      - reduced the size of PropertyMap by storing sizes and such in the · bb46f898
      mjs authored
      	dynamically allocated part of the object to reduce the size of
      	ObjectImp - .5% speed improvement on JS iBench.
      
              * kjs/property_map.cpp:
              * kjs/property_map.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2817 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bb46f898
    • mjs's avatar
      Tools: · 1549b911
      mjs authored
              * CommitLogEditor/Makefile.am: Pass symroots for this tree to pbxbuild.
              * HotSpotFinder/Makefile.am: Pass symroots for this tree to pbxbuild.
      
      JavaScriptCore:
      
              * Makefile.am: Pass symroots for this tree to pbxbuild.
      
      Tests:
      
              * ObjcUnit/Makefile.am: Pass symroots for this tree to pbxbuild.
              * TestPlugin/Makefile.am: Pass symroots for this tree to pbxbuild.
              * WebFoundation-CacheLoader/Makefile.am: Pass symroots for this tree to pbxbuild.
      
      WebFoundation:
      
              * Makefile.am: Pass symroots for this tree to pbxbuild.
      
      WebCore:
      
              * Makefile.am: Pass symroots for this tree to pbxbuild.
      
      WebKit:
      
              * Makefile.am: Pass symroots for this tree to pbxbuild.
      
      WebBrowser:
      
              * Makefile.am: Pass symroots for this tree to pbxbuild.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2813 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1549b911
    • sheridan's avatar
      Alex-33 stamp · 96195948
      sheridan authored
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2807 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      96195948
    • darin's avatar
      JavaScriptCore: · 32782811
      darin authored
              * kjs/property_map.cpp: More assertions.
      
      WebCore:
      
              * force-js-clean-timestamp: Trigger a rebuild because of the
      	size change in ValueImp.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2804 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      32782811
    • darin's avatar
      * kjs/property_map.cpp: Turn that consistency check back off. · 591c3909
      darin authored
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2802 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      591c3909
    • darin's avatar
      - someone somewhere must be defining a macro named check, causing a compile failure in WebCore · e56c6da0
      darin authored
      	Rename check() to checkConsistency().
      
              * kjs/property_map.h: Rename.
              * kjs/property_map.cpp: Yes, rename.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2801 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e56c6da0
    • darin's avatar
      - add self-check to property map in hopes of finding the cnet.com bug · d579f5b7
      darin authored
              * kjs/property_map.h: Add check() function.
              * kjs/property_map.cpp: Add the checking, controlled by DO_CONSISTENCY_CHECK.
      
      	 - fixed UChar interface so it's not so slow in debug builds
      
              * kjs/ustring.h: Nothing in UChar needs to be private.
      
              * kjs/function.cpp: (GlobalFuncImp::call):
              * kjs/function_object.cpp: (FunctionObjectImp::construct):
              * kjs/identifier.cpp:
              * kjs/lexer.cpp: (Lexer::setCode), (Lexer::shift):
              * kjs/lookup.cpp: (keysMatch):
              * kjs/ustring.cpp: (UString::Rep::computeHash), (KJS::compare):
      	Use the "uc" field instead of the "unicode()" inline function.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d579f5b7
    • darin's avatar
      - fixed a null-dereference I ran into while trying to reproduce bug 3107351 · 8488c964
      darin authored
              * kjs/function.h: Change ActivationImp constructor to take context parameter.
              * kjs/function.cpp: (ActivationImp::ActivationImp): Take context parameter,
      	not execution state parameter.
      
              * kjs/internal.cpp: (ContextImp::ContextImp): Initialize activation object
      	from context, not execution state, because the new context is not yet in the
      	execution state.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2799 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8488c964
  3. 20 Nov, 2002 12 commits
    • darin's avatar
      - added a feature for Richard to use in his back/forward cache · 57017199
      darin authored
              * kjs/object.h: Added save/restoreProperties.
              * kjs/property_map.h: Here too.
              * kjs/property_map.cpp: Here too.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2794 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      57017199
    • darin's avatar
      - created argument list objects only on demand for a 7.5% speedup · 5b1e7b71
      darin authored
              * kjs/function.h: Change ActivationImp around.
              * kjs/function.cpp:
              (FunctionImp::call): Pass a pointer to the arguments list to avoid ref/unref.
              (FunctionImp::get): Get the function pointer from the context directly,
      	not the activation object.
              (ArgumentsImp::ArgumentsImp): Add an overload that takes no arguments.
              (ActivationImp::ActivationImp): Store a context pointer and an arguments object pointer.
              (ActivationImp::get): Special case for arguments, create it and return it.
              (ActivationImp::put): Special case for arguments, can't be set.
              (ActivationImp::hasProperty): Special case for arguments, return true.
              (ActivationImp::deleteProperty): Special case for arguments, refuse to delete.
              (ActivationImp::mark): Mark the arguments object.
              (ActivationImp::createArgumentsObject): Do the work of actually creating it.
              (GlobalFuncImp::call): Use stack-based objects for the ContextImp and ExecState.
      
              * kjs/internal.h: Keep function and arguments pointer in the context.
              * kjs/internal.cpp:
              (ContextImp::ContextImp): Don't pass in the func and args when making an ActivationImp.
              (InterpreterImp::evaluate): Use stack-based objects here.
      
              * kjs/types.h: Add ArgumentList as a synonym for List, soon to be separate.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2792 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5b1e7b71
    • mjs's avatar
      Reduced the size of ValueImp by 8 bytes for a .5% speedup. · c562dc6b
      mjs authored
              * kjs/value.h: Removed destructed flag. Made refcount and flag 16
      	bits each.
              * kjs/value.cpp:
              (ValueImp::~ValueImp): Don't set destructed flag.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c562dc6b
    • darin's avatar
      * kjs/types.cpp: Keep ref count for the whole lists of nodes. · 20330f77
      darin authored
      	Doesn't speed things up much, less than 1%.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2789 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      20330f77
    • mjs's avatar
      * kjs/collector.cpp: · 4debf737
      mjs authored
              (Collector::allocate): Clear the flags on newly allocated objects.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4debf737
    • darin's avatar
      - oops, checked in big regression instead of 5% speedup · 1a208841
      darin authored
              * kjs/function.cpp: (ActivationImp::ActivationImp): Make a marking
      	list, not a refing list.
      
      	- a cut at the sparse array implementation
      
              * kjs/array_instance.h: Keep storageLength separate from length.
              * kjs/array_object.cpp:
              (ArrayInstanceImp::ArrayInstanceImp): Start with storageLength == length.
              (ArrayInstanceImp::get): Check against storage length.
              (ArrayInstanceImp::put): Ditto.
              (ArrayInstanceImp::hasProperty): Ditto.
              (ArrayInstanceImp::deleteProperty): Ditto.
              (ArrayInstanceImp::setLength): Only enlarge storage length up to a cutoff.
              (ArrayInstanceImp::mark): Use storageLength.
              (ArrayInstanceImp::pushUndefinedObjectsToEnd): Added FIXME.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1a208841
    • darin's avatar
      - decrease ref/deref -- 5% speedup in iBench · c758b286
      darin authored
              * JavaScriptCore.pbproj/project.pbxproj: Added array_instance.h
              * kjs/array_instance.h: Added so it can be shared by function.h.
      
              * kjs/array_object.cpp:
              * kjs/array_object.h:
              * kjs/bool_object.cpp:
              * kjs/bool_object.h:
              * kjs/collector.cpp:
              * kjs/date_object.cpp:
              * kjs/date_object.h:
              * kjs/error_object.cpp:
              * kjs/function.cpp:
              * kjs/function.h:
              * kjs/function_object.cpp:
              * kjs/internal.cpp:
              * kjs/internal.h:
              * kjs/math_object.cpp:
              * kjs/nodes.cpp:
              * kjs/number_object.cpp:
              * kjs/object.cpp:
              * kjs/object.h:
              * kjs/object_object.cpp:
              * kjs/property_map.cpp:
              * kjs/reference.cpp:
              * kjs/reference.h:
              * kjs/regexp_object.cpp:
              * kjs/string_object.cpp:
              * kjs/string_object.h:
              * kjs/value.cpp:
              * kjs/value.h:
      	Switched lots of interfaces so they don't require ref/deref.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c758b286
    • mjs's avatar
      Fixed the two most obvious problems with the new GC for another 6% · 3d0d1816
      mjs authored
      	improvement.
      
              * kjs/collector.cpp:
              (Collector::allocate): Don't bother doing the bit tests on a bitmap word if
      	all it's bits are on.
              (Collector::collect): Track memoryFull boolean.
              * kjs/collector.h: Inlined outOfMemory since it was showing up on profiles.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2781 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3d0d1816
    • mjs's avatar
      JavaScriptCore: · 6d32b07d
      mjs authored
      	Rewrote garbage collector to make blocks of actual memory instead
      	of blocks of pointers. 7% improvement on JavaScript
      	iBench. There's still lots of room to tune the new GC, this is
      	just my first cut.
      
              * kjs/collector.cpp:
              (Collector::allocate):
              (Collector::collect):
              (Collector::size):
              (Collector::outOfMemory):
              (Collector::finalCheck):
              (Collector::numGCNotAllowedObjects):
              (Collector::numReferencedObjects):
              (Collector::liveObjectClasses):
              * kjs/collector.h:
              * kjs/function.cpp:
              (ActivationImp::ActivationImp):
              * kjs/function.h:
      
      WebCore:
      
              * force-js-clean-timestamp: Work around PB lameness yet again.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2779 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6d32b07d
    • darin's avatar
      - on the road to killing ActivationImp · 0210a252
      darin authored
              * kjs/function.h: Add get/put to FunctionImp. Remove argumentsObject() from
      	ActivationImp. Add function() to ActivationImp.
              * kjs/function.cpp:
              (FunctionImp::FunctionImp): No arguments property.
              (FunctionImp::call): No need to set up the arguments property.
              (FunctionImp::parameterString): Remove ** strangeness.
              (FunctionImp::processParameters): Ditto.
              (FunctionImp::get): Added, handles arguments and length properties.
              (FunctionImp::put): Ditto.
              (FunctionImp::hasProperty): Ditto.
              (FunctionImp::deleteProperty): Ditto.
              (ActivationImp::ActivationImp): Store a function pointer so we can find it
      	in the context.
      
              * kjs/function_object.cpp: (FunctionObjectImp::construct): No need to set up
      	arguments property.
              * kjs/nodes.cpp: (FuncExprNode::evaluate): No need to set up length property.
      
              * kjs/internal.h: Return ObjectImp * for activation object.
      
              * kjs/interpreter.h: Remove stray declaration of ExecStateImp.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2778 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0210a252
    • darin's avatar
      - add a couple of list operations to avoid clearing lists so much during... · f7fc08d7
      darin authored
      	- add a couple of list operations to avoid clearing lists so much during sorting; gives 1.5% iBench
      
              * kjs/types.h: Added replaceFirst/replaceLast.
              * kjs/types.cpp: (List::replaceFirst), (List::replaceLast): Added.
      
              * kjs/array_object.cpp: (compareWithCompareFunctionForQSort): Use replaceFirst/replaceLast.
      
              * kjs/property_map.cpp: Put in an ifdef so I can re-add/remove the single entry to see if
      	it has outlived its usefulness. (It hasn't yet.)
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2777 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f7fc08d7
    • darin's avatar
      - atomic identifiers; gives another 6.5% in the iBench suite · 302759c8
      darin authored
              * kjs/identifier.h: Did the real thing.
              * kjs/identifier.cpp: Ditto.
      
              * kjs/property_map.h: _tableSizeHashMask -> _tableSizeMask
              * kjs/property_map.cpp: The above, plus take advantage of comparing
      	by pointer instead of by comparing bytes.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2776 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      302759c8
  4. 19 Nov, 2002 11 commits
    • darin's avatar
      - a few more globals for often-used property names · 55be9897
      darin authored
      	- conversion to Identifier from UString must now be explicit
      
              * kjs/error_object.cpp:
              * kjs/function.cpp:
              * kjs/function_object.cpp:
              * kjs/identifier.cpp:
              * kjs/identifier.h:
              * kjs/lexer.cpp:
              * kjs/nodes.cpp:
              * kjs/number_object.cpp:
              * kjs/object.cpp:
              * kjs/object.h:
              * kjs/string_object.cpp:
              * kjs/testkjs.cpp:
              * kjs/ustring.cpp:
              * kjs/ustring.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      55be9897
    • darin's avatar
      - another step towards atomic identifiers; storing hash in the string rep. gives about · 5721aa9d
      darin authored
      	a 1.5% speedup in the JavaScript iBench
      
              * kjs/ustring.h: Add a hash field to UString::Rep.
              * kjs/ustring.cpp:
              (UString::Rep::create): Set hash to uninitialized value.
              (UString::Rep::destroy): Do the deleting in her, and call Identifier if needed.
              (UString::Rep::computeHash): Added.
              (UString::append): Set hash to 0 when modifying the string in place.
              (UString::operator=): Ditto.
      
              * kjs/property_map.cpp: Use the hash from UString.
      
              * kjs/identifier.h: Added aboutToDestroyUStringRep.
              * kjs/identifier.cpp: (Identifier::aboutToDestroyUStringRep): Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2769 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5721aa9d
    • darin's avatar
      JavaScriptCore: · d0ba328e
      darin authored
      	- next step towards atomic identifiers; Identifier is no longer derived from UString
      
              * kjs/identifier.h: Remove base class and add _ustring member.
              * kjs/identifier.cpp: Add null and an == that works with const char *.
              * kjs/property_map.cpp: Get rep through _ustring.
      
              * kjs/function.cpp: (FunctionImp::parameterString): Call ustring().
              * kjs/function_object.cpp: (FunctionProtoFuncImp::call): Ditto.
              * kjs/nodes.cpp:
              (PropertyNode::evaluate): Ditto.
              (VarDeclNode::evaluate): Ditto.
              (ForInNode::execute): Ditto.
              * kjs/nodes2string.cpp: (SourceStream::operator<<): Add overload for Identifier.
              * kjs/reference.cpp: (Reference::getValue): Call ustring().
              * kjs/regexp_object.cpp: (RegExpObjectImp::get): Call ustring().
      
      WebCore:
      
      	- next step towards atomic identifiers; Identifier is no longer derived from UString
      
              * khtml/ecma/kjs_binding.cpp:
              (Identifier::string): Added.
              (Identifier::qstring): Added.
      
              * khtml/ecma/kjs_binding.h:
              * khtml/ecma/kjs_css.cpp:
              (jsNameToProp):
              (DOMCSSStyleDeclaration::tryPut):
              (DOMStyleSheet::tryPut):
              (DOMStyleSheetList::tryGet):
              (DOMMediaList::tryGet):
              (DOMCSSRuleList::tryGet):
              (DOMCSSValueList::tryGet):
              * khtml/ecma/kjs_dom.cpp:
              (DOMNodeList::hasProperty):
              (DOMNodeList::tryGet):
              (DOMNodeListFunc::DOMNodeListFunc):
              (DOMElement::tryGet):
              (DOMNamedNodeMap::hasProperty):
              (DOMNamedNodeMap::tryGet):
              (DOMNamedNodesCollection::tryGet):
              * khtml/ecma/kjs_html.cpp:
              (KJS::HTMLDocument::tryGet):
              (HTMLElementFunction::HTMLElementFunction):
              (KJS::HTMLElement::putValue):
              (KJS::HTMLCollection::hasProperty):
              (KJS::HTMLCollection::tryGet):
              (KJS::HTMLSelectCollection::tryPut):
              (OptionConstructorImp::OptionConstructorImp):
              * khtml/ecma/kjs_navigator.cpp:
              (Plugins::get):
              (MimeTypes::get):
              (Plugin::get):
              * khtml/ecma/kjs_window.cpp:
              (WindowFunc::tryCall):
              (FrameArray::get):
      	Use lengthPropertyName instead of "length" for better speed.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2766 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d0ba328e
    • darin's avatar
      - fixed memory trasher · ff56afa0
      darin authored
              * kjs/ustring.cpp: (UString::from): Fix "end of buffer" computation.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2762 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ff56afa0
    • darin's avatar
      JavaScriptCore: · 880105d6
      darin authored
      	- a first step towards atomic identifiers in JavaScript
      
      	Most places that work with identifiers now use Identifier
      	instead of UString.
      
              * kjs/identifier.cpp: Added.
              * kjs/identifier.h: Added.
              * JavaScriptCore.pbproj/project.pbxproj: Added files.
      
              * kjs/array_object.cpp:
              * kjs/array_object.h:
              * kjs/completion.cpp:
              * kjs/completion.h:
              * kjs/date_object.cpp:
              * kjs/date_object.h:
              * kjs/function.cpp:
              * kjs/function.h:
              * kjs/function_object.cpp:
              * kjs/grammar.cpp:
              * kjs/grammar.cpp.h:
              * kjs/grammar.h:
              * kjs/grammar.y:
              * kjs/internal.cpp:
              * kjs/internal.h:
              * kjs/lexer.cpp:
              * kjs/lookup.cpp:
              * kjs/lookup.h:
              * kjs/math_object.cpp:
              * kjs/math_object.h:
              * kjs/nodes.cpp:
              * kjs/nodes.h:
              * kjs/number_object.cpp:
              * kjs/number_object.h:
              * kjs/object.cpp:
              * kjs/object.h:
              * kjs/property_map.cpp:
              * kjs/property_map.h:
              * kjs/reference.cpp:
              * kjs/reference.h:
              * kjs/regexp_object.cpp:
              * kjs/regexp_object.h:
              * kjs/string_object.cpp:
              * kjs/string_object.h:
      
      WebCore:
      
      	- a first step towards atomic identifiers in JavaScript
      
      	Most places that work with identifiers now use Identifier
      	instead of UString.
      
              * khtml/ecma/kjs_binding.cpp:
              * khtml/ecma/kjs_binding.h:
              * khtml/ecma/kjs_css.cpp:
              * khtml/ecma/kjs_css.h:
              * khtml/ecma/kjs_dom.cpp:
              * khtml/ecma/kjs_dom.h:
              * khtml/ecma/kjs_events.cpp:
              * khtml/ecma/kjs_events.h:
              * khtml/ecma/kjs_html.cpp:
              * khtml/ecma/kjs_html.h:
              * khtml/ecma/kjs_navigator.cpp:
              * khtml/ecma/kjs_navigator.h:
              * khtml/ecma/kjs_range.cpp:
              * khtml/ecma/kjs_range.h:
              * khtml/ecma/kjs_traversal.cpp:
              * khtml/ecma/kjs_traversal.h:
              * khtml/ecma/kjs_views.cpp:
              * khtml/ecma/kjs_views.h:
              * khtml/ecma/kjs_window.cpp:
              * khtml/ecma/kjs_window.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2760 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      880105d6
    • darin's avatar
      - fix hash function and key comparison for the other kind of hash table; yields 3% · 091be39c
      darin authored
              * kjs/lookup.cpp:
              (keysMatch): Added.
              (Lookup::findEntry): Don't allocate and convert to ASCII just to search.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2758 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      091be39c
    • darin's avatar
      - another hash table fix; yields a 2% improvement on iBench JavaScript · 8091bedc
      darin authored
              * kjs/property_map.cpp: A few more places where we use & instead of %.
      
      	- some List changes that don't affect speed yet
      
              * kjs/types.cpp:
              (List::prependList): Tighten up a tiny bit.
              (List::copy): Use prependList.
              * kjs/types.h: Remove appendList and globalClear.
      
              * kjs/interpreter.cpp: (Interpreter::finalCheck): Remove List::globalClear().
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2757 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8091bedc
    • darin's avatar
      - fixed 3105026 -- REGRESSION: DHTML menus are broken all over the place · 8943db9c
      darin authored
              * kjs/types.cpp: (List::prepend): Fix backwards links in new node.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2756 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8943db9c
    • darin's avatar
      - a fix that gives another 1.5% on the iBench JavaScript test · 451d435e
      darin authored
              * kjs/ustring.cpp: (UString::from): Stop using sprintf to format integers.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2754 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      451d435e
    • darin's avatar
      JavaScriptCore: · 66092a36
      darin authored
      	- reduced the creation of Value objects and hoisted the property map
              into Object for another gain of about 6%
      
              * JavaScriptCore.pbproj/project.pbxproj: Made property_map.h public.
              * kjs/array_object.cpp:
              (compareWithCompareFunctionForQSort): Don't wrap the ValueImp * in a Value
      	just to add it to a list.
              (ArrayProtoFuncImp::call): Pass the globalObject directly so we don't have
      	to ref/deref.
              * kjs/function.cpp:
              (FunctionImp::call): Use a reference for the global object to avoid ref/deref.
              (GlobalFuncImp::call): Ditto.
              * kjs/internal.cpp:
              (BooleanImp::toObject): Put the object directly into the list, don't create a Value.
              (StringImp::toObject): Ditto.
              (NumberImp::toObject): Ditto.
              (InterpreterImp::evaluate): Use a reference for the global object.
              * kjs/internal.h: Return a reference for the global object.
              * kjs/interpreter.cpp: (Interpreter::globalObject): Ditto.
              * kjs/interpreter.h: Ditto.
              * kjs/object.cpp: Use _prop directly in the object, not a separate pointer.
              * kjs/object.h: Ditto.
              * kjs/types.cpp: Added List methods that work directly with ValueImp.
              (List::append): Added a ValueImp version.
              (List::prepend): Ditto.
              (List::appendList): Work directly with the ValueImp's.
              (List::prependList): Ditto.
              (List::copy): Use appendList.
              (List::empty): Use a shared global List.
              * kjs/types.h: Update for above changes.
      
      WebCore:
      
              * force-js-clean-timestamp: Another Object change.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2753 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      66092a36
    • darin's avatar
      * kjs/property_map.cpp: Oops, copyright goes to Apple, not me. · f1fce4bd
      darin authored
              * kjs/property_map.h: Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2751 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f1fce4bd
  5. 18 Nov, 2002 6 commits
    • darin's avatar
      - property and string improvements giving a 7% or so improvement in JavaScript iBench · a6cae2cc
      darin authored
              * kjs/property_map.h: Rewrite to use a hash table.
              * kjs/property_map.cpp: Ditto.
      
              * kjs/string_object.h:
              * kjs/string_object.cpp:
              (StringInstanceImp::StringInstanceImp): Construct a string with the right value
      	instead of putting the string in later.
              (StringInstanceImp::get): Get the length from the string, not a separate property.
              (StringInstanceImp::put): Ignore attempts to set length, since we don't put it in
      	the property map.
              (StringInstanceImp::hasProperty): Return true for length.
              (StringInstanceImp::deleteProperty): Return false for length.
              (StringObjectImp::construct): Call new StringInstanceImp constructor. Don't try
      	to set a length property.
      
              * kjs/ustring.h: Make the rep deref know how to deallocate the rep.
              * kjs/ustring.cpp:
              (UString::release): Move the real work to the rep's deref, since the hash table
      	now uses the rep directly.
      
              * kjs/object.h: Remove unused field.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2749 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a6cae2cc
    • mjs's avatar
      Change List to completely avoid going through the GC · 1e8f66ff
      mjs authored
      	allocator. 3.6% performance improvement on JavaScript iBench.
      
              * kjs/internal.cpp:
              (InterpreterImp::mark): Don't mark the empty list.
      
      	For all the methods below I basically lifted the ListImp version
      	up to the List method with minor tweaks.
      
              * kjs/types.cpp:
              (ListIterator::ListIterator):
              (List::List):
              (List::operator=):
              (List::~List):
              (List::mark):
              (List::append):
              (List::prepend):
              (List::appendList):
              (List::prependList):
              (List::removeFirst):
              (List::removeLast):
              (List::remove):
              (List::clear):
              (List::clearInternal):
              (List::copy):
              (List::begin):
              (List::end):
              (List::isEmpty):
              (List::size):
              (List::at):
              (List::operator[]):
              (List::empty):
              (List::erase):
              (List::refAll):
              (List::derefAll):
              (List::swap):
              (List::globalClear):
              * kjs/types.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2748 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1e8f66ff
    • mjs's avatar
      Fixed a horrible leak introduced with my last change that · 6e9d9853
      mjs authored
      	somehow did not show up on my machine.
      
              * kjs/types.cpp:
              (List::List): Mark ListImp as GC allowed.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2747 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6e9d9853
    • mjs's avatar
      Another step towards the List conversion: stop inheriting from Value. · 3964a7b6
      mjs authored
              * kjs/types.cpp:
              (ListIterator::ListIterator):
              (List::List):
              (List::operator=):
              (List::~List):
              (List::mark):
              (List::append):
              (List::prepend):
              (List::appendList):
              (List::prependList):
              (List::removeFirst):
              (List::removeLast):
              (List::remove):
              (List::clear):
              (List::copy):
              (List::begin):
              (List::end):
              (List::isEmpty):
              (List::size):
              (List::at):
              (List::operator[]):
              * kjs/types.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2744 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3964a7b6
    • mjs's avatar
      JavaScriptCore: · effd7e1c
      mjs authored
      	Partway to removing Value from List. Created a marking List
      	variant, used it in place of ListImp.
      
              * kjs/internal.h: Removed List stuff.
              * kjs/internal.cpp:
              (InterpreterImp::mark): Call appropriate List method to do marking of
      	empty ListImp.
              * kjs/object.h:
              * kjs/object.cpp: Use marking List instead of ListImp *.
              * kjs/types.h:
              * kjs/types.cpp:
              (List::List): New boolean needsMarking parameter.
              (List::operator=): Perform trickery related to needsMarking.
              (List::~List): Likewise.
              (List::mark): Mark the ListImp.
              (List::markEmptyList):
      	(ListImp::*): Moved here fron internal.cpp, they will be
      	integrated into the relevant List methods soon.
      
      WebCore:
      
              * force-js-clean-timestamp: Rebuild for JSC changes.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2741 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      effd7e1c
    • darin's avatar
      - another string constant discovered that can be optimized · 2dd6a841
      darin authored
              * kjs/object.h: Add a property name constant for "__proto__".
              * kjs/object.cpp: Define it.
      	(ObjectImp::get): Use it.
      	(ObjectImp::hasProperty): Use it.
      
      	- prepare to turn PropertyMap into a hash table
      
              * kjs/object.cpp:
      	(ObjectImp::mark): Use the new PropertyMap::mark().
      	(ObjectImp::put): Use the new overload of PropertyMap::get().
      	(ObjectImp::deleteProperty): Use the new overload of PropertyMap::get().
      	(ObjectImp::propList): Use PropertyMap::addEnumerablesToReferenceList().
      
              * kjs/property_map.h: Remove PropertyMapNode and make all node-related methods private.
      	Add mark(), a new overload of get() that returns attributes, a clear() that takes no attributes,
      	and addEnumerablesToReferenceList().
              * kjs/property_map.cpp:
      	(PropertyMap::get): Added new overload.
      	(PropertyMap::clear): Added new overload.
      	(PropertyMap::mark): Added.
      	(PropertyMap::addEnumerablesToReferenceList): Added.
      
              * kjs/ustring.h: Added a hash function.
              * kjs/ustring.cpp: (KJS::hash): Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2740 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2dd6a841