VMRegAnchor::VMRegAnchor(ActRec* ar) : m_old(tl_regState) { assert(tl_regState == VMRegState::DIRTY); tl_regState = VMRegState::CLEAN; auto prevAr = g_context->getOuterVMFrame(ar); const Func* prevF = prevAr->m_func; assert(!ar->resumed()); auto& regs = vmRegs(); regs.stack.top() = (TypedValue*)ar - ar->numArgs(); assert(vmStack().isValidAddress((uintptr_t)vmsp())); regs.pc = prevF->unit()->at(prevF->base() + ar->m_soff); regs.fp = prevAr; }
VMRegAnchor::VMRegAnchor(ActRec* ar) : m_old(tl_regState) { // Some C++ entry points have an ActRec prepared from after a call // instruction. This syncs us to right after the call instruction. assert(tl_regState == VMRegState::DIRTY); m_old = VMRegState::DIRTY; tl_regState = VMRegState::CLEAN; auto prevAr = g_context->getOuterVMFrame(ar); const Func* prevF = prevAr->m_func; assert(!ar->resumed()); auto& regs = vmRegs(); regs.stack.top() = (TypedValue*)ar - ar->numArgs(); assert(vmStack().isValidAddress((uintptr_t)vmsp())); regs.pc = prevF->unit()->at(prevF->base() + ar->m_soff); regs.fp = prevAr; }