2008-09-20  Darin Adler  <darin@apple.com>

        Reviewed by Mark Rowe.

        - fix crash seen on buildbot

        * kjs/JSGlobalObject.cpp:
        (JSC::JSGlobalObject::mark): Add back mark of arrayPrototype,
        deleted by accident in my recent check-in.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36729 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-09-20  Collin Jackson  <collinj@webkit.org>

        Prefetch DNS for hyperlinks that the user mouses over.

        https://bugs.webkit.org/show_bug.cgi?id=20931

        Reviewed by Sam Weinig.

        * page/Chrome.cpp:
        (WebCore::Chrome::mouseDidMoveOverElement):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36730 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-09-20  Darin Adler  <darin@apple.com>

        - blind attempt to fix Qt build

        * bridge/qt/qt_runtime.cpp:
        (JSC::Bindings::convertQVariantToValue): Use regExpStructure instead
        of regExpPrototype to make a RegExpObject. There should really be
        some sort of public helper function for this. Same thing for
        DateInstance and dateStructure. For JSObject, use constructEmptyObject.
        (JSC::Bindings::):
        (JSC::Bindings::QtRuntimeMethod::QtRuntimeMethod): Use getDOMStructure.
        It is not correct to do this inside the constructor because it could
        cause a garbage collect while the QtRuntimeMethod object is half-
        allocated, which could lead to a crash; note that RuntimeMethod,
        QtRuntimeObjectImp, and RuntimeObjectImp have the same bug.
        * bridge/qt/qt_runtime.h: Add s_info and createPrototype.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36731 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-09-20  Darin Adler  <darin@apple.com>

        - another try at fixing Qt

        * bridge/qt/qt_runtime.cpp: "using namespce WebCore"



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36732 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Reviewed by Mark Rowe.

        - fix linker warnings

        * WebCore.base.exp:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36733 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-09-21  Dirk Schulze  <vbs85@gmx.de>

        Reviewed by eseidel.  Landed by eseidel.

        Moved DashArray to GraphicsContext.

        * GNUmakefile.am:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/graphics/DashArray.h: Added.
        * platform/graphics/GraphicsContext.h:
        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::setLineDash):
        * platform/graphics/cg/GraphicsContextCG.cpp:
        (WebCore::GraphicsContext::setLineDash):
        * platform/graphics/qt/GraphicsContextQt.cpp:
        (WebCore::GraphicsContext::setLineDash):
        * svg/graphics/SVGPaintServer.cpp:
        (WebCore::applyStrokeStyleToContext):
        * svg/graphics/SVGPaintServer.h:
        * svg/graphics/cg/CgSupport.cpp:
        * svg/graphics/cg/CgSupport.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36734 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-09-21  Cameron Zwarich  <cwzwarich@uwaterloo.ca>

        Reviewed by Maciej Stachowiak.

        Bug 20815: 'arguments' object creation is non-optimal
        <https://bugs.webkit.org/show_bug.cgi?id=20815>

        Fix our inefficient way of creating the arguments object by only
        creating named properties for each of the arguments after a use of the
        'delete' statement. This patch also speeds up access to the 'arguments'
        object slightly, but it still does not use the array fast path for
        indexed access that exists for many opcodes.

        This is about a 20% improvement on the V8 Raytrace benchmark, and a 1.5%
        improvement on the Earley-Boyer benchmark, which gives a 4% improvement
        overall.

        JavaScriptCore:

        * kjs/Arguments.cpp:
        (JSC::Arguments::Arguments):
        (JSC::Arguments::mark):
        (JSC::Arguments::getOwnPropertySlot):
        (JSC::Arguments::put):
        (JSC::Arguments::deleteProperty):
        * kjs/Arguments.h:
        (JSC::Arguments::ArgumentsData::ArgumentsData):
        * kjs/IndexToNameMap.h:
        (JSC::IndexToNameMap::size):
        * kjs/JSActivation.cpp:
        (JSC::JSActivation::createArgumentsObject):
        * kjs/JSActivation.h:
        (JSC::JSActivation::uncheckedSymbolTableGet):
        (JSC::JSActivation::uncheckedSymbolTableGetValue):
        (JSC::JSActivation::uncheckedSymbolTablePut):
        * kjs/JSFunction.h:
        (JSC::JSFunction::numParameters):

        LayoutTests:

        * fast/js/arguments-expected.txt: Added.
        * fast/js/arguments.html: Added.
        * fast/js/resources/arguments.js: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36735 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-09-21  Cameron Zwarich  <cwzwarich@uwaterloo.ca>

        Reviewed by Maciej Stachowiak.

        Free memory allocated for extra arguments in the destructor of the
        Arguments object.

        * kjs/Arguments.cpp:
        (JSC::Arguments::~Arguments):
        * kjs/Arguments.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36736 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-09-21  Dirk Schulze  <vbs85@gmx.de>

        Reviewed by eseidel.  Landed by eseidel.

        All platforms use the DashArray in the GraphicsContext.

        * svg/graphics/SVGPaintServer.h:
        * svg/graphics/cairo/SVGPaintServerGradientCairo.cpp:
        (WebCore::SVGPaintServerGradient::setup):
        * svg/graphics/cairo/SVGPaintServerPatternCairo.cpp:
        (WebCore::SVGPaintServerPattern::setup):
        * svg/graphics/cairo/SVGPaintServerSolidCairo.cpp:
        (WebCore::SVGPaintServerSolid::setup):
        * svg/graphics/qt/SVGPaintServerGradientQt.cpp:
        (WebCore::SVGPaintServerGradient::setup):
        * svg/graphics/qt/SVGPaintServerQt.cpp:
        * svg/graphics/qt/SVGPaintServerSolidQt.cpp:
        (WebCore::SVGPaintServerSolid::setup):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36737 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-09-21  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Oliver.
        
        - speed up === operator by generating inline machine code for the fast paths
        https://bugs.webkit.org/show_bug.cgi?id=20820

        * VM/CTI.cpp:
        (JSC::CTI::emitJumpSlowCaseIfNotImmediateNumber):
        (JSC::CTI::emitJumpSlowCaseIfNotImmediateNumbers):
        (JSC::CTI::emitJumpSlowCaseIfNotImmediates):
        (JSC::CTI::emitTagAsBoolImmediate):
        (JSC::CTI::privateCompileMainPass):
        (JSC::CTI::privateCompileSlowCases):
        * VM/CTI.h:
        * VM/Machine.cpp:
        (JSC::Machine::cti_op_stricteq):
        * masm/X86Assembler.h:
        (JSC::X86Assembler::):
        (JSC::X86Assembler::sete_r):
        (JSC::X86Assembler::setz_r):
        (JSC::X86Assembler::movzbl_rr):
        (JSC::X86Assembler::emitUnlinkedJnz):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36738 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JavaScriptCore:

