JITArithmetic32_64.cpp [plain text]
#include "config.h"
#if ENABLE(JIT)
#if USE(JSVALUE32_64)
#include "JIT.h"
#include "CodeBlock.h"
#include "JITInlines.h"
#include "JSArray.h"
#include "JSFunction.h"
#include "Interpreter.h"
#include "JSCInlines.h"
#include "ResultType.h"
#include "SlowPathCall.h"
namespace JSC {
void JIT::emit_op_unsigned(const Instruction* currentInstruction)
{
auto bytecode = currentInstruction->as<OpUnsigned>();
VirtualRegister result = bytecode.m_dst;
VirtualRegister op1 = bytecode.m_operand;
emitLoad(op1, regT1, regT0);
addSlowCase(branchIfNotInt32(regT1));
addSlowCase(branch32(LessThan, regT0, TrustedImm32(0)));
emitStoreInt32(result, regT0, result == op1);
}
void JIT::emit_op_inc(const Instruction* currentInstruction)
{
auto bytecode = currentInstruction->as<OpInc>();
VirtualRegister srcDst = bytecode.m_srcDst;
emitLoad(srcDst, regT1, regT0);
addSlowCase(branchIfNotInt32(regT1));
addSlowCase(branchAdd32(Overflow, TrustedImm32(1), regT0));
emitStoreInt32(srcDst, regT0, true);
}
void JIT::emit_op_dec(const Instruction* currentInstruction)
{
auto bytecode = currentInstruction->as<OpDec>();
VirtualRegister srcDst = bytecode.m_srcDst;
emitLoad(srcDst, regT1, regT0);
addSlowCase(branchIfNotInt32(regT1));
addSlowCase(branchSub32(Overflow, TrustedImm32(1), regT0));
emitStoreInt32(srcDst, regT0, true);
}
void JIT::emit_op_mod(const Instruction* currentInstruction)
{
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_mod);
slowPathCall.call();
}
void JIT::emitSlow_op_mod(const Instruction*, Vector<SlowCaseEntry>::iterator&)
{
}
}
#endif // USE(JSVALUE32_64)
#endif // ENABLE(JIT)