From: palfia@homejinni.com Date: Wed, 13 Nov 2013 02:56:30 +0000 (+0000) Subject: MIPS: Fix usage of EmitBranch in compare-minus-zero-and-branch. X-Git-Tag: upstream/4.7.83~11776 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=93c6ba639b00399d21fc5b1818496f19f0febcea;p=platform%2Fupstream%2Fv8.git MIPS: Fix usage of EmitBranch in compare-minus-zero-and-branch. Port r17669 (132efad) BUG= R=plind44@gmail.com Review URL: https://codereview.chromium.org/71003003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17675 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index a3bcdf6..7f6e869 100644 --- a/src/mips/lithium-codegen-mips.cc +++ b/src/mips/lithium-codegen-mips.cc @@ -2039,6 +2039,16 @@ void LCodeGen::EmitBranchF(InstrType instr, template +void LCodeGen::EmitFalseBranch(InstrType instr, + Condition condition, + Register src1, + const Operand& src2) { + int false_block = instr->FalseDestination(chunk_); + __ Branch(chunk_->GetAssemblyLabel(false_block), condition, src1, src2); +} + + +template void LCodeGen::EmitFalseBranchF(InstrType instr, Condition condition, FPURegister src1, @@ -2314,27 +2324,26 @@ void LCodeGen::DoCmpHoleAndBranch(LCmpHoleAndBranch* instr) { void LCodeGen::DoCompareMinusZeroAndBranch(LCompareMinusZeroAndBranch* instr) { Representation rep = instr->hydrogen()->value()->representation(); ASSERT(!rep.IsInteger32()); - Label if_false; Register scratch = ToRegister(instr->temp()); if (rep.IsDouble()) { DoubleRegister value = ToDoubleRegister(instr->value()); - __ BranchF(&if_false, NULL, ne, value, kDoubleRegZero); + EmitFalseBranchF(instr, ne, value, kDoubleRegZero); __ FmoveHigh(scratch, value); __ li(at, 0x80000000); } else { Register value = ToRegister(instr->value()); - __ CheckMap( - value, scratch, Heap::kHeapNumberMapRootIndex, &if_false, DO_SMI_CHECK); + __ CheckMap(value, + scratch, + Heap::kHeapNumberMapRootIndex, + instr->FalseLabel(chunk()), + DO_SMI_CHECK); __ lw(scratch, FieldMemOperand(value, HeapNumber::kExponentOffset)); - __ Branch(&if_false, ne, scratch, Operand(0x80000000)); + EmitFalseBranch(instr, ne, scratch, Operand(0x80000000)); __ lw(scratch, FieldMemOperand(value, HeapNumber::kMantissaOffset)); __ mov(at, zero_reg); } EmitBranch(instr, eq, scratch, Operand(at)); - - __ bind(&if_false); - EmitFalseBranchF(instr, al, kDoubleRegZero, kDoubleRegZero); } diff --git a/src/mips/lithium-codegen-mips.h b/src/mips/lithium-codegen-mips.h index f41adbf..c15352f 100644 --- a/src/mips/lithium-codegen-mips.h +++ b/src/mips/lithium-codegen-mips.h @@ -301,6 +301,8 @@ class LCodeGen: public LCodeGenBase { static Condition TokenToCondition(Token::Value op, bool is_unsigned); void EmitGoto(int block); + + // EmitBranch expects to be the last instruction of a block. template void EmitBranch(InstrType instr, Condition condition, @@ -312,6 +314,11 @@ class LCodeGen: public LCodeGenBase { FPURegister src1, FPURegister src2); template + void EmitFalseBranch(InstrType instr, + Condition condition, + Register src1, + const Operand& src2); + template void EmitFalseBranchF(InstrType instr, Condition condition, FPURegister src1,