Reorganize trace linking and track link types.

This commit is contained in:
Mike Pall
2011-06-28 23:23:34 +02:00
parent 3dbae4ffc2
commit deeb8196c4
9 changed files with 63 additions and 31 deletions

View File

@@ -174,13 +174,23 @@ typedef uint32_t ExitNo;
typedef uint32_t TraceNo; /* Used to pass around trace numbers. */
typedef uint16_t TraceNo1; /* Stored trace number. */
#define TRACE_INTERP 0 /* Fallback to interpreter. */
/* Type of link. ORDER LJ_TRLINK */
typedef enum {
LJ_TRLINK_NONE, /* Incomplete trace. No link, yet. */
LJ_TRLINK_ROOT, /* Link to other root trace. */
LJ_TRLINK_LOOP, /* Loop to same trace. */
LJ_TRLINK_TAILREC, /* Tail-recursion. */
LJ_TRLINK_UPREC, /* Up-recursion. */
LJ_TRLINK_DOWNREC, /* Down-recursion. */
LJ_TRLINK_INTERP, /* Fallback to interpreter. */
LJ_TRLINK_RETURN /* Return to interpreter. */
} TraceLink;
/* Trace object. */
typedef struct GCtrace {
GCHeader;
uint8_t topslot; /* Top stack slot already checked to be allocated. */
uint8_t unused1;
uint8_t linktype; /* Type of link. */
IRRef nins; /* Next IR instruction. Biased with REF_BIAS. */
GCRef gclist;
IRIns *ir; /* IR instructions/constants. Biased with REF_BIAS. */