Add boolean speculations to DFG JIT 32_64
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Oct 2011 22:51:25 +0000 (22:51 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Oct 2011 22:51:25 +0000 (22:51 +0000)
commit82d8a18eab763da801796798f9b99aff407007f7
treee222419c1e0f3c435822664938404c35e563e92a
parenta4f3d5e52f879d2eadba09f491540b1da9eff68a
Add boolean speculations to DFG JIT 32_64
https://bugs.webkit.org/show_bug.cgi?id=70706

Patch by Yuqiang Xian <yuqiang.xian@intel.com> on 2011-10-24
Reviewed by Filip Pizlo.

Different from the boolean speculations in DFG 64, the boolean
speculations in DFG 32_64 will use a 32bit GPR to hold the primitive
boolean instead of a JSBoolean. This choice is not only for
performance, but also to save a register as we're short of registers on
X86.
To accomplish this we make use of DataFormatBoolean, allow a value to
be represented as a primitive boolean and converted from/to a
JSBoolean.
This patch also fixes SpillOrder in 32_64, which should be different
from 64, and fixes needDataFormatConversion logic in 32_64.

* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::branchTest32):
    We don't expect byte test actually as it doesn't work for registers
    esp..edi on X86.
* dfg/DFGGenerationInfo.h:
(JSC::DFG::needDataFormatConversion):
(JSC::DFG::GenerationInfo::initBoolean):
(JSC::DFG::GenerationInfo::gpr):
(JSC::DFG::GenerationInfo::fillInteger):
(JSC::DFG::GenerationInfo::fillBoolean):
* dfg/DFGJITCodeGenerator.cpp:
(JSC::DFG::JITCodeGenerator::checkConsistency):
* dfg/DFGJITCodeGenerator.h:
(JSC::DFG::JITCodeGenerator::use):
(JSC::DFG::JITCodeGenerator::silentSpillGPR):
(JSC::DFG::JITCodeGenerator::silentFillGPR):
(JSC::DFG::JITCodeGenerator::spill):
(JSC::DFG::cellResult):
(JSC::DFG::booleanResult):
* dfg/DFGJITCodeGenerator32_64.cpp:
(JSC::DFG::JITCodeGenerator::fillJSValue):
(JSC::DFG::JITCodeGenerator::nonSpeculativeNonPeepholeCompareNull):
(JSC::DFG::JITCodeGenerator::nonSpeculativeNonPeepholeCompare):
(JSC::DFG::JITCodeGenerator::nonSpeculativeNonPeepholeStrictEq):
* dfg/DFGJITCompiler32_64.cpp:
(JSC::DFG::JITCompiler::exitSpeculativeWithOSR):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::ValueSource::dump):
(JSC::DFG::ValueRecovery::dump):
(JSC::DFG::SpeculativeJIT::checkArgumentTypes):
(JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::ValueSource::forPrediction):
(JSC::DFG::ValueRecovery::alreadyInRegisterFileAsUnboxedBoolean):
(JSC::DFG::ValueRecovery::inGPR):
(JSC::DFG::ValueRecovery::gpr):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
(JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
(JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
(JSC::DFG::SpeculativeJIT::compileObjectEquality):
(JSC::DFG::SpeculativeJIT::compare):
(JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot):
(JSC::DFG::SpeculativeJIT::compileLogicalNot):
(JSC::DFG::SpeculativeJIT::emitBranch):
(JSC::DFG::SpeculativeJIT::compile):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@98291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h
Source/JavaScriptCore/dfg/DFGGenerationInfo.h
Source/JavaScriptCore/dfg/DFGJITCodeGenerator.cpp
Source/JavaScriptCore/dfg/DFGJITCodeGenerator.h
Source/JavaScriptCore/dfg/DFGJITCodeGenerator32_64.cpp
Source/JavaScriptCore/dfg/DFGJITCompiler32_64.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp