1 19 20 25 26 27 28 29 30 31 32 package soot.coffi; 33 import java.io.*; 34 62 class Instruction_Newarray extends Instruction { 63 public static final int T_BOOLEAN = 4; 64 public static final int T_CHAR = 5; 65 public static final int T_FLOAT = 6; 66 public static final int T_DOUBLE = 7; 67 public static final int T_BYTE = 8; 68 public static final int T_SHORT = 9; 69 public static final int T_INT = 10; 70 public static final int T_LONG = 11; 71 72 public byte atype; 73 public Instruction_Newarray() { super((byte)ByteCode.NEWARRAY); name = "newarray"; } 74 public String toString(cp_info constant_pool[]) { 75 String args; 76 switch((int)atype) { 77 case T_BOOLEAN: args = "boolean"; break; 78 case T_CHAR: args = "char"; break; 79 case T_FLOAT: args = "float"; break; 80 case T_DOUBLE: args = "double"; break; 81 case T_BYTE: args = "byte"; break; 82 case T_SHORT: args = "short"; break; 83 case T_INT: args = "int"; break; 84 case T_LONG: args = "long"; break; 85 default: args = Integer.toString(atype); break; 86 } 87 return super.toString(constant_pool) + argsep + args; 88 } 89 public int nextOffset(int curr) { return curr+2; } 90 public int parse(byte bc[],int index) { 91 atype = bc[index]; 92 return index+1; 93 } 94 public int compile(byte bc[],int index) { 95 bc[index++] = code; 96 bc[index] = atype; 97 return index+1; 98 } 99 } 100 | Popular Tags |