Support integer typed arrays in the DFG JIT
authoroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Dec 2011 01:56:53 +0000 (01:56 +0000)
committeroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Dec 2011 01:56:53 +0000 (01:56 +0000)
commit37a2badcc49c1d22a4e93971587cdbb1f5c15f92
tree684f7f260eed9d1b56d3e37e6f170504a5f6ffb6
parent1e532710639a71dcd8738a10a1c887c20a5fa1f4
Support integer typed arrays in the DFG JIT
https://bugs.webkit.org/show_bug.cgi?id=73608

Reviewed by Filip Pizlo.

Add support for all the integral typed arrays in the DFG JIT.
Currently this loads the contents of Uint32 arrays as doubles,
which is clearly not as efficient as it could be, but this is
still in the order of 10-20x faster than the existing behaviour.

This needed us to add support for writing 16bit values to the
macroassembler, and also to support double<->unsigned conversion.

* assembler/ARMv7Assembler.h:
(JSC::ARMv7Assembler::strh):
(JSC::ARMv7Assembler::vcvt_floatingPointToUnsigned):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::store16):
(JSC::MacroAssemblerARMv7::truncateDoubleToUint32):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::store16):
(JSC::MacroAssemblerX86Common::truncateDoubleToUint32):
* assembler/X86Assembler.h:
(JSC::X86Assembler::movw_rm):
(JSC::X86Assembler::cvttsd2siq_rr):
* bytecode/PredictedType.cpp:
(JSC::predictionToString):
(JSC::predictionFromClassInfo):
* bytecode/PredictedType.h:
(JSC::isInt8ArrayPrediction):
(JSC::isInt16ArrayPrediction):
(JSC::isInt32ArrayPrediction):
(JSC::isUint8ArrayPrediction):
(JSC::isUint16ArrayPrediction):
(JSC::isUint32ArrayPrediction):
(JSC::isFloat32ArrayPrediction):
(JSC::isFloat64ArrayPrediction):
* dfg/DFGAbstractState.cpp:
(JSC::DFG::AbstractState::initialize):
(JSC::DFG::AbstractState::execute):
* dfg/DFGNode.h:
(JSC::DFG::Node::shouldSpeculateInt8Array):
(JSC::DFG::Node::shouldSpeculateInt16Array):
(JSC::DFG::Node::shouldSpeculateInt32Array):
(JSC::DFG::Node::shouldSpeculateUint8Array):
(JSC::DFG::Node::shouldSpeculateUint16Array):
(JSC::DFG::Node::shouldSpeculateUint32Array):
(JSC::DFG::Node::shouldSpeculateFloat32Array):
(JSC::DFG::Node::shouldSpeculateFloat64Array):
* dfg/DFGPropagator.cpp:
(JSC::DFG::Propagator::propagateNodePredictions):
(JSC::DFG::Propagator::fixupNode):
(JSC::DFG::Propagator::performNodeCSE):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::checkArgumentTypes):
(JSC::DFG::SpeculativeJIT::compileGetTypedArrayLength):
(JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray):
(JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* runtime/JSGlobalData.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@101729 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/assembler/ARMv7Assembler.h
Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h
Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h
Source/JavaScriptCore/assembler/X86Assembler.h
Source/JavaScriptCore/bytecode/PredictedType.cpp
Source/JavaScriptCore/bytecode/PredictedType.h
Source/JavaScriptCore/dfg/DFGAbstractState.cpp
Source/JavaScriptCore/dfg/DFGNode.h
Source/JavaScriptCore/dfg/DFGPropagator.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
Source/JavaScriptCore/runtime/JSGlobalData.h