Macros | Functions
lcode.c File Reference
#include "lprefix.h"
#include <limits.h>
#include <math.h>
#include <stdlib.h>
#include "lua.h"
#include "lcode.h"
#include "ldebug.h"
#include "ldo.h"
#include "lgc.h"
#include "llex.h"
#include "lmem.h"
#include "lobject.h"
#include "lopcodes.h"
#include "lparser.h"
#include "lstring.h"
#include "ltable.h"
#include "lvm.h"
Include dependency graph for lcode.c:

Go to the source code of this file.

Macros

#define hasjumps(e)   ((e)->t != (e)->f)
 
#define lcode_c
 
#define LIMLINEDIFF   0x80
 
#define LUA_CORE
 
#define MAXREGS   255
 

Functions

static int addk (FuncState *fs, TValue *key, TValue *v)
 
static int boolF (FuncState *fs)
 
static int boolT (FuncState *fs)
 
static int code_loadbool (FuncState *fs, int A, OpCode op)
 
static void codeABRK (FuncState *fs, OpCode o, int a, int b, expdesc *ec)
 
static void codearith (FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2, int flip, int line)
 
static void codebinexpval (FuncState *fs, OpCode op, expdesc *e1, expdesc *e2, int line)
 
static void codebini (FuncState *fs, OpCode op, expdesc *e1, expdesc *e2, int flip, int line, TMS event)
 
static void codebitwise (FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2, int line)
 
static void codecommutative (FuncState *fs, BinOpr op, expdesc *e1, expdesc *e2, int line)
 
static void codeconcat (FuncState *fs, expdesc *e1, expdesc *e2, int line)
 
static void codeeq (FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2)
 
static int codeextraarg (FuncState *fs, int a)
 
static void codenot (FuncState *fs, expdesc *e)
 
static void codeorder (FuncState *fs, OpCode op, expdesc *e1, expdesc *e2)
 
static int codesJ (FuncState *fs, OpCode o, int sj, int k)
 
static void codeunexpval (FuncState *fs, OpCode op, expdesc *e, int line)
 
static int condjump (FuncState *fs, OpCode op, int A, int B, int C, int k)
 
static void const2exp (TValue *v, expdesc *e)
 
static TValueconst2val (FuncState *fs, const expdesc *e)
 
static int constfolding (FuncState *fs, int op, expdesc *e1, const expdesc *e2)
 
static void discharge2anyreg (FuncState *fs, expdesc *e)
 
static void discharge2reg (FuncState *fs, expdesc *e, int reg)
 
static void exp2reg (FuncState *fs, expdesc *e, int reg)
 
static int finaltarget (Instruction *code, int i)
 
static int finishbinexpneg (FuncState *fs, expdesc *e1, expdesc *e2, OpCode op, int line, TMS event)
 
static void finishbinexpval (FuncState *fs, expdesc *e1, expdesc *e2, OpCode op, int v2, int flip, int line, OpCode mmop, TMS event)
 
static int fitsBx (lua_Integer i)
 
static int fitsC (lua_Integer i)
 
static void fixjump (FuncState *fs, int pc, int dest)
 
static void freeexp (FuncState *fs, expdesc *e)
 
static void freeexps (FuncState *fs, expdesc *e1, expdesc *e2)
 
static void freereg (FuncState *fs, int reg)
 
static void freeregs (FuncState *fs, int r1, int r2)
 
static int getjump (FuncState *fs, int pc)
 
static Instructiongetjumpcontrol (FuncState *fs, int pc)
 
static int isCint (expdesc *e)
 
static int isKstr (FuncState *fs, expdesc *e)
 
static int isSCint (expdesc *e)
 
static int isSCnumber (expdesc *e, int *pi, int *isfloat)
 
static int jumponcond (FuncState *fs, expdesc *e, int cond)
 
void luaK_checkstack (FuncState *fs, int n)
 
