#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) |
Definition at line 28 of file lcode.cpp.
Referenced by exp2reg(), luaK_exp2anyreg(), luaK_exp2anyregup(), luaK_exp2val(), and luaK_indexed().
Definition at line 290 of file lcode.cpp.
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().
Definition at line 342 of file lcode.cpp.
References addk(), and setbvalue.
Referenced by luaK_exp2RK().
Definition at line 414 of file lcode.cpp.
References luaK_codeABC(), luaK_getlabel(), and OP_LOADBOOL.
Referenced by exp2reg().
Definition at line 723 of file lcode.cpp.
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 745 of file lcode.cpp.
References condjump(), freeexp(), expdesc::info, expdesc::k, luaK_exp2RK(), OP_EQ, expdesc::u, and VJMP.
Referenced by luaK_posfix().
Definition at line 243 of file lcode.cpp.
References CREATE_Ax, lua_assert, luaK_code(), MAXARG_Ax, and OP_EXTRAARG.
Referenced by luaK_codek(), and luaK_setlist().
Definition at line 667 of file lcode.cpp.
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 73 of file lcode.cpp.
References luaK_codeABC(), and luaK_jump().
Referenced by codecomp(), and jumponcond().
Definition at line 712 of file lcode.cpp.
References isnumeral(), LUA_OPADD, luaO_arith(), expdesc::nval, OP_ADD, OP_DIV, OP_MOD, and expdesc::u.
Referenced by codearith().
Definition at line 459 of file lcode.cpp.
References discharge2reg(), FuncState::freereg, expdesc::k, luaK_reserveregs(), and VNONRELOC.
Referenced by codenot(), and jumponcond().
Definition at line 420 of file lcode.cpp.
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().
Definition at line 162 of file lcode.cpp.
References FuncState::jpc, NO_JUMP, NO_REG, patchlistaux(), and FuncState::pc.
Referenced by luaK_code().
Definition at line 467 of file lcode.cpp.
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().
Definition at line 79 of file lcode.cpp.
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 284 of file lcode.cpp.
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().
Definition at line 276 of file lcode.cpp.
References FuncState::freereg, ISK, lua_assert, and FuncState::nactvar.
Referenced by freeexp(), and luaK_dischargevars().
Definition at line 99 of file lcode.cpp.
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 108 of file lcode.cpp.
References Proto::code, FuncState::f, GET_OPCODE, and testTMode.
Referenced by invertjump(), need_value(), and patchtestreg().
Definition at line 597 of file lcode.cpp.
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().
Definition at line 31 of file lcode.cpp.
References expdesc::f, expdesc::k, NO_JUMP, expdesc::t, and VKNUM.
Referenced by constfolding(), luaK_infix(), and luaK_prefix().
Definition at line 605 of file lcode.cpp.
References 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().
Definition at line 260 of file lcode.cpp.
References cast_byte, FuncState::f, FuncState::freereg, FuncState::ls, luaX_syntaxerror(), MAXSTACK, and Proto::maxstacksize.
Referenced by forlist(), and luaK_reserveregs().
|
static |
Definition at line 211 of file lcode.cpp.
References Proto::code, dischargejpc(), FuncState::f, i, 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 226 of file lcode.cpp.
References CREATE_ABC, getBMode, getCMode, getOpMode, iABC, lua_assert, luaK_code(), MAXARG_A, MAXARG_B, MAXARG_C, and OpArgN.
Referenced by check_conflict(), code_label(), codearith(), codenot(), condjump(), constructor(), discharge2reg(), forbody(), funcargs(), luaK_dischargevars(), luaK_nil(), luaK_ret(), luaK_self(), luaK_setlist(), luaK_storevar(), recfield(), and simpleexp().
Definition at line 235 of file lcode.cpp.
References CREATE_ABx, getCMode, getOpMode, iABx, iAsBx, lua_assert, luaK_code(), MAXARG_A, MAXARG_Bx, and OpArgN.
Referenced by codeclosure(), and luaK_codek().
Definition at line 249 of file lcode.cpp.
References codeextraarg(), luaK_codeABx(), MAXARG_Bx, OP_LOADK, and OP_LOADKX.
Referenced by discharge2reg(), and fornum().
Definition at line 197 of file lcode.cpp.
References fixjump(), getjump(), next, and NO_JUMP.
Referenced by exp2reg(), luaK_goiffalse(), luaK_goiftrue(), luaK_jump(), luaK_patchtohere(), luaK_posfix(), and test_then_block().
Definition at line 382 of file lcode.cpp.
References freereg(), expdesc::ind, expdesc::info, expdesc::k, luaK_codeABC(), luaK_setoneret(), OP_GETTABLE, OP_GETTABUP, OP_GETUPVAL, expdesc::u, VCALL, VINDEXED, VLOCAL, VNONRELOC, VRELOCABLE, VUPVAL, and VVARARG.
Referenced by codenot(), discharge2reg(), luaK_exp2anyreg(), luaK_exp2nextreg(), luaK_exp2val(), luaK_goiffalse(), luaK_goiftrue(), luaK_posfix(), and primaryexp().
Definition at line 499 of file lcode.cpp.
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(), luaK_storevar(), and retstat().
Definition at line 513 of file lcode.cpp.
References hasjumps, expdesc::k, luaK_exp2anyreg(), and VUPVAL.
Referenced by fieldsel(), and suffixedexp().
Definition at line 491 of file lcode.cpp.
References exp2reg(), freeexp(), FuncState::freereg, luaK_dischargevars(), and luaK_reserveregs().
Referenced by adjust_assign(), closelistfield(), codeclosure(), constructor(), exp1(), explist(), funcargs(), lastlistfield(), luaK_exp2anyreg(), luaK_infix(), luaK_posfix(), retstat(), and suffixedexp().
Definition at line 527 of file lcode.cpp.
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(), luaK_storevar(), and recfield().
Definition at line 519 of file lcode.cpp.
References hasjumps, luaK_dischargevars(), and luaK_exp2anyreg().
Referenced by luaK_exp2RK(), luaK_posfix(), and yindex().
Definition at line 861 of file lcode.cpp.
References FuncState::f, Proto::lineinfo, and FuncState::pc.
Referenced by codearith(), forbody(), funcargs(), and funcstat().
Definition at line 93 of file lcode.cpp.
References FuncState::lasttarget, and FuncState::pc.
Referenced by code_label(), exp2reg(), luaK_patchtohere(), repeatstat(), and whilestat().
Definition at line 644 of file lcode.cpp.
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(), and test_then_block().
Definition at line 620 of file lcode.cpp.
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 cond(), luaK_infix(), and test_then_block().
Definition at line 702 of file lcode.cpp.
References check_exp, hasjumps, expdesc::ind, expdesc::info, expdesc::k, lua_assert, luaK_exp2RK(), expdesc::u, VINDEXED, vkisinreg, VLOCAL, and VUPVAL.
Referenced by fieldsel(), singlevar(), and suffixedexp().
Definition at line 785 of file lcode.cpp.
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.
Referenced by subexpr().
Definition at line 58 of file lcode.cpp.
References FuncState::jpc, luaK_codeAsBx, luaK_concat(), NO_JUMP, and OP_JMP.
Referenced by condjump(), exp2reg(), forbody(), leaveblock(), statement(), and test_then_block().
Definition at line 36 of file lcode.cpp.
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 adjust_assign(), and discharge2reg().
int luaK_numberK | ( | FuncState * | fs, |
lua_Number | r | ||
) |
Definition at line 325 of file lcode.cpp.
References addk(), LexState::L, FuncState::ls, luaS_newlstr(), setnvalue, setsvalue, and lua_State::top.
Referenced by discharge2reg(), fornum(), and luaK_exp2RK().
Definition at line 178 of file lcode.cpp.
References Proto::code, FuncState::f, GET_OPCODE, GETARG_A, getjump(), lua_assert, next, NO_JUMP, OP_JMP, and SETARG_A.
Referenced by findlabel(), leaveblock(), movegotosout(), and repeatstat().
Definition at line 168 of file lcode.cpp.
References lua_assert, luaK_patchtohere(), NO_REG, patchlistaux(), and FuncState::pc.
Referenced by closegoto(), forbody(), and repeatstat().
Definition at line 191 of file lcode.cpp.
References FuncState::jpc, luaK_concat(), and luaK_getlabel().
Referenced by exp2reg(), forbody(), ifstat(), leaveblock(), luaK_goiffalse(), luaK_goiftrue(), luaK_patchlist(), test_then_block(), and whilestat().
Definition at line 812 of file lcode.cpp.
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.
Referenced by subexpr().
Definition at line 761 of file lcode.cpp.
References codearith(), codenot(), expdesc::f, isnumeral(), expdesc::k, lua_assert, luaK_exp2anyreg(), NO_JUMP, expdesc::nval, OP_LEN, OP_UNM, OPR_LEN, OPR_MINUS, OPR_NOT, expdesc::t, expdesc::u, and VKNUM.
Referenced by subexpr().
Definition at line 270 of file lcode.cpp.
References FuncState::freereg, and luaK_checkstack().
Referenced by adjust_assign(), check_conflict(), discharge2anyreg(), forbody(), fornum(), luaK_exp2nextreg(), luaK_self(), luaK_setreturns(), and parlist().
Definition at line 68 of file lcode.cpp.
References luaK_codeABC(), and OP_RETURN.
Referenced by close_func(), and retstat().
Definition at line 584 of file lcode.cpp.
References freeexp(), FuncState::freereg, expdesc::info, expdesc::k, luaK_codeABC(), luaK_exp2anyreg(), luaK_exp2RK(), luaK_reserveregs(), OP_SELF, expdesc::u, and VNONRELOC.
Referenced by suffixedexp().
Definition at line 866 of file lcode.cpp.
References codeextraarg(), FuncState::freereg, LFIELDS_PER_FLUSH, FuncState::ls, lua_assert, LUA_MULTRET, luaK_codeABC(), luaX_syntaxerror(), MAXARG_Ax, MAXARG_C, and OP_SETLIST.
Referenced by closelistfield(), and lastlistfield().
Definition at line 370 of file lcode.cpp.
References GETARG_A, getcode, expdesc::info, expdesc::k, SETARG_B, expdesc::u, VCALL, VNONRELOC, VRELOCABLE, and VVARARG.
Referenced by assignment(), and luaK_dischargevars().
Definition at line 358 of file lcode.cpp.
References FuncState::freereg, getcode, expdesc::k, luaK_reserveregs(), SETARG_A, SETARG_B, SETARG_C, VCALL, and VVARARG.
Referenced by adjust_assign().
Definition at line 557 of file lcode.cpp.
References e, exp2reg(), freeexp(), expdesc::ind, expdesc::info, expdesc::k, lua_assert, luaK_codeABC(), luaK_exp2anyreg(), luaK_exp2RK(), OP_SETTABLE, OP_SETTABUP, OP_SETUPVAL, expdesc::u, VINDEXED, VLOCAL, and VUPVAL.
Referenced by assignment(), and funcstat().
Definition at line 318 of file lcode.cpp.
References addk(), LexState::L, FuncState::ls, and setsvalue.
Referenced by codestring().
Definition at line 121 of file lcode.cpp.
References GET_OPCODE, getjump(), getjumpcontrol(), i, NO_JUMP, and OP_TESTSET.
Referenced by exp2reg().
Definition at line 349 of file lcode.cpp.
References addk(), FuncState::h, LexState::L, FuncState::ls, sethvalue, and setnilvalue.
Referenced by luaK_exp2RK().
Definition at line 149 of file lcode.cpp.
References fixjump(), getjump(), next, NO_JUMP, and patchtestreg().
Referenced by dischargejpc(), exp2reg(), and luaK_patchlist().
Definition at line 130 of file lcode.cpp.
References CREATE_ABC, GET_OPCODE, GETARG_B, GETARG_C, getjumpcontrol(), i, NO_REG, OP_TEST, OP_TESTSET, and SETARG_A.
Referenced by patchlistaux(), and removevalues().