2007-10-25  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Maciej Stachowiak.
        
        Tweaked the inner hashtable lookup loop to remove a branch in the "not 
        found" case. .5% speedup on SunSpider.

        * JavaScriptCore.xcodeproj/project.pbxproj:
        * wtf/HashTable.h:
        (WTF::::lookup):

2007-10-25  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Oliver.

        - fold together toPrimitive() and toNumber() conversions for 0.5% gain on SunSpider

        * kjs/nodes.cpp:
        (KJS::SubNode::evaluate): Subtract directly, since toPrimitive() is not
        adding any value over toNumber() here.
        (KJS::valueForReadModifyAssignment): Ditto.
        (KJS::lessThan): Use new getPrimitiveNumber() method to avoid some virtual calls
        and branches.
        (KJS::lessThanEq): Ditto.
        * JavaScriptCore.exp: Export new functions as needed.
        * kjs/value.h:
        (KJS::JSValue::toPrimitive): Fixed formatting.
        (KJS::JSValue::getPrimitiveNumber): New method - this simultaneously converts
        to number and tells you whether a toPrimitive() conversion with a Number hint
        would have given a string.
        * kjs/internal.cpp:
        (KJS::StringImp::getPrimitiveNumber): Implemented. 
        (KJS::NumberImp::getPrimitiveNumber): ditto
        (KJS::GetterSetterImp::getPrimitiveNumber): ditto
        (KJS::StringImp::toPrimitive): Fixed formatting.
        (KJS::NumberImp::toPrimitive): ditto
        (KJS::GetterSetterImp::toPrimitive): ditto
        * kjs/internal.h:
        * kjs/object.cpp:
        (KJS::JSObject::getPrimitiveNumber): Implemented.
        * kjs/object.h:

2007-10-25  Sam Weinig  <sam@webkit.org>

        Reviewed by Adam Roben.

        Remove JSStringRefCFHack from windows as it is no longer needed.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:

2007-10-25  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Oliver Hunt.
        
        Rolled out my last patch. It turns out that I needed 2 words, not 1,
        so it didn't help.

2007-10-25  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Oliver Hunt.
        
        Fixed http://bugs.webkit.org/show_bug.cgi?id=15694
        Shrink the size of an activation object by 1 word
        
        This is in preparation for adding a symbol table to the activation 
        object.
        
        The basic strategy here is to rely on the mutual exclusion between
        the arguments object pointer and the function pointer (you only need
        the latter in order to create the former), and store them in the same 
        place. The LazyArgumentsObject class encapsulates this strategy.
        
        Also inlined the ArgumentsImp constructor, for good measure.
        
        SunSpider reports no regression. Regression tests pass.

        * JavaScriptCore.xcodeproj/project.pbxproj:
        * kjs/Context.cpp:
        (KJS::Context::~Context):
        * kjs/function.cpp:
        (KJS::ActivationImp::LazyArgumentsObject::createArgumentsObject):
        (KJS::ActivationImp::LazyArgumentsObject::mark):
        (KJS::):
        (KJS::ActivationImp::argumentsGetter):
        (KJS::ActivationImp::mark):
        * kjs/function.h:
        (KJS::ActivationImp::LazyArgumentsObject::LazyArgumentsObject):
        (KJS::ActivationImp::LazyArgumentsObject::getOrCreate):
        (KJS::ActivationImp::LazyArgumentsObject::resetArguments):
        (KJS::ActivationImp::LazyArgumentsObject::setArgumentsObject):
        (KJS::ActivationImp::LazyArgumentsObject::argumentsObject):
        (KJS::ActivationImp::LazyArgumentsObject::setFunction):
        (KJS::ActivationImp::LazyArgumentsObject::function):
        (KJS::ActivationImp::LazyArgumentsObject::createdArgumentsObject):
        (KJS::ActivationImp::LazyArgumentsObject::):
        (KJS::ActivationImp::ActivationImp::ActivationImp):
        (KJS::ActivationImp::resetArguments):

2007-10-25  Adam Roben  <aroben@apple.com>

        Change JavaScriptCore.vcproj to use DerivedSources.make

        We were trying to emulate the logic of make in
        build-generated-files.sh, but we got it wrong. We now use a
        build-generated-files very much like the one that WebCore uses to
        invoke make.

        We also now only have a Debug configuration of dftables which we build
        even when doing a Release build of JavaScriptCore. dftables also no
        longer has the "_debug" name suffix.

        Changes mostly made by Darin, reviewed by me.

        * DerivedSources.make: Add a variable to set the extension used for
        the dftables executable.
        * JavaScriptCore.vcproj/JavaScriptCore.sln: Updated to use Debug
        dftables in Release configurations.
        * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln: Ditto.
        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
           - Updated include path to point to the new location of the derived
             sources.
           - Modified pre-build event to pass the right arguments to
             build-generated-files.sh and not call dftables directly.
           - Added the derived source files to the project.
           - Removed grammarWrapper.cpp, which isn't needed now that we're
             compiling grammar.cpp directly.
        * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
        Slightly modified from the WebCore version.
        * JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Removed.
        * JavaScriptCore.vcproj/dftables/dftables.vcproj:
            - Changed the output location to match Mac.
            - Removed the Release configuration.
            - Removed the _debug suffix.

2007-10-25  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Eric Seidel.
        
        Slightly elaborated the differences between declaration procesing in 
        Function Code and Program Code.
        
        .3% speedup on SunSpider.

        * kjs/nodes.cpp:
        (KJS::FunctionBodyNode::processDeclarationsFunctionCode): 
        (KJS::FunctionBodyNode::processDeclarationsProgramCode): Store a 
        minimum set of attributes instead of recomputing all the time. Also,
        ignore m_parameters, since programs don't have arguments.

2007-10-25  Eric Seidel  <eric@webkit.org>

        Reviewed by Maciej.
        
        More preparation work before adding long-running mode to testkjs.

        * kjs/testkjs.cpp:
        (TestFunctionImp::callAsFunction):
        (prettyPrintScript):
        (runWithScripts):
        (parseArguments):
        (kjsmain):
        (fillBufferWithContentsOfFile):

2007-10-25  Eric Seidel  <eric@webkit.org>

        Reviewed by Maciej.
        
        Bring testkjs code out of the dark ages in preparation for more
        radical improvements (like long-running testing support!)

        * kjs/testkjs.cpp:
        (TestFunctionImp::callAsFunction):
        (setupInterpreter):
        (doIt):
        (fillBufferWithContentsOfFile):

2007-10-25  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Maciej Stachowiak.
        
        Make a fast path for declaration processing inside Function Code.
        
        Lifted declaration processing code up from individual declaration nodes
        and into processDeclarations.
        
        Broke out processDeclarations into two cases, depending on the type of 
        code. This eliminates 2 branches, and facilitates more radical 
        divergeance in the future.
        
        2.5% SunSpider speedup.

        * JavaScriptCore.xcodeproj/project.pbxproj:
        * kjs/nodes.cpp:
        (KJS::FunctionBodyNode::initializeDeclarationStacks):
        (KJS::FunctionBodyNode::processDeclarationsFunctionCode):
        (KJS::FunctionBodyNode::processDeclarationsProgramCode):
        (KJS::FunctionBodyNode::execute):
        (KJS::FuncDeclNode::makeFunction):
        * kjs/nodes.h:
        (KJS::):