int luaK_code (FuncState *fs, Instruction i)
 
int luaK_codeABCk (FuncState *fs, OpCode o, int a, int b, int c, int k)
 
int luaK_codeABx (FuncState *fs, OpCode o, int a, unsigned int bc)
 
int luaK_codeAsBx (FuncState *fs, OpCode o, int a, int bc)
 
static int luaK_codek (FuncState *fs, int reg, int k)
 
void luaK_concat (FuncState *fs, int *l1, int l2)
 
void luaK_dischargevars (FuncState *fs, expdesc *e)
 
int luaK_exp2anyreg (FuncState *fs, expdesc *e)
 
void luaK_exp2anyregup (FuncState *fs, expdesc *e)
 
int luaK_exp2const (FuncState *fs, const expdesc *e, TValue *v)
 
static int luaK_exp2K (FuncState *fs, expdesc *e)
 
void luaK_exp2nextreg (FuncState *fs, expdesc *e)
 
int luaK_exp2RK (FuncState *fs, expdesc *e)
 
void luaK_exp2val (FuncState *fs, expdesc *e)
 
void luaK_finish (FuncState *fs)
 
void luaK_fixline (FuncState *fs, int line)
 
static void luaK_float (FuncState *fs, int reg, lua_Number f)
 
int luaK_getlabel (FuncState *fs)
 
void luaK_goiffalse (FuncState *fs, expdesc *e)
 
void luaK_goiftrue (FuncState *fs, expdesc *e)
 
void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k)
 
void luaK_infix (FuncState *fs, BinOpr op, expdesc *v)
 
void luaK_int (FuncState *fs, int reg, lua_Integer i)
 
static int luaK_intK (FuncState *fs, lua_Integer n)
 
int luaK_isKint (expdesc *e)
 
int luaK_jump (FuncState *fs)
 
void luaK_nil (FuncState *fs, int from, int n)
 
static int luaK_numberK (FuncState *fs, lua_Number r)
 
void luaK_patchlist (FuncState *fs, int list, int target)
 
void luaK_patchtohere (FuncState *fs, int list)
 
void luaK_posfix (FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2, int line)
 
void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e, int line)
 
void luaK_reserveregs (FuncState *fs, int n)
 
void luaK_ret (FuncState *fs, int first, int nret)
 
void luaK_self (FuncState *fs, expdesc *e, expdesc *key)
 
l_noret luaK_semerror (LexState *ls, const char *msg)
 
void luaK_setlist (FuncState *fs, int base, int nelems, int tostore)
 
void luaK_setoneret (FuncState *fs, expdesc *e)
 
void luaK_setreturns (FuncState *fs, expdesc *e, int nresults)
 
void luaK_settablesize (FuncState *fs, int pc, int ra, int asize, int hsize)
 
void luaK_storevar (FuncState *fs, expdesc *var, expdesc *ex)
 
static int need_value (FuncState *fs, int list)
 
static void negatecondition (FuncState *fs, expdesc *e)
 
static int nilK (FuncState *fs)
 
static void patchlistaux (FuncState *fs, int list, int vtarget, int reg, int dtarget)
 
static int patchtestreg (FuncState *fs, int node, int reg)
 
static Instructionpreviousinstruction (FuncState *fs)
 
static void removelastinstruction (FuncState *fs)
 
static void removelastlineinfo (FuncState *fs)
 
static void removevalues (FuncState *fs, int list)
 
static void savelineinfo (FuncState *fs, Proto *f, int line)
 
static void str2K (FuncState *fs, expdesc *e)
 
static int stringK (FuncState *fs, TString *s)
 
static void swapexps (expdesc *e1, expdesc *e2)
 
static int tonumeral (const expdesc *e, TValue *v)
 
static int validop (int op, TValue *v1, TValue *v2)
 

Macro Definition Documentation

◆ hasjumps

#define hasjumps (   e)    ((e)->t != (e)->f)

