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()) {
DwVfpRegister value = ToDoubleRegister(instr->value());
__ VFPCompareAndSetFlags(value, 0.0);
- __ b(ne, &if_false);
+ EmitFalseBranch(instr, ne);
__ VmovHigh(scratch, value);
__ cmp(scratch, Operand(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);
__ ldr(scratch, FieldMemOperand(value, HeapNumber::kExponentOffset));
__ ldr(ip, FieldMemOperand(value, HeapNumber::kMantissaOffset));
__ cmp(scratch, Operand(0x80000000));
__ cmp(ip, Operand(0x00000000), eq);
}
EmitBranch(instr, eq);
-
- __ bind(&if_false);
- EmitFalseBranch(instr, al);
}
static Condition TokenToCondition(Token::Value op, bool is_unsigned);
void EmitGoto(int block);
+
+ // EmitBranch expects to be the last instruction of a block.
template<class InstrType>
void EmitBranch(InstrType instr, Condition condition);
template<class InstrType>
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()) {
XMMRegister xmm_scratch = double_scratch0();
__ xorps(xmm_scratch, xmm_scratch);
__ ucomisd(xmm_scratch, value);
- __ j(not_equal, &if_false);
+ EmitFalseBranch(instr, not_equal);
__ movmskpd(scratch, value);
__ test(scratch, Immediate(1));
EmitBranch(instr, not_zero);
} else {
Register value = ToRegister(instr->value());
Handle<Map> map = masm()->isolate()->factory()->heap_number_map();
- __ CheckMap(value, map, &if_false, DO_SMI_CHECK);
+ __ CheckMap(value, map, instr->FalseLabel(chunk()), DO_SMI_CHECK);
__ cmp(FieldOperand(value, HeapNumber::kExponentOffset),
Immediate(0x80000000));
- __ j(not_equal, &if_false);
+ EmitFalseBranch(instr, not_equal);
__ cmp(FieldOperand(value, HeapNumber::kMantissaOffset),
Immediate(0x00000000));
EmitBranch(instr, equal);
}
-
- __ bind(&if_false);
- EmitFalseBranch(instr, no_condition);
}
static Condition TokenToCondition(Token::Value op, bool is_unsigned);
void EmitGoto(int block);
+
+ // EmitBranch expects to be the last instruction of a block.
template<class InstrType>
void EmitBranch(InstrType instr, Condition cc);
template<class InstrType>
void LCodeGen::DoCompareMinusZeroAndBranch(LCompareMinusZeroAndBranch* instr) {
Representation rep = instr->hydrogen()->value()->representation();
ASSERT(!rep.IsInteger32());
- Label if_false;
if (rep.IsDouble()) {
XMMRegister value = ToDoubleRegister(instr->value());
XMMRegister xmm_scratch = double_scratch0();
__ xorps(xmm_scratch, xmm_scratch);
__ ucomisd(xmm_scratch, value);
- __ j(not_equal, &if_false);
+ EmitFalseBranch(instr, not_equal);
__ movmskpd(kScratchRegister, value);
__ testl(kScratchRegister, Immediate(1));
EmitBranch(instr, not_zero);
} else {
Register value = ToRegister(instr->value());
Handle<Map> map = masm()->isolate()->factory()->heap_number_map();
- __ CheckMap(value, map, &if_false, DO_SMI_CHECK);
+ __ CheckMap(value, map, instr->FalseLabel(chunk()), DO_SMI_CHECK);
__ cmpl(FieldOperand(value, HeapNumber::kExponentOffset),
Immediate(0x80000000));
- __ j(not_equal, &if_false);
+ EmitFalseBranch(instr, not_equal);
__ cmpl(FieldOperand(value, HeapNumber::kMantissaOffset),
Immediate(0x00000000));
EmitBranch(instr, equal);
}
-
- __ bind(&if_false);
- EmitFalseBranch(instr, always);
}
static Condition TokenToCondition(Token::Value op, bool is_unsigned);
void EmitGoto(int block);
+
+ // EmitBranch expects to be the last instruction of a block.
template<class InstrType>
void EmitBranch(InstrType instr, Condition cc);
template<class InstrType>