Interpreter needs to be able to distinguish parameters
SourceValue currently does not remember whether it came from a paramter, but
I'd like to write code that does something different for parameters.
This requires a change in the Analyzer class so that the interpreter gets the
contextual information that the analyzer is trying to create a value for the
parameter value.
This is the current code:
if ((m.access & ACC_STATIC) == 0) {
Type ctype = Type.getObjectType(owner);
current.setLocal(local++, interpreter.newValue(ctype));
}
for (int i = 0; i < args.length; ++i) {
current.setLocal(local++, interpreter.newValue(args[i]));
if (args[i].getSize() == 2) {
current.setLocal(local++, interpreter.newValue(null));
}
}
Possible change:
if ((m.access & ACC_STATIC) == 0) {
Type ctype = Type.getObjectType(owner);
current.setLocal(local++, interpreter.newThisValue(ctype));
}
for (int i = 0; i < args.length; ++i) {
current.setLocal(local++,
interpreter.newParameterValue(i,args[i]));
if (args[i].getSize() == 2) {
current.setLocal(local++, interpreter.newValue(null));
}
}