aboutsummaryrefslogtreecommitdiff
path: root/src/lj_jit.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_jit.h')
-rw-r--r--src/lj_jit.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/lj_jit.h b/src/lj_jit.h
index 36e60113..1a1e407a 100644
--- a/src/lj_jit.h
+++ b/src/lj_jit.h
@@ -112,17 +112,27 @@ typedef uint8_t MCode;
112typedef struct SnapShot { 112typedef struct SnapShot {
113 uint16_t mapofs; /* Offset into snapshot map. */ 113 uint16_t mapofs; /* Offset into snapshot map. */
114 IRRef1 ref; /* First IR ref for this snapshot. */ 114 IRRef1 ref; /* First IR ref for this snapshot. */
115 uint8_t nslots; /* Number of stack slots. */ 115 uint8_t nslots; /* Number of valid slots. */
116 uint8_t nent; /* Number of compressed entries. */
116 uint8_t nframelinks; /* Number of frame links. */ 117 uint8_t nframelinks; /* Number of frame links. */
117 uint8_t count; /* Count of taken exits for this snapshot. */ 118 uint8_t count; /* Count of taken exits for this snapshot. */
118 uint8_t unused1;
119} SnapShot; 119} SnapShot;
120 120
121#define SNAPCOUNT_DONE 255 /* Already compiled and linked a side trace. */ 121#define SNAPCOUNT_DONE 255 /* Already compiled and linked a side trace. */
122 122
123/* Snapshot entry. */ 123/* Compressed snapshot entry. */
124typedef uint32_t SnapEntry; 124typedef uint32_t SnapEntry;
125
126#define SNAP_FRAME 0x010000 /* Slot has frame link. */
127
128#define SNAP(slot, flags, ref) ((SnapEntry)((slot) << 24) + (flags) + (ref))
129#define SNAP_MKPC(pc) ((SnapEntry)u32ptr(pc))
130#define SNAP_MKFTSZ(ftsz) ((SnapEntry)(ftsz))
125#define snap_ref(sn) ((sn) & 0xffff) 131#define snap_ref(sn) ((sn) & 0xffff)
132#define snap_slot(sn) ((BCReg)((sn) >> 24))
133#define snap_isframe(sn) ((sn) & SNAP_FRAME)
134#define snap_pc(sn) ((const BCIns *)(uintptr_t)(sn))
135#define snap_setref(sn, ref) (((sn) & 0xffff0000) | (ref))
126 136
127/* Snapshot and exit numbers. */ 137/* Snapshot and exit numbers. */
128typedef uint32_t SnapNo; 138typedef uint32_t SnapNo;