int instrFpToArDelta(const Func* func, PC opcode) { // This function should only be called for instructions that read the current // FPI assertx(instrReadsCurrentFpi(peek_op(opcode))); auto const fpi = func->findFPI(func->unit()->offsetOf(opcode)); assertx(fpi != nullptr); return fpi->m_fpOff; }
int instrSpToArDelta(const Op* opcode) { // This function should only be called for instructions that read // the current FPI assert(instrReadsCurrentFpi(*opcode)); // The delta from sp to ar is equal to the number of values on the stack // that will be consumed by this instruction (numPops) plus the number of // parameters pushed onto the stack so far that are not being consumed by // this instruction (numExtra). For the FPass* instructions, numExtra will // be equal to the first immediate argument (param id). For the FCall // instructions, numExtra will be 0 because all of the parameters on the // stack are already accounted for by numPops. int numPops = instrNumPops(opcode); int numExtra = isFCallStar(*opcode) ? 0 : getImm(opcode, 0).u_IVA; return numPops + numExtra; }