#include "config.h"
#include "DFGArithMode.h"
#if ENABLE(DFG_JIT)
#include "DFGOperations.h"
#include "JSCInlines.h"
#include <wtf/PrintStream.h>
namespace JSC { namespace DFG {
Arith::UnaryFunction arithUnaryFunction(Arith::UnaryType type)
{
switch (type) {
#define DFG_ARITH_UNARY(capitalizedName, lowerName) \
case Arith::UnaryType::capitalizedName: \
return static_cast<Arith::UnaryFunction>(JSC::Math::lowerName);
FOR_EACH_DFG_ARITH_UNARY_OP(DFG_ARITH_UNARY)
#undef DFG_ARITH_UNARY
}
RELEASE_ASSERT_NOT_REACHED();
}
Arith::UnaryOperation arithUnaryOperation(Arith::UnaryType type)
{
switch (type) {
#define DFG_ARITH_UNARY(capitalizedName, lowerName) \
case Arith::UnaryType::capitalizedName: \
return static_cast<Arith::UnaryOperation>(operationArith##capitalizedName);
FOR_EACH_DFG_ARITH_UNARY_OP(DFG_ARITH_UNARY)
#undef DFG_ARITH_UNARY
}
RELEASE_ASSERT_NOT_REACHED();
}
} }
namespace WTF {
void printInternal(PrintStream& out, JSC::DFG::Arith::Mode mode)
{
switch (mode) {
case JSC::DFG::Arith::NotSet:
out.print("NotSet");
return;
case JSC::DFG::Arith::Unchecked:
out.print("Unchecked");
return;
case JSC::DFG::Arith::CheckOverflow:
out.print("CheckOverflow");
return;
case JSC::DFG::Arith::CheckOverflowAndNegativeZero:
out.print("CheckOverflowAndNegativeZero");
return;
case JSC::DFG::Arith::DoOverflow:
out.print("DoOverflow");
return;
}
RELEASE_ASSERT_NOT_REACHED();
}
void printInternal(PrintStream& out, JSC::DFG::Arith::RoundingMode mode)
{
switch (mode) {
case JSC::DFG::Arith::RoundingMode::Int32:
out.print("Int32");
return;
case JSC::DFG::Arith::RoundingMode::Int32WithNegativeZeroCheck:
out.print("Int32WithNegativeZeroCheck");
return;
case JSC::DFG::Arith::RoundingMode::Double:
out.print("Double");
return;
}
RELEASE_ASSERT_NOT_REACHED();
}
void printInternal(PrintStream& out, JSC::DFG::Arith::UnaryType type)
{
switch (type) {
#define DFG_ARITH_UNARY(capitalizedName, lowerName) \
case JSC::DFG::Arith::UnaryType::capitalizedName: \
out.print(#capitalizedName); \
return;
FOR_EACH_DFG_ARITH_UNARY_OP(DFG_ARITH_UNARY)
#undef DFG_ARITH_UNARY
}
RELEASE_ASSERT_NOT_REACHED();
}
}
#endif // ENABLE(DFG_JIT)