Implement support for op_negate and op_bitnot in the DFG JIT
https://bugs.webkit.org/show_bug.cgi?id=79617
Reviewed by Filip Pizlo.
Add an ArithNegate op to the DFG JIT, to implement op_negate.
This patch also adds support for op_negate to the JSVALUE64 baseline JIT
(JSVALUE32_64 already had this), so that we can profile the slowpath usage.
This is a 2.5%-3% Sunspider progression and a 1% win on Kraken.
- assembler/ARMv7Assembler.h:
(JSC::ARMv7Assembler::sub_S):
- Added sub_S from immediate.
(ARMv7Assembler):
(JSC::ARMv7Assembler::vneg):
- assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::negateDouble):
(MacroAssemblerARMv7):
(JSC::MacroAssemblerARMv7::branchNeg32):
- assembler/MacroAssemblerX86.h:
(MacroAssemblerX86):
- moved loadDouble, absDouble to common.
- assembler/MacroAssemblerX86Common.h:
(MacroAssemblerX86Common):
(JSC::MacroAssemblerX86Common::absDouble):
- implementation can be shared.
(JSC::MacroAssemblerX86Common::negateDouble):
(JSC::MacroAssemblerX86Common::loadDouble):
- allow absDouble to have a common implementation.
- assembler/MacroAssemblerX86_64.h:
(MacroAssemblerX86_64):
- moved loadDouble, absDouble to common.
- dfg/DFGAbstractState.cpp:
(JSC::DFG::AbstractState::execute):
- dfg/DFGArithNodeFlagsInferencePhase.cpp:
(JSC::DFG::ArithNodeFlagsInferencePhase::propagate):
- dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::makeSafe):
(JSC::DFG::ByteCodeParser::parseBlock):
(JSC::DFG::CSEPhase::performNodeCSE):
(JSC::DFG::canCompileOpcode):
(JSC::DFG::Graph::negateShouldSpeculateInteger):
(JSC::DFG::Node::hasArithNodeFlags):
- dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
- dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArithNegate):
(SpeculativeJIT):
- dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
- dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
- Add support for op_negate in JSVALUE64.
(JSC::JIT::emit_op_negate):
(JSC::JIT::emitSlow_op_negate):
- Add support for op_negate in JSVALUE64.