|
|
@ -25,17 +25,19 @@ public final class InvokeOperator extends Operator { |
|
|
|
boolean staticFlag; |
|
|
|
boolean staticFlag; |
|
|
|
boolean specialFlag; |
|
|
|
boolean specialFlag; |
|
|
|
MethodType methodType; |
|
|
|
MethodType methodType; |
|
|
|
|
|
|
|
String methodName; |
|
|
|
Type classType; |
|
|
|
Type classType; |
|
|
|
CpoolRef field; |
|
|
|
CpoolRef field; |
|
|
|
|
|
|
|
|
|
|
|
public InvokeOperator(CodeAnalyzer codeAnalyzer, |
|
|
|
public InvokeOperator(CodeAnalyzer codeAnalyzer, |
|
|
|
boolean staticFlag, boolean specialFlag, |
|
|
|
boolean staticFlag, boolean specialFlag, |
|
|
|
CpoolRef field) { |
|
|
|
CpoolRef field) { |
|
|
|
super(Type.tError, 0); |
|
|
|
super(Type.tUnknown, 0); |
|
|
|
methodType = new MethodType(field.getNameAndType(). |
|
|
|
methodType = new MethodType(field.getNameAndType(). |
|
|
|
getType().getString()); |
|
|
|
getType().getString()); |
|
|
|
|
|
|
|
methodName = field.getNameAndType().getName().getString(); |
|
|
|
classType = Type.tClass(field.getCpoolClass().getName().getString()); |
|
|
|
classType = Type.tClass(field.getCpoolClass().getName().getString()); |
|
|
|
setType(methodType.getReturnType()); |
|
|
|
this.type = methodType.getReturnType(); |
|
|
|
this.codeAnalyzer = codeAnalyzer; |
|
|
|
this.codeAnalyzer = codeAnalyzer; |
|
|
|
this.staticFlag = staticFlag; |
|
|
|
this.staticFlag = staticFlag; |
|
|
|
this.specialFlag = specialFlag; |
|
|
|
this.specialFlag = specialFlag; |
|
|
@ -56,6 +58,10 @@ public final class InvokeOperator extends Operator { |
|
|
|
return methodType; |
|
|
|
return methodType; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String getMethodName() { |
|
|
|
|
|
|
|
return methodName; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Type getClassType() { |
|
|
|
public Type getClassType() { |
|
|
|
return classType; |
|
|
|
return classType; |
|
|
|
} |
|
|
|
} |
|
|
@ -87,7 +93,7 @@ public final class InvokeOperator extends Operator { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean isConstructor() { |
|
|
|
public boolean isConstructor() { |
|
|
|
return field.getNameAndType().getName().getString().equals("<init>"); |
|
|
|
return methodName.equals("<init>"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String toString(String[] operands) { |
|
|
|
public String toString(String[] operands) { |
|
|
@ -109,8 +115,7 @@ public final class InvokeOperator extends Operator { |
|
|
|
if (isConstructor()) |
|
|
|
if (isConstructor()) |
|
|
|
method = (object.length() == 0 ? "this" : object); |
|
|
|
method = (object.length() == 0 ? "this" : object); |
|
|
|
else |
|
|
|
else |
|
|
|
method = (object.length() == 0 ? "" : object + ".") |
|
|
|
method = (object.length() == 0 ? "" : object + ".") + methodName; |
|
|
|
+ field.getNameAndType().getName().getString(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StringBuffer params = new StringBuffer(); |
|
|
|
StringBuffer params = new StringBuffer(); |
|
|
|
for (int i=0; i < methodType.getArgumentTypes().length; i++) { |
|
|
|
for (int i=0; i < methodType.getArgumentTypes().length; i++) { |
|
|
|