void LCodeGen::DeoptimizeIfNegative(Register rt, LEnvironment* environment) {
int sign_bit = rt.Is64Bits() ? kXSignBit : kWSignBit;
- DeoptimizeBranch(environment, reg_bit_set, rt, sign_bit);
+ DeoptimizeIfBitSet(rt, sign_bit, environment);
}
void LCodeGen::DeoptimizeIfSmi(Register rt,
LEnvironment* environment) {
- DeoptimizeBranch(environment, reg_bit_clear, rt, MaskToBit(kSmiTagMask));
+ DeoptimizeIfBitClear(rt, MaskToBit(kSmiTagMask), environment);
}
void LCodeGen::DeoptimizeIfNotSmi(Register rt, LEnvironment* environment) {
- DeoptimizeBranch(environment, reg_bit_set, rt, MaskToBit(kSmiTagMask));
+ DeoptimizeIfBitSet(rt, MaskToBit(kSmiTagMask), environment);
}
}
+void LCodeGen::DeoptimizeIfBitSet(Register rt,
+ int bit,
+ LEnvironment* environment) {
+ DeoptimizeBranch(environment, reg_bit_set, rt, bit);
+}
+
+
+void LCodeGen::DeoptimizeIfBitClear(Register rt,
+ int bit,
+ LEnvironment* environment) {
+ DeoptimizeBranch(environment, reg_bit_clear, rt, bit);
+}
+
+
void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) {
if (!info()->IsStub()) {
// Ensure that we have enough space after the previous lazy-bailout
if (IsPowerOf2(mask)) {
ASSERT((tag == 0) || (tag == mask));
- // TODO(all): We might be able to use tbz/tbnz if we can guarantee that
- // the deopt handler is reachable by a tbz instruction.
- __ Tst(scratch, mask);
- DeoptimizeIf(tag == 0 ? ne : eq, instr->environment());
+ if (tag == 0) {
+ DeoptimizeIfBitSet(scratch, MaskToBit(mask), instr->environment());
+ } else {
+ DeoptimizeIfBitClear(scratch, MaskToBit(mask), instr->environment());
+ }
} else {
if (tag == 0) {
__ Tst(scratch, mask);
Heap::RootListIndex index,
LEnvironment* environment);
void DeoptimizeIfMinusZero(DoubleRegister input, LEnvironment* environment);
+ void DeoptimizeIfBitSet(Register rt, int bit, LEnvironment* environment);
+ void DeoptimizeIfBitClear(Register rt, int bit, LEnvironment* environment);
void ApplyCheckIf(Condition cc, LBoundsCheck* check);
MemOperand PrepareKeyedExternalArrayOperand(Register key,