* commit '02dff422a7734764e3ce00179f62ba115f2081a5': Fix value size data type in closure creation.
This commit is contained in:
@@ -58,6 +58,7 @@ public class ScriptGroup2 extends BaseObj {
|
||||
*/
|
||||
|
||||
public static class Closure extends BaseObj {
|
||||
private Object[] mArgs;
|
||||
private Allocation mReturnValue;
|
||||
private Map<Script.FieldID, Object> mBindings;
|
||||
|
||||
@@ -76,8 +77,9 @@ public class ScriptGroup2 extends BaseObj {
|
||||
Object[] args, Map<Script.FieldID, Object> globals) {
|
||||
super(0, rs);
|
||||
|
||||
mArgs = args;
|
||||
mReturnValue = Allocation.createTyped(rs, returnType);
|
||||
mBindings = new HashMap<Script.FieldID, Object>();
|
||||
mBindings = globals;
|
||||
mGlobalFuture = new HashMap<Script.FieldID, Future>();
|
||||
|
||||
int numValues = args.length + globals.size();
|
||||
@@ -126,7 +128,8 @@ public class ScriptGroup2 extends BaseObj {
|
||||
super(0, rs);
|
||||
mFP = FieldPacker.createFieldPack(args);
|
||||
|
||||
mBindings = new HashMap<Script.FieldID, Object>();
|
||||
mArgs = args;
|
||||
mBindings = globals;
|
||||
mGlobalFuture = new HashMap<Script.FieldID, Future>();
|
||||
|
||||
int numValues = globals.size();
|
||||
@@ -224,11 +227,13 @@ public class ScriptGroup2 extends BaseObj {
|
||||
}
|
||||
|
||||
void setArg(int index, Object obj) {
|
||||
mArgs[index] = obj;
|
||||
ValueAndSize vs = new ValueAndSize(mRS, obj);
|
||||
mRS.nClosureSetArg(getID(mRS), index, vs.value, vs.size);
|
||||
}
|
||||
|
||||
void setGlobal(Script.FieldID fieldID, Object obj) {
|
||||
mBindings.put(fieldID, obj);
|
||||
ValueAndSize vs = new ValueAndSize(mRS, obj);
|
||||
mRS.nClosureSetGlobal(getID(mRS), fieldID.getID(mRS), vs.value, vs.size);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user