Definition at line 37 of file lcode.c.

◆ lcode_c

#define lcode_c

Definition at line 7 of file lcode.c.

◆ LIMLINEDIFF

#define LIMLINEDIFF   0x80

Definition at line 318 of file lcode.c.

◆ LUA_CORE

#define LUA_CORE

Definition at line 8 of file lcode.c.

◆ MAXREGS

#define MAXREGS   255

Definition at line 34 of file lcode.c.

Function Documentation

◆ addk()

static int addk ( FuncState fs,
TValue key,
TValue v 
)
static

Definition at line 542 of file lcode.c.

◆ boolF()

static int boolF ( FuncState fs)
static

Definition at line 607 of file lcode.c.

◆ boolT()

static int boolT ( FuncState fs)
static

Definition at line 617 of file lcode.c.

◆ code_loadbool()

static int code_loadbool ( FuncState fs,
int  A,
OpCode  op 
)
static

Definition at line 870 of file lcode.c.

◆ codeABRK()

static void codeABRK ( FuncState fs,
OpCode  o,
int  a,
int  b,
expdesc ec 
)
static

Definition at line 1020 of file lcode.c.

◆ codearith()

static void codearith ( FuncState fs,
BinOpr  opr,
expdesc e1,
expdesc e2,
int  flip,
int  line 
)
static

Definition at line 1426 of file lcode.c.

◆ codebinexpval()

static void codebinexpval ( FuncState fs,
OpCode  op,
expdesc e1,
expdesc e2,
int  line 
)
static

Definition at line 1374 of file lcode.c.

◆ codebini()

static void codebini ( FuncState fs,
OpCode  op,
expdesc e1,
expdesc e2,
int  flip,
int  line,
TMS  event 
)
static

Definition at line 1386 of file lcode.c.

◆ codebitwise()

static void codebitwise ( FuncState fs,
BinOpr  opr,
expdesc e1,
expdesc e2,
int  line 
)
static

Definition at line 1466 of file lcode.c.

◆ codecommutative()

static void codecommutative ( FuncState fs,
BinOpr  op,
expdesc e1,
expdesc e2,
int  line 
)
static

Definition at line 1448 of file lcode.c.

◆ codeconcat()

static void codeconcat ( FuncState fs,
expdesc e1,
expdesc e2,
int  line 
)
static

Definition at line 1622 of file lcode.c.

◆ codeeq()

static void codeeq ( FuncState fs,
BinOpr  opr,
expdesc e1,
expdesc e2 
)
static

Definition at line 1522 of file lcode.c.

◆ codeextraarg()

static int codeextraarg ( FuncState fs,
int  a 
)
static

Definition at line 439 of file lcode.c.

◆ codenot()

static void codenot ( FuncState fs,
expdesc e 
)
static

Definition at line 1168 of file lcode.c.

◆ codeorder()

static void codeorder ( FuncState fs,
OpCode  op,
expdesc e1,
expdesc e2 
)
static

Definition at line 1492 of file lcode.c.

◆ codesJ()

static int codesJ ( FuncState fs,
OpCode  o,
int  sj,
int  k 
)
static

Definition at line 428 of file lcode.c.

◆ codeunexpval()

static void codeunexpval ( FuncState fs,
OpCode  op,
expdesc e,
int  line 
)
static

Definition at line 1341 of file lcode.c.

◆ condjump()

static int condjump ( FuncState fs,
OpCode  op,
int  A,
int  B,
int  C,
int  k 
)
static

Definition at line 221 of file lcode.c.

◆ const2exp()

static void const2exp ( TValue v,
expdesc e 
)
static

Definition at line 674 of file lcode.c.

◆ const2val()

static TValue* const2val ( FuncState fs,
const expdesc e 
)
static

Definition at line 73 of file lcode.c.

◆ constfolding()

static int constfolding ( FuncState fs,
int  op,
expdesc e1,
const expdesc e2 
)
static

