Bug 1087496 - Optimize codegen for IsNullOrLikeUndefined* instructions. r=h4writer

--HG--
extra : rebase_source : 4699073583913d1d471ba7f72487dac305d0eb0b
This commit is contained in:
Jan de Mooij 2014-10-22 21:58:25 +02:00
parent 2733da18af
commit 5d575225a2

View File

@ -5571,8 +5571,10 @@ CodeGenerator::visitIsNullOrLikeUndefined(LIsNullOrLikeUndefined *lir)
}
Register tag = masm.splitTagForTest(value);
MDefinition *input = lir->mir()->lhs();
if (input->mightBeType(MIRType_Null))
masm.branchTestNull(Assembler::Equal, tag, nullOrLikeUndefined);
if (input->mightBeType(MIRType_Undefined))
masm.branchTestUndefined(Assembler::Equal, tag, nullOrLikeUndefined);
if (ool) {
@ -5652,7 +5654,10 @@ CodeGenerator::visitIsNullOrLikeUndefinedAndBranch(LIsNullOrLikeUndefinedAndBran
Label *ifTrueLabel = getJumpLabelForBranch(ifTrue);
Label *ifFalseLabel = getJumpLabelForBranch(ifFalse);
MDefinition *input = lir->cmpMir()->lhs();
if (input->mightBeType(MIRType_Null))
masm.branchTestNull(Assembler::Equal, tag, ifTrueLabel);
if (input->mightBeType(MIRType_Undefined))
masm.branchTestUndefined(Assembler::Equal, tag, ifTrueLabel);
if (ool) {