Invokeinterface, among others
This commit is contained in:
@@ -18,7 +18,7 @@ public class Execution
|
||||
public void run(Method method, Object... args)
|
||||
{
|
||||
Path p = new Path(this);
|
||||
p.init(method, args);
|
||||
p.invoke(method, args);
|
||||
}
|
||||
|
||||
public void addPath(Path p)
|
||||
|
||||
@@ -24,4 +24,9 @@ public class FieldInstance
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(Object obj)
|
||||
{
|
||||
value = obj;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,14 +39,6 @@ public class Frame
|
||||
{
|
||||
return variables;
|
||||
}
|
||||
|
||||
public void init(Object[] args)
|
||||
{
|
||||
for (Object o : args)
|
||||
stack.push(o);
|
||||
|
||||
execute();
|
||||
}
|
||||
|
||||
public void execute()
|
||||
{
|
||||
|
||||
@@ -64,13 +64,6 @@ public class Path
|
||||
{
|
||||
return frames.peek();
|
||||
}
|
||||
|
||||
public void init(Method method, Object[] args)
|
||||
{
|
||||
Frame f = new Frame(this, method);
|
||||
frames.push(f);
|
||||
f.init(args);
|
||||
}
|
||||
|
||||
public Path dup()
|
||||
{
|
||||
@@ -78,4 +71,14 @@ public class Path
|
||||
execution.addPath(other);
|
||||
return other;
|
||||
}
|
||||
|
||||
public void invoke(Method method, Object[] args)
|
||||
{
|
||||
Frame f = new Frame(this, method);
|
||||
Variables vars = f.getVariables();
|
||||
for (int i = 0; i < args.length; ++i)
|
||||
vars.set(i, args[i]);
|
||||
frames.push(f);
|
||||
f.execute();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,13 +7,13 @@ public class StaticFieldInstance
|
||||
{
|
||||
private ClassInstance clazz;
|
||||
private Field field;
|
||||
private ConstantValue value;
|
||||
private Object value;
|
||||
|
||||
public StaticFieldInstance(ClassInstance clazz, Field field, ConstantValue value)
|
||||
{
|
||||
this.clazz = clazz;
|
||||
this.field = field;
|
||||
this.value = value;
|
||||
this.value = value.getValue().getObject();
|
||||
}
|
||||
|
||||
public Field getField()
|
||||
@@ -21,8 +21,13 @@ public class StaticFieldInstance
|
||||
return field;
|
||||
}
|
||||
|
||||
public ConstantValue getValue()
|
||||
public Object getValue()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setField(Object obj)
|
||||
{
|
||||
value = obj;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user