2008-08-06 Cameron Zwarich <cwzwarich@webkit.org>
authorcwzwarich@webkit.org <cwzwarich@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Aug 2008 10:37:34 +0000 (10:37 +0000)
committercwzwarich@webkit.org <cwzwarich@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Aug 2008 10:37:34 +0000 (10:37 +0000)
commit932959b1600774805bb47f4e295802e98461e656
treea9725030fc3e20ad256a94f01b94e8a9ed095b56
parent59644ccc95f67295049156faeb64b594fb41a27f
2008-08-06  Cameron Zwarich  <cwzwarich@webkit.org>

        Reviewed by Maciej.

        Bug 20286: Load constants all at once instead of using op_load
        <https://bugs.webkit.org/show_bug.cgi?id=20286>

        Load constants all at once into temporary registers instead of using
        individual instances of op_load.

        This is a 2.6% speedup on SunSpider.

        JavaScriptCore:

        * JavaScriptCore.exp:
        * VM/CodeBlock.cpp:
        (KJS::CodeBlock::dump):
        (KJS::CodeBlock::mark):
        * VM/CodeBlock.h:
        * VM/CodeGenerator.cpp:
        (KJS::CodeGenerator::CodeGenerator):
        (KJS::CodeGenerator::newTemporary):
        (KJS::CodeGenerator::addConstant):
        (KJS::CodeGenerator::addUnexpectedConstant):
        (KJS::CodeGenerator::emitLoad):
        (KJS::CodeGenerator::emitUnexpectedLoad):
        (KJS::CodeGenerator::emitNewError):
        * VM/CodeGenerator.h:
        * VM/Machine.cpp:
        (KJS::slideRegisterWindowForCall):
        (KJS::Machine::unwindCallFrame):
        (KJS::Machine::throwException):
        (KJS::Machine::execute):
        (KJS::Machine::privateExecute):
        * VM/Machine.h:
        * VM/Opcode.h:
        * VM/RegisterID.h:
        (KJS::RegisterID::RegisterID):
        (KJS::RegisterID::makeConstant):
        (KJS::RegisterID::isTemporary):
        * kjs/NodeInfo.h:
        * kjs/Parser.cpp:
        (KJS::Parser::didFinishParsing):
        * kjs/Parser.h:
        (KJS::Parser::parse):
        * kjs/grammar.y:
        * kjs/nodes.cpp:
        (KJS::NullNode::emitCode):
        (KJS::BooleanNode::emitCode):
        (KJS::NumberNode::emitCode):
        (KJS::StringNode::emitCode):
        (KJS::ArrayNode::emitCode):
        (KJS::DeleteResolveNode::emitCode):
        (KJS::DeleteValueNode::emitCode):
        (KJS::VoidNode::emitCode):
        (KJS::ConstDeclNode::emitCodeSingle):
        (KJS::ReturnNode::emitCode):
        (KJS::ScopeNode::ScopeNode):
        (KJS::ProgramNode::ProgramNode):
        (KJS::ProgramNode::create):
        (KJS::EvalNode::EvalNode):
        (KJS::EvalNode::create):
        (KJS::FunctionBodyNode::FunctionBodyNode):
        (KJS::FunctionBodyNode::create):
        (KJS::FunctionBodyNode::emitCode):
        * kjs/nodes.h:
        (KJS::ScopeNode::neededConstants):

        LayoutTests:

        * fast/js/constant-count-expected.txt: Added.
        * fast/js/constant-count.html: Added.
        * fast/js/deep-recursion-test.html:
        * fast/js/resources/constant-count.js: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@35593 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.exp
JavaScriptCore/VM/CodeBlock.cpp
JavaScriptCore/VM/CodeBlock.h
JavaScriptCore/VM/CodeGenerator.cpp
JavaScriptCore/VM/CodeGenerator.h
JavaScriptCore/VM/Machine.cpp
JavaScriptCore/VM/Machine.h
JavaScriptCore/VM/Opcode.h
JavaScriptCore/VM/RegisterID.h
JavaScriptCore/kjs/NodeInfo.h
JavaScriptCore/kjs/Parser.cpp
JavaScriptCore/kjs/Parser.h
JavaScriptCore/kjs/grammar.y
JavaScriptCore/kjs/nodes.cpp
JavaScriptCore/kjs/nodes.h
LayoutTests/ChangeLog
LayoutTests/fast/js/constant-count-expected.txt [new file with mode: 0644]
LayoutTests/fast/js/constant-count.html [new file with mode: 0644]
LayoutTests/fast/js/deep-recursion-test.html
LayoutTests/fast/js/resources/constant-count.js [new file with mode: 0644]