void prepareForNextHHBC(IRGS& env, const NormalizedInstruction* ni, SrcKey newSk, bool lastBcInst) { FTRACE(1, "------------------- prepareForNextHHBC ------------------\n"); env.currentNormalizedInstruction = ni; always_assert_flog( IMPLIES(isInlining(env), !env.lastBcInst), "Tried to end trace while inlining." ); always_assert_flog( IMPLIES(isInlining(env), !env.firstBcInst), "Inlining while still at the first region instruction." ); always_assert(env.bcStateStack.size() >= env.inlineLevel + 1); auto pops = env.bcStateStack.size() - 1 - env.inlineLevel; while (pops--) env.bcStateStack.pop_back(); always_assert_flog(env.bcStateStack.back().func() == newSk.func(), "Tried to update current SrcKey with a different func"); env.bcStateStack.back().setOffset(newSk.offset()); updateMarker(env); env.lastBcInst = lastBcInst; env.catchCreator = nullptr; env.irb->prepareForNextHHBC(); }
void emitRetV(IRGS& env) { assertx(!resumed(env)); assertx(!curFunc(env)->isResumable()); if (isInlining(env)) { retFromInlined(env); } else { implRet(env); } }
void emitRetV(HTS& env) { assert(!resumed(env)); assert(!curFunc(env)->isResumable()); if (isInlining(env)) { retFromInlined(env, Type::BoxedInitCell); } else { implRet(env, Type::BoxedInitCell); } }
void emitRetC(IRGS& env) { if (curFunc(env)->isAsyncGenerator()) PUNT(RetC-AsyncGenerator); if (isInlining(env)) { assertx(!resumed(env)); retFromInlined(env); } else { implRet(env); } }
Block* makeExitOpt(HTS& env, TransID transId) { assert(!isInlining(env)); auto const targetBcOff = bcOff(env); auto const exit = env.unit.defBlock(Block::Hint::Unlikely); BlockPusher blockPusher(*env.irb, makeMarker(env, targetBcOff), exit); spillStack(env); gen(env, AdjustSP, StackOffset { offsetFromSP(env, 0) }, sp(env)); gen(env, ReqRetranslateOpt, ReqRetransOptData{transId, SrcKey{curSrcKey(env), targetBcOff}}, sp(env)); return exit; }
Block* makeExitOpt(IRGS& env, TransID transId) { assertx(!isInlining(env)); auto const targetBcOff = bcOff(env); auto const exit = defBlock(env, Block::Hint::Unlikely); BlockPusher blockPusher(*env.irb, makeMarker(env, targetBcOff), exit); auto const data = ReqRetranslateOptData { transId, SrcKey { curSrcKey(env), targetBcOff }, bcSPOffset(env) }; gen(env, ReqRetranslateOpt, data, sp(env), fp(env)); return exit; }
void prepareForNextHHBC(HTS& env, const NormalizedInstruction* ni, Offset newOff, bool lastBcOff) { FTRACE(1, "------------------- prepareForNextHHBC ------------------\n"); env.currentNormalizedInstruction = ni; always_assert_log( IMPLIES(isInlining(env), !env.lastBcOff), [&] { return folly::format("Tried to end trace while inlining:\n{}", env.unit).str(); } ); env.bcStateStack.back().setOffset(newOff); updateMarker(env); env.lastBcOff = lastBcOff; env.irb->prepareForNextHHBC(); }