Definition at line 1315 of file lcode.c.

◆ discharge2anyreg()

static void discharge2anyreg ( FuncState fs,
expdesc e 
)
static

Definition at line 862 of file lcode.c.

◆ discharge2reg()

static void discharge2reg ( FuncState fs,
expdesc e,
int  reg 
)
static

Definition at line 807 of file lcode.c.

◆ exp2reg()

static void exp2reg ( FuncState fs,
expdesc e,
int  reg 
)
static

Definition at line 896 of file lcode.c.

◆ finaltarget()

static int finaltarget ( Instruction code,
int  i 
)
static

Definition at line 1769 of file lcode.c.

◆ finishbinexpneg()

static int finishbinexpneg ( FuncState fs,
expdesc e1,
expdesc e2,
OpCode  op,
int  line,
TMS  event 
)
static

Definition at line 1398 of file lcode.c.

◆ finishbinexpval()

static void finishbinexpval ( FuncState fs,
expdesc e1,
expdesc e2,
OpCode  op,
int  v2,
int  flip,
int  line,
OpCode  mmop,
TMS  event 
)
static

Definition at line 1356 of file lcode.c.

◆ fitsBx()

static int fitsBx ( lua_Integer  i)
static

Definition at line 649 of file lcode.c.

◆ fitsC()

static int fitsC ( lua_Integer  i)
static

Definition at line 641 of file lcode.c.

◆ fixjump()

static void fixjump ( FuncState fs,
int  pc,
int  dest 
)
static

Definition at line 166 of file lcode.c.

◆ freeexp()

static void freeexp ( FuncState fs,
expdesc e 
)
static

Definition at line 516 of file lcode.c.

◆ freeexps()

static void freeexps ( FuncState fs,
expdesc e1,
expdesc e2 
)
static

Definition at line 526 of file lcode.c.

◆ freereg()

static void freereg ( FuncState fs,
int  reg 
)
static

Definition at line 490 of file lcode.c.

◆ freeregs()

static void freeregs ( FuncState fs,
int  r1,
int  r2 
)
static

Definition at line 501 of file lcode.c.

◆ getjump()

static int getjump ( FuncState fs,
int  pc 
)
static

Definition at line 153 of file lcode.c.

◆ getjumpcontrol()

static Instruction* getjumpcontrol ( FuncState fs,
int  pc 
)
static

Definition at line 242 of file lcode.c.

◆ isCint()

static int isCint ( expdesc e)
static

Definition at line 1219 of file lcode.c.

◆ isKstr()

static int isKstr ( FuncState fs,
expdesc e 
)
static

Definition at line 1202 of file lcode.c.

◆ isSCint()

static int isSCint ( expdesc e)
static

Definition at line 1228 of file lcode.c.

◆ isSCnumber()

static int isSCnumber ( expdesc e,
int *  pi,
int *  isfloat 
)
static

Definition at line 1237 of file lcode.c.

◆ jumponcond()

static int jumponcond ( FuncState fs,
expdesc e,
int  cond 
)
static

Definition at line 1097 of file lcode.c.

◆ luaK_checkstack()

void luaK_checkstack ( FuncState fs,
int  n 
)

Definition at line 465 of file lcode.c.

◆ luaK_code()

int luaK_code ( FuncState fs,
Instruction  i 
)

Definition at line 381 of file lcode.c.

◆ luaK_codeABCk()

int luaK_codeABCk ( FuncState fs,
OpCode  o,
int  a,
int  b,
int  c,
int  k 
)

Definition at line 396 of file lcode.c.

◆ luaK_codeABx()

int luaK_codeABx ( FuncState fs,
OpCode  o,
int  a,
unsigned int  bc 
)

Definition at line 407 of file lcode.c.

◆ luaK_codeAsBx()

int luaK_codeAsBx ( FuncState fs,
OpCode  o,
int  a,
int  bc 
)

