Remove name passing into UpVal instances.
This commit is contained in:
@@ -848,7 +848,7 @@ public class LuaState extends Lua {
|
|||||||
if (o == LuaState.OP_GETUPVAL) {
|
if (o == LuaState.OP_GETUPVAL) {
|
||||||
newClosure.upVals[j] = cl.upVals[b];
|
newClosure.upVals[j] = cl.upVals[b];
|
||||||
} else if (o == LuaState.OP_MOVE) {
|
} else if (o == LuaState.OP_MOVE) {
|
||||||
newClosure.upVals[j] = findUpVal( proto.upvalues[j], base + b );
|
newClosure.upVals[j] = findUpVal( base + b );
|
||||||
} else {
|
} else {
|
||||||
throw new java.lang.IllegalArgumentException(
|
throw new java.lang.IllegalArgumentException(
|
||||||
"bad opcode: " + o);
|
"bad opcode: " + o);
|
||||||
@@ -879,7 +879,7 @@ public class LuaState extends Lua {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private UpVal findUpVal( LString upValName, int target ) {
|
private UpVal findUpVal( int target ) {
|
||||||
UpVal up;
|
UpVal up;
|
||||||
int i;
|
int i;
|
||||||
for ( i = this.upvals.size() - 1; i >= 0; --i ) {
|
for ( i = this.upvals.size() - 1; i >= 0; --i ) {
|
||||||
@@ -891,7 +891,7 @@ public class LuaState extends Lua {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
up = new UpVal( upValName, this, target );
|
up = new UpVal( this, target );
|
||||||
this.upvals.insertElementAt( up, i + 1 );
|
this.upvals.insertElementAt( up, i + 1 );
|
||||||
return up;
|
return up;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,19 +24,17 @@ package org.luaj.vm;
|
|||||||
|
|
||||||
public class UpVal {
|
public class UpVal {
|
||||||
|
|
||||||
private LString name;
|
|
||||||
LuaState state;
|
LuaState state;
|
||||||
int position;
|
int position;
|
||||||
LValue value;
|
LValue value;
|
||||||
|
|
||||||
public UpVal( LString string, LuaState state, int i ) {
|
public UpVal( LuaState state, int i ) {
|
||||||
this.name = string;
|
|
||||||
this.state = state;
|
this.state = state;
|
||||||
this.position = i;
|
this.position = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "up."+name;
|
return "up."+position;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LValue getValue() {
|
public LValue getValue() {
|
||||||
|
|||||||
Reference in New Issue
Block a user