SnapshotIterator::SnapshotIterator(const IonFrameIterator &iter) : SnapshotReader(iter.ionScript()->snapshots() + iter.osiIndex()->snapshotOffset(), iter.ionScript()->snapshots() + iter.ionScript()->snapshotsSize()), fp_(iter.jsFrame()), machine_(iter.machineState()), ionScript_(iter.ionScript()) { }
IonBailoutIterator::IonBailoutIterator(const JitActivationIterator &activations, const IonFrameIterator &frame) : IonFrameIterator(activations), machine_(frame.machineState()) { returnAddressToFp_ = frame.returnAddressToFp(); topIonScript_ = frame.ionScript(); const OsiIndex *osiIndex = frame.osiIndex(); current_ = (uint8_t *) frame.fp(); type_ = IonFrame_OptimizedJS; topFrameSize_ = frame.frameSize(); snapshotOffset_ = osiIndex->snapshotOffset(); }
static inline uintptr_t ReadAllocation(const IonFrameIterator &frame, const LAllocation *a) { if (a->isGeneralReg()) { Register reg = a->toGeneralReg()->reg(); return frame.machineState().read(reg); } if (a->isStackSlot()) { uint32 slot = a->toStackSlot()->slot(); return *frame.jsFrame()->slotRef(slot); } uint32 index = a->toArgument()->index(); uint8 *argv = reinterpret_cast<uint8 *>(frame.jsFrame()->argv()); return *reinterpret_cast<uintptr_t *>(argv + index); }