Skip to content

Commit e001d5a

Browse files
committed
'VRELOCABLE' -> 'VRELOC'
1 parent e752d84 commit e001d5a

3 files changed

Lines changed: 22 additions & 22 deletions

File tree

lcode.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
** $Id: lcode.c,v 2.142 2017/12/04 17:41:30 roberto Exp roberto $
2+
** $Id: lcode.c,v 2.143 2017/12/13 18:32:09 roberto Exp roberto $
33
** Code generator for Lua
44
** See Copyright Notice in lua.h
55
*/
@@ -632,7 +632,7 @@ void luaK_setreturns (FuncState *fs, expdesc *e, int nresults) {
632632
** vararg), it already returns one result, so nothing needs to be done.
633633
** Function calls become VNONRELOC expressions (as its result comes
634634
** fixed in the base register of the call), while vararg expressions
635-
** become VRELOCABLE (as OP_VARARG puts its results where it wants).
635+
** become VRELOC (as OP_VARARG puts its results where it wants).
636636
** (Calls are created returning one result, so that does not need
637637
** to be fixed.)
638638
*/
@@ -645,7 +645,7 @@ void luaK_setoneret (FuncState *fs, expdesc *e) {
645645
}
646646
else if (e->k == VVARARG) {
647647
SETARG_B(getinstruction(fs, e), 2);
648-
e->k = VRELOCABLE; /* can relocate its simple result */
648+
e->k = VRELOC; /* can relocate its simple result */
649649
}
650650
}
651651