Definition at line 417 of file lcode.c.

◆ luaK_codek()

static int luaK_codek ( FuncState fs,
int  reg,
int  k 
)
static

Definition at line 450 of file lcode.c.

◆ luaK_concat()

void luaK_concat ( FuncState fs,
int *  l1,
int  l2 
)

Definition at line 180 of file lcode.c.

◆ luaK_dischargevars()

void luaK_dischargevars ( FuncState fs,
expdesc e 
)

Definition at line 754 of file lcode.c.

◆ luaK_exp2anyreg()

int luaK_exp2anyreg ( FuncState fs,
expdesc e 
)

Definition at line 936 of file lcode.c.

◆ luaK_exp2anyregup()

void luaK_exp2anyregup ( FuncState fs,
expdesc e 
)

Definition at line 958 of file lcode.c.

◆ luaK_exp2const()

int luaK_exp2const ( FuncState fs,
const expdesc e,
TValue v 
)

Definition at line 83 of file lcode.c.

◆ luaK_exp2K()

static int luaK_exp2K ( FuncState fs,
expdesc e 
)
static

Definition at line 980 of file lcode.c.

◆ luaK_exp2nextreg()

void luaK_exp2nextreg ( FuncState fs,
expdesc e 
)

Definition at line 924 of file lcode.c.

◆ luaK_exp2RK()

int luaK_exp2RK ( FuncState fs,
expdesc e 
)

Definition at line 1010 of file lcode.c.

◆ luaK_exp2val()

void luaK_exp2val ( FuncState fs,
expdesc e 
)

Definition at line 968 of file lcode.c.

◆ luaK_finish()

void luaK_finish ( FuncState fs)

Definition at line 1786 of file lcode.c.

◆ luaK_fixline()

void luaK_fixline ( FuncState fs,
int  line 
)

Definition at line 1726 of file lcode.c.

◆ luaK_float()

static void luaK_float ( FuncState fs,
int  reg,
lua_Number  f 
)
static

Definition at line 662 of file lcode.c.

◆ luaK_getlabel()

int luaK_getlabel ( FuncState fs)

Definition at line 231 of file lcode.c.

◆ luaK_goiffalse()

void luaK_goiffalse ( FuncState fs,
expdesc e 
)

Definition at line 1142 of file lcode.c.

◆ luaK_goiftrue()

void luaK_goiftrue ( FuncState fs,
expdesc e 
)

Definition at line 1115 of file lcode.c.

◆ luaK_indexed()

void luaK_indexed ( FuncState fs,
expdesc t,
expdesc k 
)

Definition at line 1260 of file lcode.c.

◆ luaK_infix()

void luaK_infix ( FuncState fs,
BinOpr  op,
expdesc v 
)

Definition at line 1574 of file lcode.c.

◆ luaK_int()

void luaK_int ( FuncState fs,
int  reg,
lua_Integer  i 
)

Definition at line 654 of file lcode.c.

◆ luaK_intK()

static int luaK_intK ( FuncState fs,
lua_Integer  n 
)
static

Definition at line 587 of file lcode.c.

◆ luaK_isKint()

int luaK_isKint ( expdesc e)

Definition at line 1210 of file lcode.c.

◆ luaK_jump()

int luaK_jump ( FuncState fs)

Definition at line 198 of file lcode.c.

◆ luaK_nil()

void luaK_nil ( FuncState fs,
int  from,
int  n 
)

Definition at line 130 of file lcode.c.

◆ luaK_numberK()

static int luaK_numberK ( FuncState fs,
lua_Number  r 
)
static

Definition at line 597 of file lcode.c.

◆ luaK_patchlist()

void luaK_patchlist ( FuncState fs,
int  list,
int  target 
)

Definition at line 305 of file lcode.c.

◆ luaK_patchtohere()

void luaK_patchtohere ( FuncState fs,
int  list 
)

Definition at line 311 of file lcode.c.

