예제 #1
0
Fixup makeFixup(const BCMarker& marker, SyncOptions sync) {
    assertx(marker.valid());
    auto const stackOff = [&] {
        switch (sync) {
        case SyncOptions::SyncAdjustOne:
            return marker.spOff() -= 1;

        case SyncOptions::None:
            // We can get here if we are memory profiling, since we override the
            // normal sync settings and sync anyway.
            always_assert(RuntimeOption::HHProfEnabled);
        // fallthru
        case SyncOptions::Sync:
            return marker.spOff();
        }
        not_reached();
    }();

    auto const bcOff = marker.fixupBcOff() - marker.fixupFunc()->base();
    return Fixup{bcOff, stackOff.offset};
}
예제 #2
0
FrameState::FrameState(IRUnit& unit, BCMarker marker)
  : FrameState(unit, marker.spOff(), marker.func(), marker.func()->numLocals())
{
  assert(!marker.isDummy());
}