Github User Fetcher 1.0.0
C Application with Server and GUI
|
#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"
Go to the source code of this file.
Macros | |
#define | lcode_c |
#define | LUA_CORE |
#define | hasjumps(e) ((e)->t != (e)->f) |
Functions | |
static int | isnumeral (expdesc *e) |
void | luaK_nil (FuncState *fs, int from, int n) |
int | luaK_jump (FuncState *fs) |
void | luaK_ret (FuncState *fs, int first, int nret) |
static int | condjump (FuncState *fs, OpCode op, int A, int B, int C) |
static void | fixjump (FuncState *fs, int pc, int dest) |
int | luaK_getlabel (FuncState *fs) |
static int | getjump (FuncState *fs, int pc) |
static Instruction * | getjumpcontrol (FuncState *fs, int pc) |
static int | need_value (FuncState *fs, int list) |
static int | patchtestreg (FuncState *fs, int node, int reg) |
static void | removevalues (FuncState *fs, int list) |
static void | patchlistaux (FuncState *fs, int list, int vtarget, int reg, int dtarget) |
static void | dischargejpc (FuncState *fs) |
void | luaK_patchlist (FuncState *fs, int list, int target) |
LUAI_FUNC void | luaK_patchclose (FuncState *fs, int list, int level) |
void | luaK_patchtohere (FuncState *fs, int list) |
void | luaK_concat (FuncState *fs, int *l1, int l2) |
static int | luaK_code (FuncState *fs, Instruction i) |
int | luaK_codeABC (FuncState *fs, OpCode o, int a, int b, int c) |
int | luaK_codeABx (FuncState *fs, OpCode o, int a, unsigned int bc) |
static int | codeextraarg (FuncState *fs, int a) |
int | luaK_codek (FuncState *fs, int reg, int k) |
void | luaK_checkstack (FuncState *fs, int n) |
void | luaK_reserveregs (FuncState *fs, int n) |
static void | freereg (FuncState *fs, int reg) |
static void | freeexp (FuncState *fs, expdesc *e) |
static int | addk (FuncState *fs, TValue *key, TValue *v) |
int | luaK_stringK (FuncState *fs, TString *s) |
int | luaK_numberK (FuncState *fs, lua_Number r) |
static int | boolK (FuncState *fs, int b) |
static int | nilK (FuncState *fs) |
void | luaK_setreturns (FuncState *fs, expdesc *e, int nresults) |
void | luaK_setoneret (FuncState *fs, expdesc *e) |
void | luaK_dischargevars (FuncState *fs, expdesc *e) |
static int | code_label (FuncState *fs, int A, int b, int jump) |
static void | discharge2reg (FuncState *fs, expdesc *e, int reg) |
static void | discharge2anyreg (FuncState *fs, expdesc *e) |
static void | exp2reg (FuncState *fs, expdesc *e, int reg) |
void | luaK_exp2nextreg (FuncState *fs, expdesc *e) |
int | luaK_exp2anyreg (FuncState *fs, expdesc *e) |
void | luaK_exp2anyregup (FuncState *fs, expdesc *e) |
void | luaK_exp2val (FuncState *fs, expdesc *e) |
int | luaK_exp2RK (FuncState *fs, expdesc *e) |
void | luaK_storevar (FuncState *fs, expdesc *var, expdesc *ex) |
void | luaK_self (FuncState *fs, expdesc *e, expdesc *key) |
static void | invertjump (FuncState *fs, expdesc *e) |
static int | jumponcond (FuncState *fs, expdesc *e, int cond) |
void | luaK_goiftrue (FuncState *fs, expdesc *e) |
void | luaK_goiffalse (FuncState *fs, expdesc *e) |
static void | codenot (FuncState *fs, expdesc *e) |
void | luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) |
static int | constfolding (OpCode op, expdesc *e1, expdesc *e2) |
static void | codearith (FuncState *fs, OpCode op, expdesc *e1, expdesc *e2, int line) |
static void | codecomp (FuncState *fs, OpCode op, int cond, expdesc *e1, expdesc *e2) |
void | luaK_prefix (FuncState *fs, UnOpr op, expdesc *e, int line) |
void | luaK_infix (FuncState *fs, BinOpr op, expdesc *v) |
void | luaK_posfix (FuncState *fs, BinOpr op, expdesc *e1, expdesc *e2, int line) |
void | luaK_fixline (FuncState *fs, int line) |
void | luaK_setlist (FuncState *fs, int base, int nelems, int tostore) |
#define hasjumps | ( | e | ) | ((e)->t != (e)->f) |
Definition at line 29 of file lua-5.2.4/src/lcode.c.
Referenced by exp2reg(), luaK_exp2anyreg(), luaK_exp2anyregup(), luaK_exp2val(), and luaK_indexed().
#define lcode_c |
Definition at line 10 of file lua-5.2.4/src/lcode.c.
#define LUA_CORE |
Definition at line 11 of file lua-5.2.4/src/lcode.c.
Definition at line 291 of file lua-5.2.4/src/lcode.c.
References cast_num, FuncState::f, FuncState::h, Proto::k, LexState::L, FuncState::ls, lua_number2int, luaC_barrier, luaH_set(), luaM_growvector, luaV_rawequalobj, MAXARG_Ax, FuncState::nk, nvalue, setnilvalue, setnvalue, setobj, Proto::sizek, and ttisnumber.
Referenced by boolK(), luaK_numberK(), luaK_stringK(), and nilK().
|
static |
Definition at line 343 of file lua-5.2.4/src/lcode.c.
References addk(), and setbvalue.
Referenced by luaK_exp2RK().
|
static |
Definition at line 415 of file lua-5.2.4/src/lcode.c.
References luaK_codeABC, luaK_getlabel(), and OP_LOADBOOL.
Referenced by exp2reg().
Definition at line 724 of file lua-5.2.4/src/lcode.c.
References constfolding(), freeexp(), expdesc::info, expdesc::k, luaK_codeABC, luaK_exp2RK(), luaK_fixline(), OP_LEN, OP_UNM, expdesc::u, and VRELOCABLE.
Referenced by luaK_posfix(), and luaK_prefix().
Definition at line 746 of file lua-5.2.4/src/lcode.c.
References cond(), condjump(), freeexp(), expdesc::info, expdesc::k, luaK_exp2RK(), OP_EQ, expdesc::u, and VJMP.
Referenced by luaK_posfix().
|
static |
Definition at line 244 of file lua-5.2.4/src/lcode.c.
References CREATE_Ax, lua_assert, luaK_code(), MAXARG_Ax, and OP_EXTRAARG.
Referenced by luaK_codek(), and luaK_setlist().
Definition at line 668 of file lua-5.2.4/src/lcode.c.
References discharge2anyreg(), expdesc::f, freeexp(), expdesc::info, invertjump(), expdesc::k, lua_assert, luaK_codeABC, luaK_dischargevars(), OP_NOT, removevalues(), expdesc::t, expdesc::u, VFALSE, VJMP, VK, VKNUM, VNIL, VNONRELOC, VRELOCABLE, and VTRUE.
Referenced by luaK_prefix().
Definition at line 74 of file lua-5.2.4/src/lcode.c.
References luaK_codeABC, and luaK_jump().
Referenced by codecomp(), and jumponcond().
Definition at line 713 of file lua-5.2.4/src/lcode.c.
References isnumeral(), LUA_OPADD, luaO_arith(), expdesc::nval, OP_ADD, OP_DIV, OP_MOD, and expdesc::u.
Referenced by codearith().
Definition at line 460 of file lua-5.2.4/src/lcode.c.
References discharge2reg(), FuncState::freereg, expdesc::k, luaK_reserveregs(), and VNONRELOC.
Referenced by codenot(), and jumponcond().
Definition at line 421 of file lua-5.2.4/src/lcode.c.
References getcode, expdesc::info, expdesc::k, lua_assert, luaK_codeABC, luaK_codek(), luaK_dischargevars(), luaK_nil(), luaK_numberK(), expdesc::nval, OP_LOADBOOL, OP_MOVE, SETARG_A, expdesc::u, VFALSE, VJMP, VK, VKNUM, VNIL, VNONRELOC, VRELOCABLE, VTRUE, and VVOID.
Referenced by discharge2anyreg(), and exp2reg().
|
static |
Definition at line 163 of file lua-5.2.4/src/lcode.c.
References FuncState::jpc, NO_JUMP, NO_REG, patchlistaux(), and FuncState::pc.
Referenced by luaK_code().
Definition at line 468 of file lua-5.2.4/src/lcode.c.
References code_label(), discharge2reg(), expdesc::f, hasjumps, expdesc::info, expdesc::k, luaK_concat(), luaK_getlabel(), luaK_jump(), luaK_patchtohere(), need_value(), NO_JUMP, patchlistaux(), expdesc::t, expdesc::u, VJMP, and VNONRELOC.
Referenced by luaK_exp2anyreg(), luaK_exp2nextreg(), and luaK_storevar().
|
static |
Definition at line 80 of file lua-5.2.4/src/lcode.c.
References Proto::code, FuncState::f, FuncState::ls, lua_assert, luaX_syntaxerror(), MAXARG_sBx, NO_JUMP, and SETARG_sBx.
Referenced by luaK_concat(), and patchlistaux().
Definition at line 285 of file lua-5.2.4/src/lcode.c.
References freereg(), expdesc::info, expdesc::k, expdesc::u, and VNONRELOC.
Referenced by codearith(), codecomp(), codenot(), jumponcond(), luaK_exp2nextreg(), luaK_posfix(), luaK_self(), and luaK_storevar().
|
static |
Definition at line 277 of file lua-5.2.4/src/lcode.c.
References FuncState::freereg, ISK, lua_assert, and FuncState::nactvar.
Referenced by freeexp(), and luaK_dischargevars().
|
static |
Definition at line 100 of file lua-5.2.4/src/lcode.c.
References Proto::code, FuncState::f, GETARG_sBx, and NO_JUMP.
Referenced by luaK_concat(), luaK_patchclose(), need_value(), patchlistaux(), and removevalues().
|
static |
Definition at line 109 of file lua-5.2.4/src/lcode.c.
References Proto::code, FuncState::f, GET_OPCODE, and testTMode.
Referenced by invertjump(), need_value(), and patchtestreg().
Definition at line 598 of file lua-5.2.4/src/lcode.c.
References GET_OPCODE, GETARG_A, getjumpcontrol(), expdesc::info, lua_assert, OP_TEST, OP_TESTSET, SETARG_A, testTMode, and expdesc::u.
Referenced by codenot(), and luaK_goiftrue().
|
static |
Definition at line 32 of file lua-5.2.4/src/lcode.c.
References expdesc::f, expdesc::k, NO_JUMP, expdesc::t, and VKNUM.
Referenced by constfolding(), luaK_infix(), and luaK_prefix().
Definition at line 606 of file lua-5.2.4/src/lcode.c.
References cond(), condjump(), discharge2anyreg(), freeexp(), GET_OPCODE, GETARG_B, getcode, expdesc::info, expdesc::k, NO_REG, OP_NOT, OP_TEST, OP_TESTSET, FuncState::pc, expdesc::u, and VRELOCABLE.
Referenced by luaK_goiffalse(), and luaK_goiftrue().
void luaK_checkstack | ( | FuncState * | fs, |
int | n ) |
Definition at line 261 of file lua-5.2.4/src/lcode.c.
References cast_byte, FuncState::f, FuncState::freereg, FuncState::ls, luaX_syntaxerror(), MAXSTACK, and Proto::maxstacksize.
Referenced by luaK_reserveregs().
|
static |
Definition at line 212 of file lua-5.2.4/src/lcode.c.
References Proto::code, dischargejpc(), FuncState::f, LexState::L, LexState::lastline, Proto::lineinfo, FuncState::ls, luaM_growvector, MAX_INT, FuncState::pc, Proto::sizecode, and Proto::sizelineinfo.
Referenced by codeextraarg(), luaK_codeABC(), and luaK_codeABx().
Definition at line 227 of file lua-5.2.4/src/lcode.c.
References CREATE_ABC, getBMode, getCMode, getOpMode, iABC, lua_assert, luaK_code(), MAXARG_A, MAXARG_B, MAXARG_C, and OpArgN.
Definition at line 236 of file lua-5.2.4/src/lcode.c.
References CREATE_ABx, getCMode, getOpMode, iABx, iAsBx, lua_assert, luaK_code(), MAXARG_A, MAXARG_Bx, and OpArgN.
Referenced by luaK_codek().
int luaK_codek | ( | FuncState * | fs, |
int | reg, | ||
int | k ) |
Definition at line 250 of file lua-5.2.4/src/lcode.c.
References codeextraarg(), luaK_codeABx(), MAXARG_Bx, OP_LOADK, and OP_LOADKX.
Referenced by discharge2reg(), fornum(), and fornum().
void luaK_concat | ( | FuncState * | fs, |
int * | l1, | ||
int | l2 ) |
Definition at line 198 of file lua-5.2.4/src/lcode.c.
References fixjump(), getjump(), next, and NO_JUMP.
Referenced by exp2reg(), luaK_goiffalse(), luaK_goiftrue(), luaK_jump(), luaK_patchtohere(), and luaK_posfix().
Definition at line 383 of file lua-5.2.4/src/lcode.c.
References freereg(), expdesc::idx, expdesc::ind, expdesc::info, expdesc::k, luaK_codeABC, luaK_setoneret(), OP_GETTABLE, OP_GETTABUP, OP_GETUPVAL, expdesc::t, expdesc::u, VCALL, VINDEXED, VLOCAL, VNONRELOC, VRELOCABLE, expdesc::vt, VUPVAL, and VVARARG.
Referenced by codenot(), discharge2reg(), luaK_exp2anyreg(), luaK_exp2nextreg(), luaK_exp2val(), luaK_goiffalse(), luaK_goiftrue(), and luaK_posfix().
Definition at line 500 of file lua-5.2.4/src/lcode.c.
References exp2reg(), hasjumps, expdesc::info, expdesc::k, luaK_dischargevars(), luaK_exp2nextreg(), FuncState::nactvar, expdesc::u, and VNONRELOC.
Referenced by luaK_exp2anyregup(), luaK_exp2RK(), luaK_exp2val(), luaK_prefix(), luaK_self(), and luaK_storevar().
Definition at line 514 of file lua-5.2.4/src/lcode.c.
References hasjumps, expdesc::k, luaK_exp2anyreg(), and VUPVAL.
Referenced by fieldsel(), fieldsel(), fieldsel(), suffixedexp(), suffixedexp(), and suffixedexp().
Definition at line 492 of file lua-5.2.4/src/lcode.c.
References exp2reg(), freeexp(), FuncState::freereg, luaK_dischargevars(), and luaK_reserveregs().
Referenced by luaK_exp2anyreg(), luaK_infix(), and luaK_posfix().
Definition at line 528 of file lua-5.2.4/src/lcode.c.
References boolK(), expdesc::info, expdesc::k, luaK_exp2anyreg(), luaK_exp2val(), luaK_numberK(), MAXINDEXRK, nilK(), FuncState::nk, expdesc::nval, RKASK, expdesc::u, VFALSE, VK, VKNUM, VNIL, and VTRUE.
Referenced by codearith(), codecomp(), luaK_indexed(), luaK_infix(), luaK_self(), and luaK_storevar().
Definition at line 520 of file lua-5.2.4/src/lcode.c.
References hasjumps, luaK_dischargevars(), and luaK_exp2anyreg().
Referenced by luaK_exp2RK(), and luaK_posfix().
void luaK_fixline | ( | FuncState * | fs, |
int | line ) |
Definition at line 862 of file lua-5.2.4/src/lcode.c.
References FuncState::f, Proto::lineinfo, and FuncState::pc.
Referenced by codearith().
int luaK_getlabel | ( | FuncState * | fs | ) |
Definition at line 94 of file lua-5.2.4/src/lcode.c.
References FuncState::lasttarget, and FuncState::pc.
Referenced by code_label(), exp2reg(), and luaK_patchtohere().
Definition at line 645 of file lua-5.2.4/src/lcode.c.
References expdesc::f, expdesc::info, jumponcond(), expdesc::k, luaK_concat(), luaK_dischargevars(), luaK_patchtohere(), NO_JUMP, expdesc::t, expdesc::u, VFALSE, VJMP, and VNIL.
Referenced by luaK_infix().
Definition at line 621 of file lua-5.2.4/src/lcode.c.
References expdesc::f, expdesc::info, invertjump(), jumponcond(), expdesc::k, luaK_concat(), luaK_dischargevars(), luaK_patchtohere(), NO_JUMP, expdesc::t, expdesc::u, VJMP, VK, VKNUM, and VTRUE.
Referenced by luaK_infix().
Definition at line 703 of file lua-5.2.4/src/lcode.c.
References check_exp, hasjumps, expdesc::idx, expdesc::ind, expdesc::info, expdesc::k, lua_assert, luaK_exp2RK(), expdesc::t, expdesc::u, VINDEXED, vkisinreg, VLOCAL, expdesc::vt, and VUPVAL.
Definition at line 786 of file lua-5.2.4/src/lcode.c.
References isnumeral(), luaK_exp2nextreg(), luaK_exp2RK(), luaK_goiffalse(), luaK_goiftrue(), OPR_ADD, OPR_AND, OPR_CONCAT, OPR_DIV, OPR_MOD, OPR_MUL, OPR_OR, OPR_POW, and OPR_SUB.
int luaK_jump | ( | FuncState * | fs | ) |
Definition at line 59 of file lua-5.2.4/src/lcode.c.
References FuncState::jpc, luaK_codeAsBx, luaK_concat(), NO_JUMP, and OP_JMP.
Referenced by condjump(), and exp2reg().
void luaK_nil | ( | FuncState * | fs, |
int | from, | ||
int | n ) |
Definition at line 37 of file lua-5.2.4/src/lcode.c.
References Proto::code, FuncState::f, GET_OPCODE, GETARG_A, GETARG_B, FuncState::lasttarget, luaK_codeABC, OP_LOADNIL, FuncState::pc, SETARG_A, and SETARG_B.
Referenced by discharge2reg().
int luaK_numberK | ( | FuncState * | fs, |
lua_Number | r ) |
Definition at line 326 of file lua-5.2.4/src/lcode.c.
References addk(), LexState::L, FuncState::ls, luai_numisnan, luaS_newlstr(), NULL, setnvalue, setsvalue, and lua_State::top.
Referenced by discharge2reg(), and luaK_exp2RK().
Definition at line 179 of file lua-5.2.4/src/lcode.c.
References Proto::code, FuncState::f, GET_OPCODE, GETARG_A, getjump(), lua_assert, next, NO_JUMP, OP_JMP, and SETARG_A.
Referenced by findlabel(), findlabel(), leaveblock(), leaveblock(), movegotosout(), movegotosout(), repeatstat(), and repeatstat().
void luaK_patchlist | ( | FuncState * | fs, |
int | list, | ||
int | target ) |
Definition at line 169 of file lua-5.2.4/src/lcode.c.
References lua_assert, luaK_patchtohere(), NO_REG, patchlistaux(), and FuncState::pc.
void luaK_patchtohere | ( | FuncState * | fs, |
int | list ) |
Definition at line 192 of file lua-5.2.4/src/lcode.c.
References FuncState::jpc, luaK_concat(), and luaK_getlabel().
Referenced by exp2reg(), luaK_goiffalse(), luaK_goiftrue(), and luaK_patchlist().
Definition at line 813 of file lua-5.2.4/src/lcode.c.
References cast, codearith(), codecomp(), expdesc::f, freeexp(), GET_OPCODE, GETARG_B, getcode, expdesc::info, expdesc::k, lua_assert, luaK_concat(), luaK_dischargevars(), luaK_exp2nextreg(), luaK_exp2val(), NO_JUMP, OP_ADD, OP_CONCAT, OP_EQ, OPR_ADD, OPR_AND, OPR_CONCAT, OPR_DIV, OPR_EQ, OPR_GE, OPR_GT, OPR_LE, OPR_LT, OPR_MOD, OPR_MUL, OPR_NE, OPR_OR, OPR_POW, OPR_SUB, SETARG_B, expdesc::t, expdesc::u, and VRELOCABLE.
Definition at line 762 of file lua-5.2.4/src/lcode.c.
References codearith(), codenot(), expdesc::f, isnumeral(), expdesc::k, lua_assert, luai_numunm, luaK_exp2anyreg(), NO_JUMP, NULL, expdesc::nval, OP_LEN, OP_UNM, OPR_LEN, OPR_MINUS, OPR_NOT, expdesc::t, expdesc::u, and VKNUM.
void luaK_reserveregs | ( | FuncState * | fs, |
int | n ) |
Definition at line 271 of file lua-5.2.4/src/lcode.c.
References FuncState::freereg, and luaK_checkstack().
Referenced by discharge2anyreg(), luaK_exp2nextreg(), luaK_self(), and luaK_setreturns().
void luaK_ret | ( | FuncState * | fs, |
int | first, | ||
int | nret ) |
Definition at line 69 of file lua-5.2.4/src/lcode.c.
References luaK_codeABC, and OP_RETURN.
Definition at line 585 of file lua-5.2.4/src/lcode.c.
References freeexp(), FuncState::freereg, expdesc::info, expdesc::k, luaK_codeABC, luaK_exp2anyreg(), luaK_exp2RK(), luaK_reserveregs(), OP_SELF, expdesc::u, and VNONRELOC.
void luaK_setlist | ( | FuncState * | fs, |
int | base, | ||
int | nelems, | ||
int | tostore ) |
Definition at line 867 of file lua-5.2.4/src/lcode.c.
References codeextraarg(), FuncState::freereg, LFIELDS_PER_FLUSH, FuncState::ls, lua_assert, LUA_MULTRET, luaK_codeABC, luaX_syntaxerror(), MAXARG_Ax, MAXARG_C, and OP_SETLIST.
Definition at line 371 of file lua-5.2.4/src/lcode.c.
References GETARG_A, getcode, expdesc::info, expdesc::k, SETARG_B, expdesc::u, VCALL, VNONRELOC, VRELOCABLE, and VVARARG.
Referenced by luaK_dischargevars().
Definition at line 359 of file lua-5.2.4/src/lcode.c.
References FuncState::freereg, getcode, expdesc::k, luaK_reserveregs(), SETARG_A, SETARG_B, SETARG_C, VCALL, and VVARARG.
Definition at line 558 of file lua-5.2.4/src/lcode.c.
References exp2reg(), freeexp(), expdesc::idx, expdesc::ind, expdesc::info, expdesc::k, lua_assert, luaK_codeABC, luaK_exp2anyreg(), luaK_exp2RK(), OP_SETTABLE, OP_SETTABUP, OP_SETUPVAL, expdesc::t, expdesc::u, VINDEXED, VLOCAL, expdesc::vt, and VUPVAL.
Definition at line 319 of file lua-5.2.4/src/lcode.c.
References addk(), LexState::L, FuncState::ls, s, and setsvalue.
|
static |
Definition at line 122 of file lua-5.2.4/src/lcode.c.
References GET_OPCODE, getjump(), getjumpcontrol(), NO_JUMP, and OP_TESTSET.
Referenced by exp2reg().
|
static |
Definition at line 350 of file lua-5.2.4/src/lcode.c.
References addk(), FuncState::h, LexState::L, FuncState::ls, sethvalue, and setnilvalue.
Referenced by luaK_exp2RK().
|
static |
Definition at line 150 of file lua-5.2.4/src/lcode.c.
References fixjump(), getjump(), next, NO_JUMP, and patchtestreg().
Referenced by dischargejpc(), exp2reg(), and luaK_patchlist().
|
static |
Definition at line 131 of file lua-5.2.4/src/lcode.c.
References CREATE_ABC, GET_OPCODE, GETARG_B, GETARG_C, getjumpcontrol(), NO_REG, OP_TEST, OP_TESTSET, and SETARG_A.
Referenced by patchlistaux(), and removevalues().
|
static |
Definition at line 144 of file lua-5.2.4/src/lcode.c.
References getjump(), NO_JUMP, NO_REG, and patchtestreg().
Referenced by codenot().