2007-10-25  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Adam.
        
        - add header includes needed on platforms that don't use AllInOneFile.cpp

        * API/JSCallbackObject.cpp:
        * kjs/Context.cpp:
        * kjs/ExecState.cpp:
        * kjs/array_instance.cpp:
        * kjs/function_object.cpp:
        * kjs/interpreter.cpp:
        * kjs/nodes.cpp:

2007-10-25  Eric Seidel  <eric@webkit.org>

        Reviewed by Geoff.

        * JavaScriptCore.xcodeproj/project.pbxproj: re-mark JSGlobalObject.h as private

2007-10-25  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Maciej Stachowiak.
        
        Fixed http://bugs.webkit.org/show_bug.cgi?id=15683
        Re-order declaration initialization to avoid calling hasProperty inside
        VarDeclNode::processDeclaration
        
        .7% speedup on SunSpider.

        * kjs/function.h:
        * kjs/function.cpp: Merged parameter processing into FunctionBodyNode's
        other processing of declared symbols, so the order of execution could 
        change.

        * kjs/nodes.cpp:
        (KJS::VarDeclNode::getDeclarations): Added special case for the 
        "arguments" property name, explained in the comment.

        (KJS::VarDeclNode::processDeclaration): Removed call to hasProperty
        in the case of function code, since we know the declared symbol
        management will resolve conflicts between symbols. Yay!

        (KJS::VarDeclListNode::getDeclarations): Now that VarDeclNode's 
        implementation of getDeclarations is non-trivial, we can't take a 
        short-cut here any longer -- we need to put the VarDecl node on the 
        stack so it gets processed normally.

        (KJS::FunctionBodyNode::processDeclarations): Changed the order of 
        processing to enforce mutual exclusion rules.

        * kjs/nodes.h:
        (KJS::DeclarationStacks::DeclarationStacks): Structure includes an 
        ExecState now, for fast access to the "arguments" property name.

2007-10-24  Eric Seidel  <eric@webkit.org>

        Reviewed by Maciej.
        
        Add a JSGlobalObject class and remove the InterpreterMap
        http://bugs.webkit.org/show_bug.cgi?id=15681
        
        This required making JSCallbackObject a template class to allow for
        JSGlobalObjects with JSCallbackObject functionality.
        
        SunSpider claims this was a 0.5% speedup.

        * API/JSCallbackObject.cpp:
        (KJS::):
        * API/JSCallbackObject.h:
        * API/JSCallbackObjectFunctions.h: Copied from API/JSCallbackObject.cpp.
        (KJS::::JSCallbackObject):
        (KJS::::init):
        (KJS::::~JSCallbackObject):
        (KJS::::initializeIfNeeded):
        (KJS::::className):
        (KJS::::getOwnPropertySlot):
        (KJS::::put):
        (KJS::::deleteProperty):
        (KJS::::implementsConstruct):
        (KJS::::construct):
        (KJS::::implementsHasInstance):
        (KJS::::hasInstance):
        (KJS::::implementsCall):
        (KJS::::callAsFunction):
        (KJS::::getPropertyNames):
        (KJS::::toNumber):
        (KJS::::toString):
        (KJS::::setPrivate):
        (KJS::::getPrivate):
        (KJS::::inherits):
        (KJS::::cachedValueGetter):
        (KJS::::staticValueGetter):
        (KJS::::staticFunctionGetter):
        (KJS::::callbackGetter):
        * API/JSClassRef.cpp:
        (OpaqueJSClass::prototype):
        * API/JSContextRef.cpp:
        (JSGlobalContextCreate):
        * API/JSObjectRef.cpp:
        (JSObjectMake):
        (JSObjectGetPrivate):
        (JSObjectSetPrivate):
        * API/JSValueRef.cpp:
        (JSValueIsObjectOfClass):
        * JavaScriptCore.exp:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * bindings/c/c_utility.cpp:
        (KJS::Bindings::convertValueToNPVariant):
        * bindings/jni/jni_jsobject.cpp:
        * bindings/objc/objc_utility.mm:
        (KJS::Bindings::convertValueToObjcValue):
        * kjs/Context.cpp:
        (KJS::Context::Context):
        * kjs/ExecState.cpp:
        (KJS::ExecState::lexicalInterpreter):
        * kjs/JSGlobalObject.h: Added.
        (KJS::JSGlobalObject::JSGlobalObject):
        (KJS::JSGlobalObject::isGlobalObject):
        (KJS::JSGlobalObject::interpreter):
        (KJS::JSGlobalObject::setInterpreter):
        * kjs/array_instance.cpp:
        * kjs/context.h:
        * kjs/function.cpp:
        (KJS::FunctionImp::callAsFunction):
        (KJS::GlobalFuncImp::callAsFunction):
        * kjs/interpreter.cpp:
        (KJS::Interpreter::Interpreter):
        (KJS::Interpreter::init):
        (KJS::Interpreter::~Interpreter):
        (KJS::Interpreter::globalObject):
        (KJS::Interpreter::initGlobalObject):
        (KJS::Interpreter::evaluate):
        * kjs/interpreter.h:
        * kjs/lookup.h:
        (KJS::cacheGlobalObject):
        * kjs/object.h:
        (KJS::JSObject::isGlobalObject):
        * kjs/testkjs.cpp:

2007-10-24  Eric Seidel  <eric@webkit.org>

        Build fix for Gtk, no review.

        * kjs/collector.cpp: #include "context.h"

2007-10-24  Eric Seidel  <eric@webkit.org>

        Reviewed by Maciej.
        
        Stop checking isOutOfMemory after every allocation, instead let the collector
        notify all ExecStates if we ever hit this rare condition.
        
        SunSpider claims this was a 2.2% speedup.

        * kjs/collector.cpp:
        (KJS::Collector::collect):
        (KJS::Collector::reportOutOfMemoryToAllInterpreters):
        * kjs/collector.h:
        * kjs/nodes.cpp:
        (KJS::TryNode::execute):

2007-10-24  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.

        * kjs/identifier.h:  Remove extra qualification.

2007-10-24  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Sam Weinig.
        
        Disable ALWAYS_INLINE in debug builds, since it drives the debugger
        crazy.

        * wtf/AlwaysInline.h:

