TCA emit_bindjcc1st_stub(CodeBlock& cb, FPInvOffset spOff, TCA jcc, SrcKey taken, SrcKey next, ConditionCode cc) { always_assert_flog(taken.resumed() == next.resumed(), "bind_jcc_1st was confused about resumables"); return emit_ephemeral( cb, mcg->getFreeStub(cb, &mcg->cgFixups()), taken.resumed() ? folly::none : folly::make_optional(spOff), REQ_BIND_JCC_FIRST, jcc, taken.toAtomicInt(), next.toAtomicInt(), cc ); }
void emitBindJ(CodeBlock& cb, CodeBlock& frozen, ConditionCode cc, SrcKey dest) { TCA toSmash = cb.frontier(); if (cb.base() == frozen.base()) { // This is just to reserve space. We'll overwrite with the real dest later. mcg->backEnd().emitSmashableJump(cb, toSmash, cc); } mcg->setJmpTransID(toSmash); TCA sr = emitEphemeralServiceReq( frozen, mcg->getFreeStub(frozen, &mcg->cgFixups()), folly::none, REQ_BIND_JMP, toSmash, dest.toAtomicInt(), TransFlags{}.packed ); MacroAssembler a { cb }; if (cb.base() == frozen.base()) { UndoMarker um {cb}; cb.setFrontier(toSmash); mcg->backEnd().emitSmashableJump(cb, sr, cc); um.undo(); } else { mcg->backEnd().emitSmashableJump(cb, sr, cc); } }
TCA emit_retranslate_opt_stub(CodeBlock& cb, FPInvOffset spOff, SrcKey target, TransID transID) { return emit_persistent( cb, target.resumed() ? folly::none : folly::make_optional(spOff), REQ_RETRANSLATE_OPT, target.toAtomicInt(), transID ); }
TCA emit_bindaddr_stub(CodeBlock& cb, FPInvOffset spOff, TCA* addr, SrcKey target, TransFlags trflags) { return emit_ephemeral( cb, mcg->getFreeStub(cb, &mcg->cgFixups()), target.resumed() ? folly::none : folly::make_optional(spOff), REQ_BIND_ADDR, addr, target.toAtomicInt(), trflags.packed ); }