void MacroAssemblerX64::branchValueIsNurseryObject(Condition cond, ValueOperand value, Register temp, Label* label) { MOZ_ASSERT(cond == Assembler::Equal || cond == Assembler::NotEqual); const Nursery& nursery = GetJitContext()->runtime->gcNursery(); // Avoid creating a bogus ObjectValue below. if (!nursery.exists()) return; // 'Value' representing the start of the nursery tagged as a JSObject Value start = ObjectValue(*reinterpret_cast<JSObject*>(nursery.start())); ScratchRegisterScope scratch(asMasm()); movePtr(ImmWord(-ptrdiff_t(start.asRawBits())), scratch); addPtr(value.valueReg(), scratch); branchPtr(cond == Assembler::Equal ? Assembler::Below : Assembler::AboveOrEqual, scratch, Imm32(nursery.nurserySize()), label); }
void CodeGeneratorMIPS::visitCompareBitwiseAndBranch(LCompareBitwiseAndBranch* lir) { MCompare* mir = lir->cmpMir(); Assembler::Condition cond = JSOpToCondition(mir->compareType(), mir->jsop()); const ValueOperand lhs = ToValue(lir, LCompareBitwiseAndBranch::LhsInput); const ValueOperand rhs = ToValue(lir, LCompareBitwiseAndBranch::RhsInput); MOZ_ASSERT(mir->jsop() == JSOP_EQ || mir->jsop() == JSOP_STRICTEQ || mir->jsop() == JSOP_NE || mir->jsop() == JSOP_STRICTNE); MBasicBlock* notEqual = (cond == Assembler::Equal) ? lir->ifFalse() : lir->ifTrue(); branchToBlock(lhs.typeReg(), rhs.typeReg(), notEqual, Assembler::NotEqual); emitBranch(lhs.payloadReg(), rhs.payloadReg(), cond, lir->ifTrue(), lir->ifFalse()); }
void CodeGeneratorMIPS::visitCompareBitwise(LCompareBitwise* lir) { MCompare* mir = lir->mir(); Assembler::Condition cond = JSOpToCondition(mir->compareType(), mir->jsop()); const ValueOperand lhs = ToValue(lir, LCompareBitwise::LhsInput); const ValueOperand rhs = ToValue(lir, LCompareBitwise::RhsInput); const Register output = ToRegister(lir->output()); MOZ_ASSERT(IsEqualityOp(mir->jsop())); Label notEqual, done; masm.ma_b(lhs.typeReg(), rhs.typeReg(), ¬Equal, Assembler::NotEqual, ShortJump); { masm.cmp32Set(cond, lhs.payloadReg(), rhs.payloadReg(), output); masm.ma_b(&done, ShortJump); } masm.bind(¬Equal); { masm.move32(Imm32(cond == Assembler::NotEqual), output); } masm.bind(&done); }
bool CodeGeneratorX86::visitCompareVAndBranch(LCompareVAndBranch *lir) { MCompare *mir = lir->mir(); Assembler::Condition cond = JSOpToCondition(mir->jsop()); const ValueOperand lhs = ToValue(lir, LCompareVAndBranch::LhsInput); const ValueOperand rhs = ToValue(lir, LCompareVAndBranch::RhsInput); JS_ASSERT(mir->jsop() == JSOP_EQ || mir->jsop() == JSOP_STRICTEQ || mir->jsop() == JSOP_NE || mir->jsop() == JSOP_STRICTNE); Label *notEqual; if (cond == Assembler::Equal) notEqual = lir->ifFalse()->lir()->label(); else notEqual = lir->ifTrue()->lir()->label(); masm.cmp32(lhs.typeReg(), rhs.typeReg()); masm.j(Assembler::NotEqual, notEqual); masm.cmp32(lhs.payloadReg(), rhs.payloadReg()); emitBranch(cond, lir->ifTrue(), lir->ifFalse()); return true; }
void MacroAssembler::branchValueIsNurseryObject(Condition cond, ValueOperand value, Register temp, Label* label) { branchValueIsNurseryObjectImpl(cond, value.valueReg(), temp, label); }
Register CodeGeneratorMIPS::splitTagForTest(const ValueOperand& value) { return value.typeReg(); }