2007-10-24  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Sam Weinig.
        
        Inlined the fast path for creating an Identifier from an Identifier. 
        
        This is a .4% speedup on SunSpider overall, but as big as a 2.5% 
        speedup on certain individual tests. 65% of the Identifiers creating 
        by SunSpider are already Identifiers.
        
        (The main reason I'm making this change is that it resolves a large
        regression in a patch I haven't checked in yet.)

        * JavaScriptCore.exp:
        * kjs/identifier.cpp:
        (KJS::Identifier::addSlowCase):
        * kjs/identifier.h:
        (KJS::Identifier::Identifier::add):

2007-10-24  Lars Knoll  <lars@trolltech.com>

        Reviewed by Simon.

        some changes to the way JS values are converted to Qt values in the script bindings. Added support for converting JS arrays into QStringList's.

        * bindings/qt/qt_instance.cpp:
        (KJS::Bindings::QtInstance::invokeMethod):
        * bindings/qt/qt_runtime.cpp:
        (KJS::Bindings::convertValueToQVariant):
        (KJS::Bindings::QtField::setValueToInstance):

2007-10-24  Oliver Hunt  <oliver@apple.com>

        Reviewed by Darin.

        Remove old relation method, replace with specialised LessThan and lessThenEq functions for a 0.5-0.6% improvement in SunSpider

        * kjs/nodes.cpp:
        (KJS::lessThan):
        (KJS::lessThanEq):
        (KJS::LessNode::evaluate):
        (KJS::GreaterNode::evaluate):
        (KJS::LessEqNode::evaluate):
        (KJS::GreaterEqNode::evaluate):
        * kjs/operations.cpp:
        * kjs/operations.h:

2007-10-24  Eric Seidel  <eric@webkit.org>

        Reviewed by darin.

        * kjs/nodes.h:
        (KJS::ImmediateNumberNode::): Fix ASSERT correctness (and debug build!)

2007-10-24  Darin Adler  <darin@apple.com>

        Reviewed by Eric.

        * kjs/object.cpp: (KJS::JSObject::defaultValue): Get rid of a little
        Identifier ref/deref for what SunSpider claims is a 0.4% speedup.

2007-10-24  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - separate out the code to create a hash table the first time from the code
          to rehash

        SunSpider claims this was a 0.7% speedup.

        * kjs/property_map.cpp:
        (KJS::PropertyMap::expand): Changed to call either createTable or rehash.
        (KJS::PropertyMap::createTable): Added. For the case where we had no table.
        (KJS::PropertyMap::rehash): Removed code needed only in the case where we
        had no table.
        * kjs/property_map.h: Added createTable.

2007-10-24  Eric Seidel  <eric@webkit.org>

        Reviewed by darin.
        
        Add ImmediateNumberNode to hold a JSValue* instead of a double for numbers
        which can be represented by JSImmediate.
        
        SunSpider claims this was a 0.6% speedup.

        * kjs/grammar.y:
        * kjs/nodes.cpp:
        (KJS::NumberNode::evaluate):
        (KJS::ImmediateNumberNode::evaluate):
        * kjs/nodes.h:
        (KJS::Node::):
        (KJS::ImmediateNumberNode::):
        * kjs/nodes2string.cpp:
        (ImmediateNumberNode::streamTo):

2007-10-24  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - http://bugs.webkit.org/show_bug.cgi?id=15657
          change static hash tables to use powers of two for speed

        Seems to give 0.7% SunSpider speedup.

        * kjs/create_hash_table: Updated to generate new format.
        * kjs/lookup.cpp:
        (KJS::keysMatch): Took out unneeded typecast.
        (KJS::findEntry): Updated to expect table type 3 -- changed the printf to a plain old assert.
        Replaced the modulus with a bit mask.
        (KJS::Lookup::findEntry): Get the hash directly, since we know identifiers already have computed
        their hash -- saves a branch.
        (KJS::Lookup::find): Ditto.
        * kjs/lookup.h: Changed attr from 2-byte value to one-byte value. Replaced hashSize with hashSizeMask.

2007-10-24  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.
        
        - remove KJS_CHECKEXCEPTIONs in places where exceptions can't happen for 0.6% SunSpider speedup

        * kjs/nodes.cpp:
        (KJS::DoWhileNode::execute):
        (KJS::WhileNode::execute):
        (KJS::ForNode::execute):
        (KJS::ForInNode::execute):
        (KJS::SourceElementsNode::execute):

2007-10-23  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        * kjs/JSImmediate.h: (KJS::JSImmediate::getUInt32):
        Changed an && to an & for a 1% gain in SunSpider.

2007-10-23  Oliver Hunt  <oliver@apple.com>

        Reviewed by Maciej.

        Reduce branching in implementations of some operator implementations, yielding 1.3% boost to SunSpider.

        * kjs/nodes.cpp:
        (KJS::MultNode::evaluate):
        (KJS::DivNode::evaluate):
        (KJS::ModNode::evaluate):
        (KJS::add):
        (KJS::sub):
        (KJS::AddNode::evaluate):
        (KJS::SubNode::evaluate):
        (KJS::valueForReadModifyAssignment):
        * kjs/operations.cpp:
        * kjs/operations.h:

2007-10-23  Oliver Hunt  <oliver@apple.com>

        Reviewed by Maciej.

        Separating all of the simple (eg. non-read-modify-write) binary operators
        into separate classes in preparation for further JS optimisations.
        
        Happily this produces a 0.8% to 1.0% performance increase in SunSpider with
        no further work.

        * JavaScriptCore.xcodeproj/project.pbxproj:
        * kjs/grammar.y:
        * kjs/nodes.cpp:
        (KJS::MultNode::evaluate):
        (KJS::DivNode::evaluate):
        (KJS::ModNode::evaluate):
        (KJS::AddNode::evaluate):
        (KJS::SubNode::evaluate):
        (KJS::LeftShiftNode::evaluate):
        (KJS::RightShiftNode::evaluate):
        (KJS::UnsignedRightShiftNode::evaluate):
        (KJS::LessNode::evaluate):
        (KJS::GreaterNode::evaluate):
        (KJS::LessEqNode::evaluate):
        (KJS::GreaterEqNode::evaluate):
        (KJS::InstanceOfNode::evaluate):
        (KJS::InNode::evaluate):
        (KJS::EqualNode::evaluate):
        (KJS::NotEqualNode::evaluate):
        (KJS::StrictEqualNode::evaluate):
        (KJS::NotStrictEqualNode::evaluate):
        (KJS::BitAndNode::evaluate):
        (KJS::BitXOrNode::evaluate):
        (KJS::BitOrNode::evaluate):
        (KJS::LogicalAndNode::evaluate):
        (KJS::LogicalOrNode::evaluate):
        * kjs/nodes.h:
        (KJS::MultNode::):
        (KJS::DivNode::):
        (KJS::ModNode::):
        (KJS::AddNode::):
        (KJS::SubNode::):
        (KJS::LeftShiftNode::):
        (KJS::RightShiftNode::):
        (KJS::UnsignedRightShiftNode::):
        (KJS::LessNode::):
        (KJS::GreaterNode::):
        (KJS::LessEqNode::):
        (KJS::GreaterEqNode::):
        (KJS::InstanceOfNode::):
        (KJS::InNode::):
        (KJS::EqualNode::):
        (KJS::NotEqualNode::):
        (KJS::StrictEqualNode::):
        (KJS::NotStrictEqualNode::):
        (KJS::BitAndNode::):
        (KJS::BitOrNode::):
        (KJS::BitXOrNode::):
        (KJS::LogicalAndNode::):
        (KJS::LogicalOrNode::):
        * kjs/nodes2string.cpp:
        (MultNode::streamTo):
        (DivNode::streamTo):
        (ModNode::streamTo):
        (AddNode::streamTo):
        (SubNode::streamTo):
        (LeftShiftNode::streamTo):
        (RightShiftNode::streamTo):
        (UnsignedRightShiftNode::streamTo):
        (LessNode::streamTo):
        (GreaterNode::streamTo):
        (LessEqNode::streamTo):
        (GreaterEqNode::streamTo):
        (InstanceOfNode::streamTo):
        (InNode::streamTo):
        (EqualNode::streamTo):
        (NotEqualNode::streamTo):
        (StrictEqualNode::streamTo):
        (NotStrictEqualNode::streamTo):
        (BitAndNode::streamTo):
        (BitXOrNode::streamTo):
        (BitOrNode::streamTo):
        (LogicalAndNode::streamTo):

2007-10-23  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fix http://bugs.webkit.org/show_bug.cgi?id=15639
          fix Math.abs(0), Math.ceil(-0), and Math.floor(-0)

        Test: fast/js/math.html

        * kjs/math_object.cpp: (MathFuncImp::callAsFunction):
        Fix abs to look at the sign bit. Add a special case for values in the range
        between -0 and -1 and a special case for ceil and for -0 for floor.

2007-10-23  Darin Adler  <darin@apple.com>

        Reviewed by Eric.

        - streamline exception handling code for a >1% speed-up of SunSpider

        * kjs/nodes.cpp: Changed macros to use functions for everything that's not
        part of normal execution. We'll take function call overhead when propagating
        an exception or out of memory.
        (KJS::createOutOfMemoryCompletion): Added.
        (KJS::substitute): Use append instead of the relatively inefficient + operator.
        (KJS::Node::rethrowException): Added.
        * kjs/nodes.h: Added rethrowException.

2007-10-22  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fix http://bugs.webkit.org/show_bug.cgi?id=15636
          some JavaScriptCore regression tests are failing due to numeric conversion

        This should restore correctness and make speed better too, restoring some
        of the optimization we lost in my last check-in.

        * kjs/JSImmediate.h:
        (KJS::JSImmediate::getTruncatedInt32): Added. Uses the range checking idiom
        I used in my patch yesterday.
        (KJS::JSImmediate::getTruncatedUInt32): Ditto.

        * kjs/internal.h: Removed getInt32 and added getTruncatedInt/UInt32.
        * kjs/internal.cpp:
        (KJS::NumberImp::getUInt32): Changed to always use double, since I can't find
        a way to write this more efficiently for float.
        (KJS::NumberImp::getTruncatedInt32): Added.
        (KJS::NumberImp::getTruncatedUInt32): Added.

        * kjs/value.h: Removed getInt32 and added getTruncatedInt/UInt32.
        (KJS::JSValue::getUInt32):
        (KJS::JSValue::getTruncatedInt32): Added.
        (KJS::JSValue::getTruncatedUInt32): Added.
        (KJS::JSValue::toInt32): Changed getInt32 call to getTruncatedInt32.
        (KJS::JSValue::toUInt32): Changed getUInt32 call to getTruncatedUInt32.
        * kjs/value.cpp:
        (KJS::JSCell::getTruncatedInt32): Added.
        (KJS::JSCell::getTruncatedUInt32): Added.
        (KJS::JSValue::toInteger): Changed getUInt32 call to getTruncatedInt32.
        (KJS::JSValue::toInt32SlowCase): Removed extra getInt32 call I accidentally
        had left in here.
        (KJS::JSValue::toUInt32SlowCase): Ditto.
        (KJS::JSValue::toUInt16): Changed getUInt32 call to getTruncatedUInt32.

        * JavaScriptCore.exp: Updated.

2007-10-22  Darin Adler  <darin@apple.com>

        Reviewed by Geoff.

        - fix http://bugs.webkit.org/show_bug.cgi?id=15632
          js1_5/Array/array-001.js test failing

        One of the JavaScriptCore tests was failing; it failed because of
        my change to NumberImp::getUInt32. The incorrect code I copied was
        from JSImmediate::getUInt32, and was a pre-existing bug.

        This patch fixes correctness, but will surely slow down SunSpider.
        We may be able to code this tighter and get the speed back.

        * kjs/JSImmediate.h:
        (KJS::JSImmediate::getInt32): Renamed from toInt32 to more accurately
        reflect the fact that this function only returns true if the value is
        accurate (no fractional part, etc.). Changed code so that it returns
        false when the value has a fraction.
        (KJS::JSImmediate::getUInt32): Ditto.

        * kjs/internal.cpp:
        (KJS::NumberImp::getInt32): Changed code so that it returns false when
        the value has a fraction. Restores the old behavior.
        (KJS::NumberImp::getUInt32): Ditto.

        * kjs/value.h:
        (KJS::JSValue::getInt32): Updated for name change.
        (KJS::JSValue::getUInt32): Ditto.
        (KJS::JSValue::toInt32): Ditto.
        (KJS::JSValue::toUInt32): Ditto.

2007-10-22  Darin Adler  <darin@apple.com>

        Reviewed by Brady.

        - fix crash seen when running JavaScriptCore tests

        * kjs/array_instance.cpp: (KJS::ArrayInstance::mark):
        Copy and paste error: I accidentally had code here that was
        making a copy of the HashMap -- that's illegal inside a mark
        function and was unnecessary. The other callsite was modifying
        the map as it iterated it, but this function is not.

2007-10-22  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Oliver.
        
        - Avoid moving floats into integer registers in jsNumber() for 3% speedup on SunSpider
        http://bugs.webkit.org/show_bug.cgi?id=15627

        * kjs/JSImmediate.h:
        (KJS::JSImmediate::fromDouble): Avoid moving floats to integer
        registers since this is very slow.

2007-10-22  Darin Adler  <darin@apple.com>

        Reviewed by Eric Seidel.

        - http://bugs.webkit.org/show_bug.cgi?id=15617
          improve speed of integer conversions

        Makes SunSpider 6% faster.

        * kjs/JSImmediate.h: Added toInt32 and toUInt32, with separate versions for
        32-bit and 64-bit.
        * kjs/value.h:
        (KJS::JSValue::getUInt32): Call JSImmediate::toUInt32.

        * kjs/internal.h: Added getInt32.
        * kjs/internal.cpp:
        (KJS::NumberImp::getInt32): Added.
        (KJS::NumberImp::getUInt32): Replaced with more-optimal implementation
        stolen from JSValue.

        * kjs/value.h:
        (KJS::jsNumber): Marked ALWAYS_INLINE, because this wasn't getting
        inlined.
        (KJS::JSValue::getInt32): Added.
        (KJS::JSValue::getUInt32): Changed to call the new JSImmediate::toUInt32
        to avoid converting from float to double.
        (KJS::JSValue::toInt32): Made inline, separated out the slow case.
        (KJS::JSValue::toUInt32): Ditto.
        * kjs/value.cpp:
        (KJS::JSCell::getInt32): Added.
        (KJS::JSValue::toInt32SlowCase): Renamed from toInt32. Changed to use the
        new getInt32. Added a faster case for in-range numbers.
        (KJS::JSValue::toUInt32SlowCase): Ditto.
        (KJS::JSValue::toUInt16): Added a faster case for in-range numbers.

        * JavaScriptCore.exp: Updated for changes.

2007-10-22  Adam Roben  <aroben@apple.com>

        Windows build fix

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Turn off
        warning about implicit conversion to bool.

2007-10-22  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.

        * kjs/array_instance.cpp:

2007-10-22  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - http://bugs.webkit.org/show_bug.cgi?id=15606
          make cut-off for sparse vs. dense arrays smarter for speed with large arrays

        Makes the morph test in SunSpider 26% faster, and the overall
        benchmark 3% faster.

        This also fixes some small problems we had with the distinction
        between nonexistent and undefined values in arrays.

        * kjs/array_instance.h: Tweaked formatting and naming.
        * kjs/array_instance.cpp: Copied from kjs/array_object.cpp.
        (KJS::storageSize): Added. Computes the size of the storage given a vector length.
        (KJS::increasedVectorLength): Added. Implements the rule for resizing the vector.
        (KJS::isDenseEnoughForVector): Added.
        (KJS::ArrayInstance::ArrayInstance): Initialize the new fields.
        (KJS::ArrayInstance::~ArrayInstance): Since m_storage is now never 0, delete it.
        (KJS::ArrayInstance::getItem): Updated for name changes.
        (KJS::ArrayInstance::lengthGetter): Ditto.
        (KJS::ArrayInstance::inlineGetOwnPropertySlot): Added. Allows both versions of
        getOwnPropertySlot to share more code.
        (KJS::ArrayInstance::getOwnPropertySlot): Just refactored, no code change.
        (KJS::ArrayInstance::put): Added logic for extending the vector as long as the
        array is dense enough. Also keep m_numValuesInVector up to date.
        (KJS::ArrayInstance::deleteProperty): Added code to keep m_numValuesInVector
        up to date.
        (KJS::ArrayInstance::getPropertyNames): Fixed bug where this would omit names
        for array indices with undefined values.
        (KJS::ArrayInstance::increaseVectorLength): Renamed from resizeStorage. Also
        simplified to only handle getting larger.
        (KJS::ArrayInstance::setLength): Added code to update m_numValuesInVector, to
        zero out the unused part of the vector and to delete the map if it's no longer
        needed.
        (KJS::ArrayInstance::mark): Tweaked formatting.
        (KJS::compareByStringForQSort): Ditto.
        (KJS::ArrayInstance::sort): Ditto.
        (KJS::CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
        Ditto.
        (KJS::compareWithCompareFunctionForQSort): Ditto.
        (KJS::ArrayInstance::compactForSorting): Fixed bug where this would turn
        undefined values into nonexistent values in some cases.

        * kjs/array_object.h: Removed MAX_ARRAY_INDEX.
        * kjs/array_object.cpp: Removed ArrayInstance. Moved to a separate file.

        * JavaScriptCore.pri: Added array_instance.cpp.
        * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
        * kjs/AllInOneFile.cpp: Ditto.

2007-10-22  Andrew Wellington  <proton@wiretapped.net>

        Reviewed by Mark Rowe.
        
        Fix for local database support after r26879
        Ensure that ENABLE_DATABASE and ENABLE_ICONDATABASE are correctly set

        * Configurations/JavaScriptCore.xcconfig:

2007-10-22  Simon Hausmann  <hausmann@kde.org>

        Reviewed by Alp.

        Build fix for the non-qmake builds.

        * wtf/Platform.h: Default to enabling the database features unless
        otherwise specified. (similar to ENABLE_ICONDATABASE)

2007-10-22  Holger Freyther  <zecke@selfish.org>

        Reviewed by Simon Hausmann <hausmann@kde.org>.

        * Do not build testkjs as an application bundle. This is
        needed for run-javascriptcore-tests on OSX.
        * Also, based on r26633, allow to test the WebKit/Qt port on OSX.
        * Set DYLD_LIBRARY_PATH if it was set in the environment. It must be set
        as we do not have -rpath on OSX.

        * kjs/testkjs.pro:

2007-10-21  Mark Rowe  <mrowe@apple.com>

        Reviewed by Alp.

        http://bugs.webkit.org/show_bug.cgi?id=15575
        Bug 15575: [GTK] Implement threading using GThread

        * wtf/Platform.h: Do not enable pthreads for Gtk.

2007-10-21  Mark Rowe  <mrowe@apple.com>

        Reviewed by Mitz.

        Fix http://bugs.webkit.org/show_bug.cgi?id=15603
        Bug 15603: Regression(r26847): Crash when sorting an empty array from JavaScript

        * kjs/array_object.cpp:
        (KJS::freeStorage): Reinstate null-check that was removed in r26847.

2007-10-21  Darin Adler  <darin@apple.com>

        - fix Windows build

        * kjs/array_instance.h: Removed unused ExecState parameter.
        * kjs/array_object.cpp:
        (KJS::ArrayInstance::put): Ditto.
        (KJS::ArrayInstance::setLength): Ditto.

2007-10-21  Darin Adler  <darin@apple.com>

        * kjs/array_object.cpp: (KJS::ArrayInstance::put):
        Add missing assignment that was causing regression test crash.

2007-10-21  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - http://bugs.webkit.org/show_bug.cgi?id=15585
          speed up sparse arrays by using a custom map
    
        Speeds up SunSpider by 10%.

        * kjs/array_object.cpp:
        (allocateStorage): Leave room for an additional pointer.
        (reallocateStorage): Ditto.
        (freeStorage): Ditto.
        (ArrayInstance::~ArrayInstance): Delete the overflow map if present.
        (ArrayInstance::getItem): Read values from the overflow map if present.
        Removed the check of length, since it slows down the common case.
        (ArrayInstance::getOwnPropertySlot): Ditto. Also removed the fallback
        to the property map.
        (ArrayInstance::put): Write values into the overflow map as needed.
        Also create overflow map when needed.
        (ArrayInstance::deleteProperty): Remove values from the overflow map
        as appropriate.
        (ArrayInstance::getPropertyNames): Add a name for each identifier in
        the property map. This is extremely inefficient.
        (ArrayInstance::setLength): Remove any values in the overflow map
        that are past the new length, as we formerly did with the property map.
        (ArrayInstance::mark): Mark any values in the overflow map.
        (compareByStringForQSort): Removed unneeded undefined case, since
        compactForSorting guarantees we will have no undefined values.
        (compareWithCompareFunctionForQSort): Ditto.
        (ArrayInstance::compactForSorting): Copy all the values out of the
        overflow map and destroy it.

        * kjs/property_map.h: Removed now-unused getSparseArrayPropertyNames.
        * kjs/property_map.cpp: Ditto.

2007-10-20  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - http://bugs.webkit.org/show_bug.cgi?id=15579
          stop churning identifier reference counts copying Completion objects

        * kjs/completion.h: Replace the Identifier with an Identifier*.
        * kjs/nodes.cpp:
        (ForInNode::execute): Update for change to Completion constructor.
        (ContinueNode::execute): Ditto.
        (BreakNode::execute): Ditto.

2007-10-20  Mark Rowe  <mrowe@apple.com>

        Reviewed by Alp.

        Gtk changes needed to enable HTML 5 client-side database storage.

        * wtf/Platform.h: Have Gtk use pthreads for now.

2007-10-20  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Maciej Stachowiak.

        Fixed http://bugs.webkit.org/show_bug.cgi?id=15570
        Store gathered declaration nodes in the function body node.
        
        This means that you only have to gather the declaration nodes the first 
        time the function executes. Performance gain of 2.10% on SunSpider, 
        0.90% on command-line JS iBench.

        * kjs/nodes.cpp: Split declaration stack initialization code off into 
        initializeDeclarationStacks().
        (FunctionBodyNode::FunctionBodyNode):
        (FunctionBodyNode::initializeDeclarationStacks):
        (FunctionBodyNode::processDeclarations):

        * kjs/nodes.h: Changed DeclarationStacks structure to hold references, 
        since the actual Vectors are now stored either on the stack or in the 
        function body node.

2007-10-19  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Darin Adler.
        
        http://bugs.webkit.org/show_bug.cgi?id=15559
        Moved processDeclarations call into FunctionBodyNode::execute

        To improve encapsulation, moved processDeclarations call into
        FunctionBodyNode::execute. Also marked processDeclarations 
        ALWAYS_INLINE, since it has only 1 caller now. This is a .71% speedup 
        on command-line JS iBench.

        * kjs/function.cpp:
        (KJS::FunctionImp::callAsFunction):
        (KJS::GlobalFuncImp::callAsFunction):
        * kjs/function.h:
        * kjs/interpreter.cpp:
        (KJS::Interpreter::evaluate):
        * kjs/nodes.cpp:
        (FunctionBodyNode::execute):
        * kjs/nodes.h:

2007-10-19  Brady Eidson  <beidson@apple.com>

        Reviewed by Sam

        Queue -> Deque! and small style tweaks

        * JavaScriptCore.vcproj/WTF/WTF.vcproj:
        * JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
        * wtf/Deque.h: Added.
        (WTF::DequeNode::DequeNode):
        (WTF::Deque::Deque):
        (WTF::Deque::~Deque):
        (WTF::Deque::size):
        (WTF::Deque::isEmpty):
        (WTF::Deque::append):
        (WTF::Deque::prepend):
        (WTF::Deque::first):
        (WTF::Deque::last):
        (WTF::Deque::removeFirst):
        (WTF::Deque::clear):
        * wtf/Queue.h: Removed.


2007-10-19  Brady Eidson <beidson@apple.com>

        Reviewed by Oliver

        Added a simple LinkedList based Queue to wtf
        We can make a better, more sophisticated an efficient one later, but have
        needed one for some time, now!

        * JavaScriptCore.xcodeproj/project.pbxproj:
        * wtf/Queue.h: Added.
        (WTF::QueueNode::QueueNode):
        (WTF::Queue::Queue):
        (WTF::Queue::~Queue):
        (WTF::Queue::size):
        (WTF::Queue::isEmpty):
        (WTF::Queue::append):
        (WTF::Queue::prepend):
        (WTF::Queue::first):
        (WTF::Queue::last):
        (WTF::Queue::removeFirst):
        (WTF::Queue::clear):

2007-10-19  Nikolas Zimmermann  <zimmermann@kde.org>

        Reviewed by Anders.

        Try to fix Qt/Win build slave, by including windows.h also on Qt/Win.

        * kjs/testkjs.cpp: Change PLATFORM(WIN) to PLATFORM(WIN_OS)

2007-10-19  Simon Hausmann  <hausmann@kde.org>

        Reviewed by Lars.

        Fix compilation on Windows when wchar_t is a typedef instead of a native type (triggered by -Zc:wchar_t-).
        Don't provide the wchar_t overloads then as they conflict with the unsigned short ones.

        * wtf/ASCIICType.h:
        (WTF::isASCIIAlpha):
        (WTF::isASCIIAlphanumeric):
        (WTF::isASCIIDigit):
        (WTF::isASCIIHexDigit):
        (WTF::isASCIILower):
        (WTF::isASCIISpace):
        (WTF::toASCIILower):
        (WTF::toASCIIUpper):

2007-10-19  Simon Hausmann  <hausmann@kde.org>

        Reviewed by Lars.

        Another build fix for the windows/qt build: Apply the same fix as in revision 26686 also to kjs/config.h to disable the disallowctype feature.

        * kjs/config.h:

2007-10-18  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Adam.
        
        - use __declspec(thread) for fast thread-local storage on Windows
        
        - 2.2% speedup on sunspider (on Windows)
        - 7% speedup on the string section
        - 6% speedup on JS iBench
        
        - fixed <rdar://problem/5473084> PLT on Windows got 2.5% slower between r25406 and r25422
        - fixed at least some of <rdar://5527965? i-Bench JS was 14% slower in 310A11 than 310A10
        
        
        * wtf/FastMalloc.cpp:
        (WTF::getThreadHeap):
        (WTF::setThreadHeap):
        (WTF::TCMalloc_ThreadCache::GetCache):
        (WTF::TCMalloc_ThreadCache::GetCacheIfPresent):
        (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):

2007-10-17  Darin Adler  <darin@apple.com>

        Reviewed by Mark Rowe.

        - fix http://bugs.webkit.org/show_bug.cgi?id=15543
          <rdar://problem/5545639> REGRESSION (r26697):
          GoogleDocs: Can't create new documents or open existing ones

        Test: fast/js/regexp-non-character.html

        * pcre/pcre_compile.c: (check_escape): Take out the checks for valid characters
        in the \u sequences -- not needed and actively harmful.

2007-10-17  Anders Carlsson  <andersca@apple.com>

        Reviewed by Oliver.

        * wtf/Platform.h:
        #define USE_PTHREADS on Mac.

2007-10-17  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Darin Adler.
        
        Merged DeclaredFunctionImp into FunctionImp (the base class) because 
        the distinction between the two was unused.
        
        Removed codeType() from FunctionImp because FunctionImp and its 
        subclasses all returned FunctionCode, so it was unused, practically 
        speaking.
        
        Removed a different codeType() from GlobalFuncImp because it was unused.
        (Perhaps it was vestigial from a time when GlobalFuncImp used to 
        inherit from FunctionImp.)

        * bindings/runtime_method.cpp:
        * bindings/runtime_method.h:
        * kjs/function.cpp:
        (KJS::):
        (KJS::FunctionImp::FunctionImp):
        (KJS::FunctionImp::callAsFunction):
        (KJS::FunctionImp::construct):
        (KJS::FunctionImp::execute):
        (KJS::FunctionImp::processVarDecls):
        * kjs/function.h:
        (KJS::FunctionImp::implementsConstruct):
        (KJS::FunctionImp::scope):
        * kjs/function_object.cpp:
        (FunctionProtoFunc::callAsFunction):
        (FunctionObjectImp::construct):
        * kjs/nodes.cpp:
        (FuncDeclNode::processFuncDecl):
        (FuncExprNode::evaluate):

2007-10-17  Adam Roben  <aroben@apple.com>

        Windows build fix part 2.

        Fix was by Darin, reviewed by Anders and Adam.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add
        FastMallocPCRE.cpp to the project, and let Visual Studio have its way
        with the post-build step.
        * pcre/pcre.h: Don't DLL export the entry points just because this
        is Win32 -- this is an internal copy of PCRE and should be private.
        * pcre/pcre_compile.c: Fix an uninitialized variable warning --
        there's no real problem but it's better to quiet the compiler by
        tweaking the code slightly than turn off the warning entirely.

2007-10-17  Adam Roben  <aroben@apple.com>

        Windows build fix.

        Reviewed by Anders.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable
        some mismatched signed/unsigned comparison warnings.
        * pcre/pcre_exec.c:
        (match): #if-out some labels that don't seem to exist.

2007-10-17  Mark Rowe  <mrowe@apple.com>

        Gtk build fix.

        * JavaScriptCore.pri: Add FastMallocPCRE.cpp.
        * pcre/pcre_get. #if out two functions that depend on pcre_get_stringnumber, which
        is currently unavailable for UTF-16.

2007-10-16  Darin Adler  <darin@apple.com>

        Reviewed by Geoff.

        - merged PCRE changes between 6.4 and 6.5

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        Removed pcre_config.c, pcre_globals.c, pcre_info.c, pcre_maketables.c,
        pcre_printint.src, pcre_refcount.c, pcre_study.c, pcre_try_flipped.c,
        pcre_ucp_findchar.c, pcre_version.c, and ucptable.c. Added pcre_ucp_searchfuncs.c.

        * pcre/AUTHORS:
        * pcre/LICENCE:
        * pcre/MERGING:
        * pcre/dftables.c:
        * pcre/pcre-config.h:
        * pcre/pcre.h:
        * pcre/pcre.pri:
        * pcre/pcre_compile.c:
        * pcre/pcre_exec.c:
        * pcre/pcre_fullinfo.c:
        * pcre/pcre_get.c:
        * pcre/pcre_internal.h:
        * pcre/pcre_maketables.c:
        * pcre/pcre_ord2utf8.c:
        * pcre/pcre_tables.c:
        * pcre/pcre_ucp_searchfuncs.c: Copied from pcre/pcre_ucp_findchar.c.
        * pcre/pcre_xclass.c:
        * pcre/ucp.h:
        * pcre/ucpinternal.h:
        * pcre/ucptable.c:
        Updated with new versions from the PCRE 6.5 release, merged with changes.

        * pcre/pcre_config.c: Removed.
        * pcre/pcre_globals.c: Removed.
        * pcre/pcre_info.c: Removed.
        * pcre/pcre_printint.src: Removed.
        * pcre/pcre_refcount.c: Removed.
        * pcre/pcre_study.c: Removed.
        * pcre/pcre_try_flipped.c: Removed.
        * pcre/pcre_ucp_findchar.c: Removed.
        * pcre/pcre_version.c: Removed.

2007-10-16  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Darin Adler.

        Removed KJS_VERBOSE because it was getting in the way of readability, 
        and the messages didn't seem very helpful.

        * kjs/function.cpp:
        (KJS::FunctionImp::callAsFunction):
        (KJS::FunctionImp::passInParameters):
        * kjs/lookup.h:
        (KJS::lookupPut):
        * kjs/object.cpp:
        (KJS::JSObject::put):
        * kjs/value.h:

2007-10-16  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Darin Adler.
        
        Removed the Parameter class because it was a redundant wrapper around 
        Identifier.

        * kjs/function.cpp:
        (KJS::FunctionImp::passInParameters):
        (KJS::FunctionImp::getParameterName):
        * kjs/nodes.cpp:
        (FunctionBodyNode::addParam):
        * kjs/nodes.h:
        (KJS::FunctionBodyNode::):

2007-10-16  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Darin Adler.
        
        Global replace of assert with ASSERT.

2007-10-16  Adam Roben  <aroben@apple.com>

        Make testkjs not delay-load WebKit

        Soon, delay-loading WebKit will be impossible (because we will be
        using __declspec(thread) for thread-local storage). This change
        prepares testkjs for the future.

        Reviewed by Sam.

        * JavaScriptCore.vcproj/JavaScriptCore.sln: Removed WebKitInitializer,
        added FindSafari.
        * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Don't link against
        WebKitInitializer, don't delay-load WebKit.
        * kjs/testkjs.cpp: Don't use WebKitInitializer.

2007-10-16  Adam Roben  <aroben@apple.com>

        Updated testkjs for the rename of WebKit_debug.dll to WebKit.dll for the Debug configuration

        Reviewed by Kevin McCullough.

        * JavaScriptCore.vcproj/debug.vsprops: Added WebKitDLLConfigSuffix.
        * JavaScriptCore.vcproj/debug_internal.vsprops: Ditto.
        * JavaScriptCore.vcproj/release.vsprops: Ditto.
        * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Use
        WebKitDLLConfigSuffix when referring to WebKit.dll, and fixed a typo
        in the name of icuuc36[_debug].dll.

2007-10-16  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Maciej Stachowiak.
        
        Re-structured variable and function declaration code.
        
        Command-line JS iBench shows no regression.
        
        Here are the changes:

        1. Function declarations are now processed at the same time as var 
        declarations -- namely, immediately upon entry to an execution context. 
        This does not match Firefox, which waits to process a function
        declaration until the declaration's containing block executes, but it 
        does match IE and the ECMA spec. (10.1.3 states that var and function 
        declarations should be processed at the same time -- namely, "On 
        entering an execution context." 12.2 states that "A Block does not 
        define a new execution scope.")

        2. Declaration processing proceeds iteratively now, rather than 
        recursively, storing the nodes is finds in stacks. This will later 
        facilitate an optimization to hold on to the gathered declaration nodes, 
        rather than re-fetching them in every function call. 
        [ http://bugs.webkit.org/show_bug.cgi?id=14868 ]

        Modified these tests because they expected the incorrect Mozilla 
        behavior described above:

        * tests/mozilla/ecma_3/Function/scope-001.js:
        * tests/mozilla/js1_5/Scope/regress-184107.js:

2007-10-16  Darin Adler  <darin@apple.com>

        - try to fix the GTK build

        * kjs/ustring.cpp: Include ASCIICType.h, not ASCIICtype.h.

2007-10-16  Darin Adler  <darin@apple.com>

        - try to fix the Windows build

        * kjs/date_object.cpp: (KJS::parseDate): A couple instances of isspace were
        in here. Not sure why it wasn't failing elsewhere. Changed to isASCIISpace.

2007-10-16  Darin Adler  <darin@apple.com>

        - try to fix the GTK build

        * kjs/ustring.cpp: Include ASCIICType.h.

2007-10-16  Darin Adler  <darin@apple.com>

        Reviewed by Maciej and Geoff (and looked over by Eric).

        - http://bugs.webkit.org/show_bug.cgi?id=15519
          eliminate use of <ctype.h> for processing ASCII

        * wtf/ASCIICType.h: Added.
        * wtf/DisallowCType.h: Added.

        * kjs/config.h: Include DisallowCType.h.

        * kjs/date_object.cpp:
        (KJS::skipSpacesAndComments):
        (KJS::findMonth):
        (KJS::parseDate):
        * kjs/function.cpp:
        (KJS::decode):
        * kjs/ustring.cpp:
        (KJS::UString::toDouble):
        Use ASCIICType.h functions instead of ctype.h ones.

2007-10-14  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

        - fixes for "New JavaScript benchmark"
        http://bugs.webkit.org/show_bug.cgi?id=15515
        
        * kjs/testkjs.cpp:
        (TestFunctionImp::callAsFunction): Implement "load" for compatibility
        with SpiderMonkey.
        (TestFunctionImp::): ditto
        (doIt): ditto
        (kjsmain): Drop useless --> from output.

2007-10-15  Geoffrey Garen  <ggaren@apple.com>

        Removed unnecessary #include.

        * API/JSObjectRef.cpp:

2007-10-15  Geoffrey Garen  <ggaren@apple.com>

        Double-reverse build fix. My tree was out of date.

        * kjs/nodes.cpp:
        (NumberNode::evaluate):

2007-10-15  Geoffrey Garen  <ggaren@apple.com>

        Build fix.

        * kjs/nodes.cpp:
        (NumberNode::evaluate):

2007-10-15  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Darin Adler.
        
        Removed surprising self-named "hack" that made nested functions 
        available as named properties of their containing functions, and placed
        containing function objects in the scope chains of nested functions.
        
        There were a few reasons to remove this "hack:"

        1. It contradicted FF, IE, and the ECMA spec.

        2. It incurred a performance penalty, since merely parsing a function 
        required parsing its body for nested functions (and so on).

        3. SVN history contains no explanation for why it was added. It was just
        legacy code in a large merge a long, long time ago.

        [ Patch broken off from http://bugs.webkit.org/show_bug.cgi?id=14868 ]

        * kjs/nodes.cpp:
        (FuncDeclNode::processFuncDecl):

2007-10-15  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Darin Adler.
        
        Removed the concept of AnonymousCode. It was unused, and it doesn't
        exist in the ECMA spec.
        
        [ Patch broken off from http://bugs.webkit.org/show_bug.cgi?id=14868 ]

        * kjs/Context.cpp:
        (KJS::Context::Context):
        * kjs/function.h:
        (KJS::):
        * kjs/nodes.cpp:
        (ReturnNode::execute):

2007-10-15  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Darin Adler.
        
        Made function parameters DontDelete. This matches FF and the vague
        description in ECMA 10.1.3. It's also required in order to make
        symbol table based lookup of function parameters valid. (If the 
        parameters aren't DontDelete, you can't guarantee that you'll find
        them later in the symbol table.)

        [ Patch broken off from http://bugs.webkit.org/show_bug.cgi?id=14868 ]

        * kjs/function.cpp:
        (KJS::FunctionImp::passInParameters):

2007-10-15  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Maciej Stachowiak.
        
        Some Vector optimizations. These are especially important when using
        Vector as a stack for implementing recursive algorithms iteratively.
        
        [ Broken off from http://bugs.webkit.org/show_bug.cgi?id=14868 ]

        1. Added shrink(), which is a version of resize() that you can call
        to save a branch / improve code generation and inlining when you know 
        that the vector is not getting bigger.
        
        2. Changed subclassing relationship in VectorBuffer to remove a call to
        fastFree() in the destructor for the inlineCapacity != 0 template
        specialization. This brings inline Vectors one step closer to true
        stack-allocated arrays.
        
        Also changed abort() to CRASH(), since the latter works better.

        * wtf/Vector.h:
        (WTF::VectorBufferBase::allocateBuffer):
        (WTF::VectorBufferBase::deallocateBuffer):
        (WTF::VectorBufferBase::VectorBufferBase):
        (WTF::VectorBufferBase::~VectorBufferBase):
        (WTF::):
        (WTF::VectorBuffer::VectorBuffer):
        (WTF::VectorBuffer::~VectorBuffer):
        (WTF::VectorBuffer::deallocateBuffer):
        (WTF::VectorBuffer::releaseBuffer):
        (WTF::Vector::clear):
        (WTF::Vector::removeLast):
        (WTF::::operator):
        (WTF::::fill):
        (WTF::::shrink):

2007-10-12  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Maciej Stachowiak.
        
        Fixed http://bugs.webkit.org/show_bug.cgi?id=15490
        Iteration statements sometimes incorrectly evaluate to the empty value 
        (KDE r670547). 
        
        [ Broken off from http://bugs.webkit.org/show_bug.cgi?id=14868 ]
        
        This patch is a merge of KDE r670547, with substantial modification 
        for performance.
        
        It fixes do-while statements to evaluate to a value. (They used
        to evaluate to the empty value in all cases.) 

        It also fixes SourceElementsNode to maintain the value of abnormal 
        completions like "break" and "continue."
        
        It also re-works the main execution loop in SourceElementsNode so that
        it (1) makes a little more sense and (2) avoids unnecessary work. This 
        is a .28% speedup on command-line JS iBench.

        * kjs/nodes.cpp:
        (DoWhileNode::execute):
        (SourceElementsNode::execute):

2007-10-15  Simon Hausmann  <hausmann@kde.org>

        Reviewed by Lars.

        Fix compilation with gcc 4.3 by including 'limits' due to the use of std::numeric_limits.

        * wtf/HashTraits.h:

2007-10-5  Kevin Ollivier  <kevino@theolliviers.com>
 
        Reviewed by Adam.
        
        Add support for MSVC7, and fix cases where PLATFORM(WIN) should
        be PLATFORM(WIN_OS) for other ports building on Windows.
 
        * kjs/DateMath.cpp:
        (KJS::getDSTOffsetSimple):
        * kjs/JSImmediate.h:
        * wtf/Assertions.cpp:
        * wtf/Assertions.h:
        * wtf/Platform.h:
        * wtf/StringExtras.h:
        (snprintf):
        (vsnprintf):

2007-10-14  Cameron Zwarich  <cwzwarich@uwaterloo.ca>

        Reviewed by Darin.

        Adds NegateNode optimization from KJS. The relevant revision in KDE
        is 666736.

        * kjs/grammar.y:
        * kjs/nodes.cpp:
        (NumberNode::evaluate):
        * kjs/nodes.h:
        (KJS::Node::):
        (KJS::NumberNode::):
        * kjs/nodes2string.cpp:
        (NumberNode::streamTo):

2007-10-14  Jason Foreman  <jason@threeve.org>

        Reviewed by Maciej.

        Fix http://bugs.webkit.org/show_bug.cgi?id=15145
        
        Ensure that if adjusting n to minimize the difference of n*intPow10(e-p+1) to x,
        that the property n < intPow10(p) is maintained.

        * kjs/number_object.cpp:
        (NumberProtoFunc::callAsFunction):

== Rolled over to ChangeLog-2007-10-14 ==
