Bug 59222 - DFG JIT - don't allocate virtual registers to nodes with no result
authorbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Apr 2011 20:38:27 +0000 (20:38 +0000)
committerbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Apr 2011 20:38:27 +0000 (20:38 +0000)
commit487365d30587d74a2485aa283105db60b0696553
tree9dda271bdd8acd7e32e9d43c6e57b3b3bc7733b5
parent0e7a974cecb9d121eec1762c299ecf97572c42cd
Bug 59222 - DFG JIT - don't allocate virtual registers to nodes with no result

Reviewed by Sam Weinig.

We currently allocate virtual registers to nodes which have no result - these are
clearly unused, and may result in us allocating a larger than necessary stack frame.

Encapsulate Node::virtualRegister such that we can ASSERT this is only called on
nodes that have results, and improve the quality of output from the consistency check.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parse):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dump):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::ref):
(JSC::DFG::Graph::deref):
* dfg/DFGJITCodeGenerator.cpp:
(JSC::DFG::JITCodeGenerator::fillInteger):
(JSC::DFG::JITCodeGenerator::fillDouble):
(JSC::DFG::JITCodeGenerator::fillJSValue):
(JSC::DFG::JITCodeGenerator::dump):
(JSC::DFG::JITCodeGenerator::checkConsistency):
* dfg/DFGJITCodeGenerator.h:
(JSC::DFG::JITCodeGenerator::canReuse):
(JSC::DFG::JITCodeGenerator::isFilled):
(JSC::DFG::JITCodeGenerator::isFilledDouble):
(JSC::DFG::JITCodeGenerator::use):
(JSC::DFG::JITCodeGenerator::integerResult):
(JSC::DFG::JITCodeGenerator::noResult):
(JSC::DFG::JITCodeGenerator::cellResult):
(JSC::DFG::JITCodeGenerator::jsValueResult):
(JSC::DFG::JITCodeGenerator::doubleResult):
(JSC::DFG::JITCodeGenerator::initConstantInfo):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::fillNumericToDouble):
(JSC::DFG::JITCompiler::fillInt32ToInteger):
(JSC::DFG::JITCompiler::fillToJS):
(JSC::DFG::JITCompiler::jumpFromSpeculativeToNonSpeculative):
* dfg/DFGNode.h:
(JSC::DFG::Node::Node):
(JSC::DFG::Node::hasResult):
(JSC::DFG::Node::virtualRegister):
(JSC::DFG::Node::setVirtualRegister):
(JSC::DFG::Node::refCount):
(JSC::DFG::Node::ref):
(JSC::DFG::Node::deref):
(JSC::DFG::Node::adjustedRefCount):
* dfg/DFGNonSpeculativeJIT.cpp:
(JSC::DFG::NonSpeculativeJIT::isKnownInteger):
(JSC::DFG::NonSpeculativeJIT::isKnownNumeric):
(JSC::DFG::NonSpeculativeJIT::compile):
* dfg/DFGScoreBoard.h:
(JSC::DFG::ScoreBoard::use):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
(JSC::DFG::SpeculativeJIT::fillSpeculateCell):
(JSC::DFG::SpeculativeJIT::compile):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84675 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
Source/JavaScriptCore/dfg/DFGGenerationInfo.h
Source/JavaScriptCore/dfg/DFGGraph.cpp
Source/JavaScriptCore/dfg/DFGGraph.h
Source/JavaScriptCore/dfg/DFGJITCodeGenerator.cpp
Source/JavaScriptCore/dfg/DFGJITCodeGenerator.h
Source/JavaScriptCore/dfg/DFGJITCompiler.cpp
Source/JavaScriptCore/dfg/DFGNode.h
Source/JavaScriptCore/dfg/DFGNonSpeculativeJIT.cpp
Source/JavaScriptCore/dfg/DFGScoreBoard.h
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp