X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/6fe7ccc865dc7d7541b93c5bcaf6368d2c98a174..4be4e30906bcb8ee30b4d189205cb70bad6707ce:/jit/JITArithmetic32_64.cpp diff --git a/jit/JITArithmetic32_64.cpp b/jit/JITArithmetic32_64.cpp index 62a359e..c1caf61 100644 --- a/jit/JITArithmetic32_64.cpp +++ b/jit/JITArithmetic32_64.cpp @@ -30,12 +30,13 @@ #include "JIT.h" #include "CodeBlock.h" -#include "JITInlineMethods.h" +#include "JITInlines.h" #include "JITStubCall.h" #include "JITStubs.h" #include "JSArray.h" #include "JSFunction.h" #include "Interpreter.h" +#include "Operations.h" #include "ResultType.h" #include "SamplingTool.h" @@ -448,79 +449,7 @@ void JIT::emitSlow_op_bitxor(Instruction* currentInstruction, Vector::iterator& iter) -{ - unsigned dst = currentInstruction[1].u.operand; - unsigned srcDst = currentInstruction[2].u.operand; - - linkSlowCase(iter); // int32 check - if (dst != srcDst) - linkSlowCase(iter); // overflow check - - JITStubCall stubCall(this, cti_op_post_inc); - stubCall.addArgument(srcDst); - stubCall.addArgument(TrustedImm32(srcDst)); - stubCall.call(dst); -} - -// PostDec (i--) - -void JIT::emit_op_post_dec(Instruction* currentInstruction) -{ - unsigned dst = currentInstruction[1].u.operand; - unsigned srcDst = currentInstruction[2].u.operand; - - emitLoad(srcDst, regT1, regT0); - addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag))); - - if (dst == srcDst) // x = x-- is a noop for ints. - return; - - move(regT0, regT2); - addSlowCase(branchSub32(Overflow, TrustedImm32(1), regT2)); - emitStoreInt32(srcDst, regT2, true); - - emitStoreAndMapInt32(dst, regT1, regT0, false, OPCODE_LENGTH(op_post_dec)); -} - -void JIT::emitSlow_op_post_dec(Instruction* currentInstruction, Vector::iterator& iter) -{ - unsigned dst = currentInstruction[1].u.operand; - unsigned srcDst = currentInstruction[2].u.operand; - - linkSlowCase(iter); // int32 check - if (dst != srcDst) - linkSlowCase(iter); // overflow check - - JITStubCall stubCall(this, cti_op_post_dec); - stubCall.addArgument(srcDst); - stubCall.addArgument(TrustedImm32(srcDst)); - stubCall.call(dst); -} - -// PreInc (++i) - -void JIT::emit_op_pre_inc(Instruction* currentInstruction) +void JIT::emit_op_inc(Instruction* currentInstruction) { unsigned srcDst = currentInstruction[1].u.operand; @@ -528,24 +457,22 @@ void JIT::emit_op_pre_inc(Instruction* currentInstruction) addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag))); addSlowCase(branchAdd32(Overflow, TrustedImm32(1), regT0)); - emitStoreAndMapInt32(srcDst, regT1, regT0, true, OPCODE_LENGTH(op_pre_inc)); + emitStoreAndMapInt32(srcDst, regT1, regT0, true, OPCODE_LENGTH(op_inc)); } -void JIT::emitSlow_op_pre_inc(Instruction* currentInstruction, Vector::iterator& iter) +void JIT::emitSlow_op_inc(Instruction* currentInstruction, Vector::iterator& iter) { unsigned srcDst = currentInstruction[1].u.operand; linkSlowCase(iter); // int32 check linkSlowCase(iter); // overflow check - JITStubCall stubCall(this, cti_op_pre_inc); + JITStubCall stubCall(this, cti_op_inc); stubCall.addArgument(srcDst); stubCall.call(srcDst); } -// PreDec (--i) - -void JIT::emit_op_pre_dec(Instruction* currentInstruction) +void JIT::emit_op_dec(Instruction* currentInstruction) { unsigned srcDst = currentInstruction[1].u.operand; @@ -553,17 +480,17 @@ void JIT::emit_op_pre_dec(Instruction* currentInstruction) addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag))); addSlowCase(branchSub32(Overflow, TrustedImm32(1), regT0)); - emitStoreAndMapInt32(srcDst, regT1, regT0, true, OPCODE_LENGTH(op_pre_dec)); + emitStoreAndMapInt32(srcDst, regT1, regT0, true, OPCODE_LENGTH(op_dec)); } -void JIT::emitSlow_op_pre_dec(Instruction* currentInstruction, Vector::iterator& iter) +void JIT::emitSlow_op_dec(Instruction* currentInstruction, Vector::iterator& iter) { unsigned srcDst = currentInstruction[1].u.operand; linkSlowCase(iter); // int32 check linkSlowCase(iter); // overflow check - JITStubCall stubCall(this, cti_op_pre_dec); + JITStubCall stubCall(this, cti_op_dec); stubCall.addArgument(srcDst); stubCall.call(srcDst); } @@ -907,7 +834,7 @@ void JIT::emitBinaryDoubleOp(OpcodeID opcodeID, unsigned dst, unsigned op1, unsi addJump(branchDouble(DoubleGreaterThanOrUnordered, fpRegT0, fpRegT2), dst); break; default: - ASSERT_NOT_REACHED(); + RELEASE_ASSERT_NOT_REACHED(); } if (!notInt32Op2.empty()) @@ -1011,7 +938,7 @@ void JIT::emitBinaryDoubleOp(OpcodeID opcodeID, unsigned dst, unsigned op1, unsi addJump(branchDouble(DoubleGreaterThanOrUnordered, fpRegT1, fpRegT0), dst); break; default: - ASSERT_NOT_REACHED(); + RELEASE_ASSERT_NOT_REACHED(); } } @@ -1252,7 +1179,7 @@ void JIT::emitSlow_op_mod(Instruction* currentInstruction, Vector UNUSED_PARAM(iter); // We would have really useful assertions here if it wasn't for the compiler's // insistence on attribute noreturn. - // ASSERT_NOT_REACHED(); + // RELEASE_ASSERT_NOT_REACHED(); #endif }