Commit 9ae45df6 authored by baptiste.afsa@arm.com's avatar baptiste.afsa@arm.com

ARM64: Minor improvement in LCodeGen::DoCheckInstanceType.

R=ulan@chromium.org

Review URL: https://codereview.chromium.org/207453008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20248 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent d0219737
......@@ -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);
......
......@@ -237,6 +237,8 @@ class LCodeGen: public LCodeGenBase {
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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment