1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
Index: ChangeLog
===================================================================
RCS file: /cvs/kawa/kawa/gnu/bytecode/ChangeLog,v
retrieving revision 1.118
diff -u -r1.118 ChangeLog
--- ChangeLog 2001/09/15 19:15:30 1.118
+++ ChangeLog 2001/09/17 03:35:14
@@ -1,3 +1,15 @@
+2001-08-07 Brian Jones <cbj@gnu.org>
+
+ * InnerClassesAttr.java (getClassNames): new method allows other
+ programs to get inner class names and their proper access string.
+
+ * Variable.java (getOffset): new method allows program to determine
+ slot in LocalVariableTable.
+ * Variable.java (getStartPC): new method allows program to determine
+ the pc value for a variable.
+ * Variable.java (getEndPC): new method allows program to determine
+ the length of a variable
+
2001-09-14 Per Bothner <per@bothner.com>
* ObjectType.java (promote): Convert nullType to pointer_type;
Index: InnerClassesAttr.java
===================================================================
RCS file: /cvs/kawa/kawa/gnu/bytecode/InnerClassesAttr.java,v
retrieving revision 1.4
diff -u -r1.4 InnerClassesAttr.java
--- InnerClassesAttr.java 1999/12/03 02:02:15 1.4
+++ InnerClassesAttr.java 2001/09/17 03:35:14
@@ -82,4 +82,21 @@
dst.println();
}
}
+
+ public String[][] getClassNames ()
+ {
+ ClassType ctype = (ClassType) container;
+ ConstantPool constants = ctype.getConstants();
+ String[][] val = new String[count][2];
+ for (int i = 0; i < count; i++)
+ {
+ int index;
+ index = data[4*i] & 0xFFFF; // inner_class_info_index
+ CpoolClass centry = (CpoolClass)constants.getForced(index, ConstantPool.CLASS);
+ val[i][0] = centry.getStringName ();
+
+ val[i][1] = Access.toString(data[4*i+3] & 0xFFFF);
+ }
+ return val;
+ }
}
Index: Variable.java
===================================================================
RCS file: /cvs/kawa/kawa/gnu/bytecode/Variable.java,v
retrieving revision 1.16
diff -u -r1.16 Variable.java
--- Variable.java 2000/01/22 21:10:50 1.16
+++ Variable.java 2001/09/17 03:35:14
@@ -45,12 +45,19 @@
/** The local variable slot number used by this variable.
* Not used (by the codegen layer) if !isSimple(). */
int offset = UNASSIGNED;
+
+ public int getOffset () { return offset; }
+
/** Returns true iff assigned to a local variable slot.
* Only relevant if isSimple (). */
public final boolean isAssigned () { return offset != UNASSIGNED; }
int start_pc;
int end_pc;
+
+ public int getStartPC () { return start_pc; }
+
+ public int getEndPC () { return end_pc; }
final boolean dead () { return end_pc > 0; }
|