本文整理汇总了Java中org.luaj.vm2.Lua.OP_MOVE属性的典型用法代码示例。如果您正苦于以下问题:Java Lua.OP_MOVE属性的具体用法?Java Lua.OP_MOVE怎么用?Java Lua.OP_MOVE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.luaj.vm2.Lua
的用法示例。
在下文中一共展示了Lua.OP_MOVE属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: check_conflict
void check_conflict (LHS_assign lh, expdesc v) {
FuncState fs = this.fs;
short extra = (short) fs.freereg; /* eventual position to save local variable */
boolean conflict = false;
for (; lh!=null; lh = lh.prev) {
if (lh.v.k == VINDEXED) {
/* table is the upvalue/local being assigned now? */
if (lh.v.u.ind_vt == v.k && lh.v.u.ind_t == v.u.info) {
conflict = true;
lh.v.u.ind_vt = VLOCAL;
lh.v.u.ind_t = extra; /* previous assignment will use safe copy */
}
/* index is the local being assigned? (index cannot be upvalue) */
if (v.k == VLOCAL && lh.v.u.ind_idx == v.u.info) {
conflict = true;
lh.v.u.ind_idx = extra; /* previous assignment will use safe copy */
}
}
}
if (conflict) {
/* copy upvalue/local value to a temporary (in position 'extra') */
int op = (v.k == VLOCAL) ? Lua.OP_MOVE : Lua.OP_GETUPVAL;
fs.codeABC(op, extra, v.u.info, 0);
fs.reserveregs(1);
}
}
示例2: pushclosure
void pushclosure(FuncState func, expdesc v)
{
FuncState fs = _fs;
Prototype f = fs._f;
if(f.p == null || fs.np + 1 > f.p.length)
f.p = LuaC.realloc(f.p, fs.np * 2 + 1);
f.p[fs.np++] = func._f;
v.init(VRELOCABLE, fs.codeABx(Lua.OP_CLOSURE, 0, fs.np - 1));
for(int i = 0; i < func._f.nups; i++)
{
int o = (func.upvalues[i].k == VLOCAL) ? Lua.OP_MOVE
: Lua.OP_GETUPVAL;
fs.codeABC(o, 0, func.upvalues[i].info, 0);
}
}