◆ luaK_posfix()

void luaK_posfix ( FuncState fs,
BinOpr  opr,
expdesc e1,
expdesc e2,
int  line 
)

Definition at line 1642 of file lcode.c.

◆ luaK_prefix()

void luaK_prefix ( FuncState fs,
UnOpr  op,
expdesc e,
int  line 
)

Definition at line 1553 of file lcode.c.

◆ luaK_reserveregs()

void luaK_reserveregs ( FuncState fs,
int  n 
)

Definition at line 479 of file lcode.c.

◆ luaK_ret()

void luaK_ret ( FuncState fs,
int  first,
int  nret 
)

Definition at line 206 of file lcode.c.

◆ luaK_self()

void luaK_self ( FuncState fs,
expdesc e,
expdesc key 
)

Definition at line 1067 of file lcode.c.

◆ luaK_semerror()

l_noret luaK_semerror ( LexState ls,
const char *  msg 
)

Definition at line 45 of file lcode.c.

◆ luaK_setlist()

void luaK_setlist ( FuncState fs,
int  base,
int  nelems,
int  tostore 
)

Definition at line 1750 of file lcode.c.

◆ luaK_setoneret()

void luaK_setoneret ( FuncState fs,
expdesc e 
)

Definition at line 736 of file lcode.c.

◆ luaK_setreturns()

void luaK_setreturns ( FuncState fs,
expdesc e,
int  nresults 
)

Definition at line 703 of file lcode.c.

◆ luaK_settablesize()

void luaK_settablesize ( FuncState fs,
int  pc,
int  ra,
int  asize,
int  hsize 
)

Definition at line 1732 of file lcode.c.

◆ luaK_storevar()

void luaK_storevar ( FuncState fs,
expdesc var,
expdesc ex 
)

Definition at line 1030 of file lcode.c.

◆ need_value()

static int need_value ( FuncState fs,
int  list 
)
static

Definition at line 880 of file lcode.c.

◆ negatecondition()

static void negatecondition ( FuncState fs,
expdesc e 
)
static

Definition at line 1083 of file lcode.c.

◆ nilK()

static int nilK ( FuncState fs)
static

Definition at line 627 of file lcode.c.

◆ patchlistaux()

static void patchlistaux ( FuncState fs,
int  list,
int  vtarget,
int  reg,
int  dtarget 
)
static

Definition at line 287 of file lcode.c.

◆ patchtestreg()

static int patchtestreg ( FuncState fs,
int  node,
int  reg 
)
static

Definition at line 258 of file lcode.c.

◆ previousinstruction()

static Instruction* previousinstruction ( FuncState fs)
static

Definition at line 115 of file lcode.c.

◆ removelastinstruction()

static void removelastinstruction ( FuncState fs)
static

Definition at line 371 of file lcode.c.

◆ removelastlineinfo()

static void removelastlineinfo ( FuncState fs)
static

Definition at line 352 of file lcode.c.

◆ removevalues()

static void removevalues ( FuncState fs,
int  list 
)
static

Definition at line 276 of file lcode.c.

◆ savelineinfo()

static void savelineinfo ( FuncState fs,
Proto f,
int  line 
)
static

Definition at line 328 of file lcode.c.

◆ str2K()

static void str2K ( FuncState fs,
expdesc e 
)
static

Definition at line 719 of file lcode.c.

◆ stringK()

static int stringK ( FuncState fs,
TString s 
)
static

Definition at line 574 of file lcode.c.

◆ swapexps()

static void swapexps ( expdesc e1,
expdesc e2 
)
static

Definition at line 1417 of file lcode.c.

◆ tonumeral()

static int tonumeral ( const expdesc e,
TValue v 
)
static

Definition at line 55 of file lcode.c.

◆ validop()

static int validop ( int  op,
TValue v1,
TValue v2 
)
static

Definition at line 1296 of file lcode.c.



plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:49