2008-09-21  Gabor Loki  <loki@inf.u-szeged.hu>

        Reviewed by Darin Adler.

        - https://bugs.webkit.org/show_bug.cgi?id=19408
          Add lightweight constant folding to the parser for *, /, + (only for numbers), <<, >>, ~ operators.

        1.008x as fast on SunSpider.

        * kjs/grammar.y:
        (makeNegateNode): Fold if expression is a number > 0.
        (makeBitwiseNotNode): Fold if expression is a number.
        (makeMultNode): Fold if expressions are both numbers.
        (makeDivNode): Fold if expressions are both numbers.
        (makeAddNode): Fold if expressions are both numbers.
        (makeLeftShiftNode): Fold if expressions are both numbers.
        (makeRightShiftNode): Fold if expressions are both numbers.

LayoutTests:

2008-09-21  Gabor Loki  <loki@inf.u-szeged.hu>

        Reviewed and tweaked by Darin Adler.

        - https://bugs.webkit.org/show_bug.cgi?id=19408
          Add test case for constant folding.

        * fast/js/constant-folding-expected.txt: Added.
        * fast/js/constant-folding.html: Added.
        * fast/js/resources/constant-folding.js: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36739 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-09-21  Paul Pedriana  <webkit@pedriana.com>

        Reviewed and tweaked by Darin Adler.

        - https://bugs.webkit.org/show_bug.cgi?id=16925
          Fixed lack of Vector buffer alignment for both GCC and MSVC.
          Since there's no portable way to do this, for now we don't support
          other compilers.

        * wtf/Vector.h: Added WTF_ALIGH_ON, WTF_ALIGNED, AlignedBufferChar, and AlignedBuffer.
        Use AlignedBuffer insteadof an array of char in VectorBuffer.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36740 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-09-21  Judit Jasz  <jasy@inf.u-szeged.hu>

        Reviewed and tweaked by Darin Adler.

        - https://bugs.webkit.org/show_bug.cgi?id=20645
          Elminate duplicate constant values in CodeBlocks.

        Seems to be a wash on SunSpider.

        * VM/CodeGenerator.cpp:
        (JSC::CodeGenerator::emitLoad): Use m_numberMap and m_stringMap to guarantee
        we emit the same JSValue* for identical numbers and strings.
        * VM/CodeGenerator.h: Added overload of emitLoad for const Identifier&.
        Add NumberMap and IdentifierStringMap types and m_numberMap and m_stringMap.
        * kjs/nodes.cpp:
        (JSC::StringNode::emitCode): Call the new emitLoad and let it do the
        JSString creation.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36741 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-09-21  Darin Adler  <darin@apple.com>

        * VM/CodeGenerator.cpp:
        (JSC::CodeGenerator::emitLoad): One more tweak: Wrote this in a slightly
        clearer style.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36742 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-09-21  Darin Adler  <darin@apple.com>

        Reviewed by Sam Weinig.

        - https://bugs.webkit.org/show_bug.cgi?id=20972
          speed up Arguments further by eliminating the IndexToNameMap

        No change on SunSpider. 1.29x as fast on V8 Raytrace.

        * kjs/Arguments.cpp: Moved ArgumentsData in here. Eliminated the
        indexToNameMap and hadDeletes data members. Changed extraArguments into
        an OwnArrayPtr and added deletedArguments, another OwnArrayPtr.
        Replaced numExtraArguments with numParameters, since that's what's
        used more directly in hot code paths.
        (JSC::Arguments::Arguments): Pass in argument count instead of ArgList.
        Initialize ArgumentsData the new way.
        (JSC::Arguments::mark): Updated.
        (JSC::Arguments::getOwnPropertySlot): Overload for the integer form so
        we don't have to convert integers to identifiers just to get an argument.
        Integrated the deleted case with the fast case.
        (JSC::Arguments::put): Ditto.
        (JSC::Arguments::deleteProperty): Ditto.

        * kjs/Arguments.h: Minimized includes. Made everything private. Added
        overloads for the integral property name case. Eliminated mappedIndexSetter.
        Moved ArgumentsData into the .cpp file.

        * kjs/IndexToNameMap.cpp: Emptied out and prepared for deletion.
        * kjs/IndexToNameMap.h: Ditto.

        * kjs/JSActivation.cpp:
        (JSC::JSActivation::createArgumentsObject): Elminated ArgList.

        * GNUmakefile.am:
        * JavaScriptCore.pri:
        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * JavaScriptCoreSources.bkl:
        * kjs/AllInOneFile.cpp:
        Removed IndexToNameMap.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36743 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-09-21  Darin Adler  <darin@apple.com>

        Reviewed by Sam Weinig.

        * kjs/debugger.h: Removed some unneeded includes and declarations.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36744 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-09-21  Peter Gal  <galpter@inf.u-szeged.hu>

        Reviewed by Tim Hatcher and Eric Seidel.

        Fix the QT/Linux JavaScriptCore segmentation fault.
        https://bugs.webkit.org/show_bug.cgi?id=20914

        * wtf/ThreadingQt.cpp:
        (WTF::initializeThreading): Use currentThread() if
        platform is not a MAC (like in pre 36541 revisions)


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36745 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-09-21  Darin Adler  <darin@apple.com>

        Reviewed by Maciej Stachowiak.

        - https://bugs.webkit.org/show_bug.cgi?id=20975
          inline immediate-number case of ==

        * VM/CTI.h: Renamed emitJumpSlowCaseIfNotImm to
        emitJumpSlowCaseIfNotImmNum, since the old name was incorrect.

        * VM/CTI.cpp: Updated for new name.
        (JSC::CTI::privateCompileMainPass): Added op_eq.
        (JSC::CTI::privateCompileSlowCases): Added op_eq.

        * VM/Machine.cpp:
        (JSC::Machine::cti_op_eq): Removed fast case, since it's now
        compiled.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36746 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-09-21  Darin Adler  <darin@apple.com>

        Reviewed by Cameron Zwarich and Mark Rowe.

        - fix test failure caused by my recent IndexToNameMap patch

        * kjs/Arguments.cpp:
        (JSC::Arguments::deleteProperty): Added the accidentally-omitted
        check of the boolean result from toArrayIndex.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36747 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Improve timer resolution on WinXP.
        https://bugs.webkit.org/show_bug.cgi?id=20979
        
        Removed last-chance timer. It should not be necessary.
        Change timeEndPeriod timer to fire in 300ms instead of 20ms. Calling timeBeginPeriod/timeEndPeriod too often throws off accuracy.
        Remove Vista checks. We now run the same code on both XP and Vista.
        
        Call through to JSC::getCurrentUTCTimeWithMicroseconds from WebCore::currentTime.
        The code previously called GetSystemTimeAsFileTime, which is always low-resolution on XP, even within timeBeginPeriod(1).
        
        Reviewed by Maciej Stachowiak.

        * platform/win/SharedTimerWin.cpp:
        (WebCore::):
        (WebCore::TimerWindowWndProc):
        (WebCore::setSharedTimerFireTime):
        * platform/win/SystemTimeWin.cpp:
        (WebCore::currentTime):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36748 268f45cc-cd09-0410-ab3c-d52691b4dbfc