| Index: src/arm64/lithium-codegen-arm64.cc
|
| diff --git a/src/arm64/lithium-codegen-arm64.cc b/src/arm64/lithium-codegen-arm64.cc
|
| index 7fdd94fee11f1beda5688c146720f55b19b23a83..334377897329415e06fdc9cde084c49a1f2fe347 100644
|
| --- a/src/arm64/lithium-codegen-arm64.cc
|
| +++ b/src/arm64/lithium-codegen-arm64.cc
|
| @@ -1078,18 +1078,18 @@ void LCodeGen::DeoptimizeIfNotZero(Register rt, LEnvironment* environment) {
|
|
|
| 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);
|
| }
|
|
|
|
|
| @@ -1116,6 +1116,20 @@ void LCodeGen::DeoptimizeIfMinusZero(DoubleRegister input,
|
| }
|
|
|
|
|
| +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
|
| @@ -2184,10 +2198,11 @@ void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
|
|
|
| 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);
|
|
|