OSDN Git Service

save
authoriga <tosiki.iga@nifty.ne.jp>
Tue, 1 Apr 2014 22:35:33 +0000 (07:35 +0900)
committeriga <tosiki.iga@nifty.ne.jp>
Tue, 1 Apr 2014 22:35:33 +0000 (07:35 +0900)
jcfa/src/jp/igapyon/jcfa/JcfaParser.java
jcfa/testJavaClass/output/test/TestJavaClass031.jcfa

index 227278a..ce85fb4 100644 (file)
@@ -175,11 +175,57 @@ public class JcfaParser {
                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()
index 128ebb0..8e888fd 100644 (file)
@@ -30,8 +30,8 @@ public class TestJavaClass031 {
                 */
 
                /*
-                * 3: tableswitch TODO no support opecode and operands TODO unsupported
-                * opcode
+                * 3: tableswitch TODO no support opecode and operands MEMO skipping
+                * operands: 158 TODO unsupported opcode
                 */
        }
 }
\ No newline at end of file