#pragma once
#if ENABLE(JIT)
#include "CCallHelpers.h"
#include "JITMathICInlineResult.h"
#include "SnippetOperand.h"
namespace JSC {
struct MathICGenerationState;
class JITMulGenerator {
public:
JITMulGenerator()
{ }
JITMulGenerator(SnippetOperand leftOperand, SnippetOperand rightOperand,
JSValueRegs result, JSValueRegs left, JSValueRegs right,
FPRReg leftFPR, FPRReg rightFPR, GPRReg scratchGPR, FPRReg scratchFPR)
: m_leftOperand(leftOperand)
, m_rightOperand(rightOperand)
, m_result(result)
, m_left(left)
, m_right(right)
, m_leftFPR(leftFPR)
, m_rightFPR(rightFPR)
, m_scratchGPR(scratchGPR)
, m_scratchFPR(scratchFPR)
{
ASSERT(!m_leftOperand.isPositiveConstInt32() || !m_rightOperand.isPositiveConstInt32());
}
JITMathICInlineResult generateInline(CCallHelpers&, MathICGenerationState&, const ArithProfile*);
bool generateFastPath(CCallHelpers&, CCallHelpers::JumpList& endJumpList, CCallHelpers::JumpList& slowJumpList, const ArithProfile*, bool shouldEmitProfiling);
static bool isLeftOperandValidConstant(SnippetOperand leftOperand) { return leftOperand.isPositiveConstInt32(); }
static bool isRightOperandValidConstant(SnippetOperand rightOperand) { return rightOperand.isPositiveConstInt32(); }
private:
SnippetOperand m_leftOperand;
SnippetOperand m_rightOperand;
JSValueRegs m_result;
JSValueRegs m_left;
JSValueRegs m_right;
FPRReg m_leftFPR;
FPRReg m_rightFPR;
GPRReg m_scratchGPR;
FPRReg m_scratchFPR;
};
}
#endif // ENABLE(JIT)