@@ -661,30 +661,30 @@ void luaK_dischargevars (FuncState *fs, expdesc *e) {
661661
}
662662
case VUPVAL: { /* move value to some (pending) register */
663663
e->u.info = luaK_codeABC(fs, OP_GETUPVAL, 0, e->u.info, 0);
664-
e->k = VRELOCABLE;
664+
e->k = VRELOC;
665665
break;
666666
}
667667
case VINDEXUP: {
668668
e->u.info = luaK_codeABC(fs, OP_GETTABUP, 0, e->u.ind.t, e->u.ind.idx);
669-
e->k = VRELOCABLE;
669+
e->k = VRELOC;
670670
break;
671671
}
672672
case VINDEXI: {
673673
freereg(fs, e->u.ind.t);
674674
e->u.info = luaK_codeABC(fs, OP_GETI, 0, e->u.ind.t, e->u.ind.idx);
675-
e->k = VRELOCABLE;
675+
e->k = VRELOC;
676676
break;
677677
}
678678
case VINDEXSTR: {
679679
freereg(fs, e->u.ind.t);
680680
e->u.info = luaK_codeABC(fs, OP_GETFIELD, 0, e->u.ind.t, e->u.ind.idx);
681-
e->k = VRELOCABLE;
681+
e->k = VRELOC;
682682
break;
683683
}
684684
case VINDEXED: {
685685
freeregs(fs, e->u.ind.t, e->u.ind.idx);
686686
e->u.info = luaK_codeABC(fs, OP_GETTABLE, 0, e->u.ind.t, e->u.ind.idx);
687-
e->k = VRELOCABLE;
687+
e->k = VRELOC;
688688
break;
689689
}
690690
case VVARARG: case VCALL: {
@@ -723,7 +723,7 @@ static void discharge2reg (FuncState *fs, expdesc *e, int reg) {
723723
luaK_int(fs, reg, e->u.ival);
724724
break;
725725
}
726-
case VRELOCABLE: {
726+
case VRELOC: {
727727
Instruction *pc = &getinstruction(fs, e);
728728
SETARG_A(*pc, reg); /* instruction will put result in 'reg' */
729729
break;
@@ -963,7 +963,7 @@ static void negatecondition (FuncState *fs, expdesc *e) {
963963
** and removing the 'not'.
964964
*/
965965
static int jumponcond (FuncState *fs, expdesc *e, int cond) {
966-
if (e->k == VRELOCABLE) {
966+
if (e->k == VRELOC) {
967967
Instruction ie = getinstruction(fs, e);
968968
if (GET_OPCODE(ie) == OP_NOT) {
969969
fs->pc--; /* remove previous OP_NOT */
@@ -1048,12 +1048,12 @@ static void codenot (FuncState *fs, expdesc *e) {
10481048
negatecondition(fs, e);
10491049
break;
10501050
}
1051-
case VRELOCABLE:
1051+
case VRELOC:
10521052
case VNONRELOC: {
10531053
discharge2anyreg(fs, e);
10541054
freeexp(fs, e);
10551055
e->u.info = luaK_codeABC(fs, OP_NOT, 0, e->u.info, 0);
1056-
e->k = VRELOCABLE;
1056+
e->k = VRELOC;
10571057
break;
10581058
}
10591059
default: lua_assert(0); /* cannot happen */
@@ -1191,7 +1191,7 @@ static void codeunexpval (FuncState *fs, OpCode op, expdesc *e, int line) {
11911191
int r = luaK_exp2anyreg(fs, e); /* opcodes operate only on registers */
11921192
freeexp(fs, e);
11931193
e->u.info = luaK_codeABC(fs, op, 0, r, 0); /* generate opcode */
1194-
e->k = VRELOCABLE; /* all those operations are relocatable */
1194+
e->k = VRELOC; /* all those operations are relocatable */
11951195
luaK_fixline(fs, line);
11961196
}
11971197

@@ -1200,7 +1200,7 @@ static void finishbinexpval (FuncState *fs, expdesc *e1, expdesc *e2,
12001200
int pc, int line) {
12011201
freeexps(fs, e1, e2);
12021202
e1->u.info = pc;
1203-
e1->k = VRELOCABLE; /* all those operations are relocatable */
1203+
e1->k = VRELOC; /* all those operations are relocatable */
12041204
luaK_fixline(fs, line);
12051205
}
12061206

@@ -1474,12 +1474,12 @@ void luaK_posfix (FuncState *fs, BinOpr opr,
14741474
}
14751475
case OPR_CONCAT: {
14761476
luaK_exp2val(fs, e2);
1477-
if (e2->k == VRELOCABLE &&
1477+
if (e2->k == VRELOC &&
14781478
GET_OPCODE(getinstruction(fs, e2)) == OP_CONCAT) {
14791479
lua_assert(e1->u.info == GETARG_B(getinstruction(fs, e2))-1);
14801480
freeexp(fs, e1);
14811481
SETARG_B(getinstruction(fs, e2), e1->u.info);
1482-
e1->k = VRELOCABLE; e1->u.info = e2->u.info;
1482+
e1->k = VRELOC; e1->u.info = e2->u.info;
14831483
}
14841484
else {
14851485
luaK_exp2nextreg(fs, e2); /* operand must be on the 'stack' */

lparser.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
** $Id: lparser.c,v 2.169 2017/11/30 13:29:18 roberto Exp roberto $
2+
** $Id: lparser.c,v 2.170 2017/12/06 18:36:31 roberto Exp roberto $
33
** Lua Parser
44
** See Copyright Notice in lua.h
55
*/
@@ -533,7 +533,7 @@ static Proto *addprototype (LexState *ls) {
533533
*/
534534
static void codeclosure (LexState *ls, expdesc *v) {
535535
FuncState *fs = ls->fs->prev;
536-
init_exp(v, VRELOCABLE, luaK_codeABx(fs, OP_CLOSURE, 0, fs->np - 1));
536+
init_exp(v, VRELOC, luaK_codeABx(fs, OP_CLOSURE, 0, fs->np - 1));
537537
luaK_exp2nextreg(fs, v); /* fix it at the last register */
538538
}
539539

@@ -740,7 +740,7 @@ static void constructor (LexState *ls, expdesc *t) {
740740
struct ConsControl cc;
741741
cc.na = cc.nh = cc.tostore = 0;
742742
cc.t = t;
743-
init_exp(t, VRELOCABLE, pc);
743+
init_exp(t, VRELOC, pc);
744744
init_exp(&cc.v, VVOID, 0); /* no value (yet) */
745745
luaK_exp2nextreg(ls->fs, t); /* fix it at stack top */
746746
checknext(ls, '{');

lparser.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
** $Id: lparser.h,v 1.78 2017/06/27 11:35:31 roberto Exp roberto $
2+
** $Id: lparser.h,v 1.79 2017/11/30 13:29:18 roberto Exp roberto $
33
** Lua Parser
44
** See Copyright Notice in lua.h
55
*/
@@ -49,8 +49,8 @@ typedef enum {
4949
ind.idx = key's K index */
5050
VJMP, /* expression is a test/comparison;
5151
info = pc of corresponding jump instruction */
52-
VRELOCABLE, /* expression can put result in any register;
53-
info = instruction pc */
52+
VRELOC, /* expression can put result in any register;
53+
info = instruction pc */
5454
VCALL, /* expression is a function call; info = instruction pc */
5555
VVARARG /* vararg expression; info = instruction pc */
5656
} expkind;

0 commit comments

Comments
 (0)