ljx

FORK: LuaJIT with native 5.2 and 5.3 support
git clone https://git.neptards.moe/neptards/ljx.git
Log | Files | Refs | README

lj_record.h (1813B)


      1 /*
      2 ** Trace recorder (bytecode -> SSA IR).
      3 ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
      4 */
      5 
      6 #ifndef _LJ_RECORD_H
      7 #define _LJ_RECORD_H
      8 
      9 #include "lj_obj.h"
     10 #include "lj_jit.h"
     11 
     12 #if LJ_HASJIT
     13 /* Context for recording an indexed load/store. */
     14 typedef struct RecordIndex {
     15   TValue otabv;         /* Original runtime value of table (or indexed object). */
     16   TValue tabv;		/* Runtime value of table (or indexed object). */
     17   TValue keyv;		/* Runtime value of key. */
     18   TValue valv;		/* Runtime value of stored value. */
     19   TValue mobjv;		/* Runtime value of metamethod object. */
     20   GCtab *mtv;		/* Runtime value of metatable object. */
     21   cTValue *oldv;	/* Runtime value of previously stored value. */
     22   TRef otab;            /* Original table (or indexed object) reference. */
     23   TRef tab;		/* Table (or indexed object) reference. */
     24   TRef key;		/* Key reference. */
     25   TRef val;		/* Value reference for a store or 0 for a load. */
     26   TRef mt;		/* Metatable reference. */
     27   TRef mobj;		/* Metamethod object reference. */
     28   int idxchain;		/* Index indirections left or 0 for raw lookup. */
     29 } RecordIndex;
     30 
     31 LJ_FUNC int lj_record_objcmp(jit_State *J, TRef a, TRef b,
     32 			     cTValue *av, cTValue *bv);
     33 LJ_FUNC void lj_record_stop(jit_State *J, TraceLink linktype, TraceNo lnk);
     34 LJ_FUNC TRef lj_record_constify(jit_State *J, cTValue *o);
     35 
     36 LJ_FUNC void lj_record_call(jit_State *J, BCReg func, ptrdiff_t nargs);
     37 LJ_FUNC void lj_record_tailcall(jit_State *J, BCReg func, ptrdiff_t nargs);
     38 LJ_FUNC void lj_record_ret(jit_State *J, BCReg rbase, ptrdiff_t gotresults);
     39 
     40 LJ_FUNC int lj_record_mm_lookup(jit_State *J, RecordIndex *ix, MMS mm);
     41 LJ_FUNC TRef lj_record_idx(jit_State *J, RecordIndex *ix);
     42 
     43 LJ_FUNC void lj_record_ins(jit_State *J);
     44 LJ_FUNC void lj_record_setup(jit_State *J);
     45 #endif
     46 
     47 #endif