import jp.igapyon.jcfa.vo.JcfaClass;
import jp.igapyon.jcfa.vo.JcfaCode;
import jp.igapyon.jcfa.vo.JcfaField;
+import jp.igapyon.jcfa.vo.JcfaLocalVariable;
import jp.igapyon.jcfa.vo.JcfaMethod;
import jp.igapyon.jcfa.vo.JcfaUnit;
jcfaMethod.setName(method.getName());
jcfaMethod.getComment().setJavaDoc(true);
+
+ {
+ // push this to local variable.
+ final JcfaLocalVariable jcfaLocalVariable = new JcfaLocalVariable();
+ jcfaMethod.getFrame().getLocalVariableList().add(jcfaLocalVariable);
+ jcfaLocalVariable.setName("this");
+ jcfaLocalVariable.setType(jcfaClass.getName());
+ }
+
if (jcfaMethod.getName().equals("<init>")) {
- jcfaMethod.getComment().getCommentList()
- .add("Default constructor.");
+ jcfaMethod.getComment().getCommentList().add("Constructor.");
} else {
jcfaMethod.getComment().getCommentList().add("Method.");
}
if (operands == Constants.UNPREDICTABLE) {
switch (jcfaCode.getOpcode()) {
case Constants.TABLESWITCH: {
+ // pad
+ // pad
+ // pad
+ // pad
+ // defaultbyte1
+ // defaultbyte2
+ // defaultbyte3
+ // defaultbyte4
+ // lowbyte1
+ // lowbyte2
+ // lowbyte3
+ // lowbyte4
+ // highbyte1
+ // highbyte2
+ // highbyte3
+ // highbyte4
+ // jump offsets here...
+
jcfaCode.getComment().getCommentList()
.add(" TODO no support opecode and operands");
+ int result = JcfaUtil.byte2Int(codes[pc + 1], codes[pc + 2],
+ codes[pc + 3], codes[pc + 4]);
+ jcfaCode.getComment().getCommentList()
+ .add(" MEMO skipping operands: " + result);
+ System.out.println("skipBytes: " + result);
+ int lookupOp = pc + 5;
+ short diff = JcfaUtil.byte2UnsignedByte(codes[lookupOp++]);
+ System.out.println("diff: " + diff);
+
+ int loopCount = JcfaUtil
+ .byte2Int(codes[lookupOp++], codes[lookupOp++],
+ codes[lookupOp++], codes[lookupOp++]);
+ System.out.println("count: " + loopCount);
+
return Constants.UNPREDICTABLE;
}
case Constants.LOOKUPSWITCH: {
+ // pad
+ // pad
+ // pad
+ // pad
+ // defaultbyte1
+ // defaultbyte2
+ // defaultbyte3
+ // defaultbyte4
+ // npairs1
+ // npairs2
+ // npairs3
+ // npairs4
+ // match-offset pairs here...
+
int result = JcfaUtil.byte2Int(codes[pc + 1], codes[pc + 2],
codes[pc + 3], codes[pc + 4]);
jcfaCode.getComment().getCommentList()
.add(" TODO skipping operands: why?: " + result);
+ System.out.println("skipBytes: " + result);
int lookupOp = pc + 5;
int loopCount = JcfaUtil
.byte2Int(codes[lookupOp++], codes[lookupOp++],
codes[lookupOp++], codes[lookupOp++]);
+ System.out.println("count: " + loopCount);
+
// switch table on loopCount.
short diff2 = JcfaUtil.byte2UnsignedByte(codes[lookupOp++]);
.add(" TODO skipping bytes: " + (diff2));
operands += (lookupOp - pc);
- break;
+ return Constants.UNPREDICTABLE;
+ // break;
}
case Constants.WIDE: {
jcfaCode.getComment().getCommentList()