Bug 56273 - Add three operand forms to MacroAssember operations.
Reviewed by Sam Weinig.
Adding for X86(_64) for now, should be rolled out to other backends as necessary.
These may allow more efficient code generation in some cases, avoiding the need
for unnecessary register-register move instructions.
* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::Jump::link):
(JSC::AbstractMacroAssembler::Jump::linkTo):
- marked these methods const.
(JSC::AbstractMacroAssembler::Jump::isSet):
- add a method to check whether a Jump object has been set to
reference an instruction, or is in a null, unset state.
* assembler/MacroAssemblerCodeRef.h:
(JSC::FunctionPtr::FunctionPtr):
- add non-explicit constructor, for FunctionPtr's to C/C++ functions.
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::and32):
(JSC::MacroAssemblerX86Common::lshift32):
(JSC::MacroAssemblerX86Common::or32):
(JSC::MacroAssemblerX86Common::rshift32):
(JSC::MacroAssemblerX86Common::urshift32):
(JSC::MacroAssemblerX86Common::xor32):
(JSC::MacroAssemblerX86Common::moveDouble):
(JSC::MacroAssemblerX86Common::addDouble):
(JSC::MacroAssemblerX86Common::divDouble):
(JSC::MacroAssemblerX86Common::subDouble):
(JSC::MacroAssemblerX86Common::mulDouble):
(JSC::MacroAssemblerX86Common::branchTruncateDoubleToInt32):
(JSC::MacroAssemblerX86Common::branchTest32):
(JSC::MacroAssemblerX86Common::branchTest8):
(JSC::MacroAssemblerX86Common::branchAdd32):
(JSC::MacroAssemblerX86Common::branchMul32):
(JSC::MacroAssemblerX86Common::branchSub32):
- add three operand forms of these instructions.
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::addDouble):
(JSC::MacroAssemblerX86_64::convertInt32ToDouble):
(JSC::MacroAssemblerX86_64::loadPtr):
(JSC::MacroAssemblerX86_64::branchTestPtr):
* assembler/X86Assembler.h:
(JSC::X86Assembler::JmpSrc::isSet):
- add a method to check whether a JmpSrc object has been set to
reference an instruction, or is in a null, unset state.
(JSC::X86Assembler::movsd_rr):
- added FP register-register move.
(JSC::X86Assembler::linkJump):
- Add an assert to check jumps aren't linked more than once.
* jit/JITInlineMethods.h:
(JSC::JIT::emitLoadInt32ToDouble):
- load integers to the FPU via regsiters on x86-64.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80972 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/jit/JITInlineMethods.h b/Source/JavaScriptCore/jit/JITInlineMethods.h
index 79d576b..c30b97b 100644
--- a/Source/JavaScriptCore/jit/JITInlineMethods.h
+++ b/Source/JavaScriptCore/jit/JITInlineMethods.h
@@ -710,8 +710,8 @@
inline void JIT::emitLoadInt32ToDouble(unsigned index, FPRegisterID value)
{
if (m_codeBlock->isConstantRegisterIndex(index)) {
- WriteBarrier<Unknown>& inConstantPool = m_codeBlock->constantRegister(index);
- convertInt32ToDouble(AbsoluteAddress(&inConstantPool), value);
+ ASSERT(isOperandConstantImmediateInt(index));
+ convertInt32ToDouble(Imm32(getConstantOperand(index).asInt32()), value);
} else
convertInt32ToDouble(addressFor(index), value);
}