[kaffe] CVS kaffe (robilad): Merged in javap from cp-tools and
gnu.bytecode
Kaffe CVS
cvs-commits at kaffe.org
Thu Mar 3 11:00:42 PST 2005
PatchSet 5493
Date: 2005/03/03 18:55:47
Author: robilad
Branch: HEAD
Tag: (none)
Log:
Merged in javap from cp-tools and gnu.bytecode
Members:
ChangeLog:1.3667->1.3668
THIRDPARTY:1.31->1.32
developers/gdbinit:1.15->1.16
kaffe/scripts/javap.in:1.6->1.7
libraries/javalib/Makefile.am:1.315->1.316
libraries/javalib/Makefile.in:1.401->1.402
libraries/javalib/all.files:1.95->1.96
libraries/javalib/gnu/bytecode/Access.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/ArrayClassLoader.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/ArrayType.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/AttrContainer.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/Attribute.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/ClassFileInput.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/ClassType.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/ClassTypeWriter.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/CodeAttr.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/ConstantPool.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/ConstantValueAttr.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/CpoolClass.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/CpoolEntry.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/CpoolFloat.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/CpoolNameAndType.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/CpoolRef.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/CpoolString.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/CpoolUtf8.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/CpoolValue1.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/CpoolValue2.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/ExceptionsAttr.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/Field.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/Filter.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/IfState.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/InnerClassesAttr.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/Label.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/LineNumbersAttr.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/LocalVarsAttr.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/Location.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/Method.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/MiscAttr.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/ObjectType.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/PrimType.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/Scope.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/SourceDebugExtAttr.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/SourceFileAttr.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/SwitchState.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/TryState.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/Type.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/VarEnumerator.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/Variable.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/ZipArchive.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/ZipLoader.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/dump.java:INITIAL->1.1
libraries/javalib/gnu/bytecode/package.html:INITIAL->1.1
libraries/javalib/gnu/classpath/tools/Util.java:INITIAL->1.1
libraries/javalib/gnu/classpath/tools/javap/GnuByteCodeJavap.java:INITIAL->1.1
libraries/javalib/gnu/classpath/tools/javap/Javap.java:INITIAL->1.1
libraries/javalib/gnu/classpath/tools/javap/JavapMain.java:INITIAL->1.1
libraries/javalib/kaffe/lang/PrimordialClassLoader.java:1.7->1.8
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3667 kaffe/ChangeLog:1.3668
--- kaffe/ChangeLog:1.3667 Wed Mar 2 23:02:51 2005
+++ kaffe/ChangeLog Thu Mar 3 18:55:47 2005
@@ -1,3 +1,73 @@
+2005-03-03 Dalibor Topic <robilad at kaffe.org>
+
+ * THIRDPARTY: Added gnu.bytecode and cp-tools javap.
+
+ * developers/gdbinit (pStr): fixed field name.
+
+ * kaffe/scripts/javap.in: Use gnu.classpath.javap.JavapMain.
+
+ * libraries/javalib/Makefile.am,
+ libraries/javalib/Makefile.in,
+ libraries/javalib/all.files:
+ Regenerated.
+
+ * libraries/javalib/gnu/bytecode/Access.java,
+ libraries/javalib/gnu/bytecode/ArrayClassLoader.java,
+ libraries/javalib/gnu/bytecode/ArrayType.java,
+ libraries/javalib/gnu/bytecode/AttrContainer.java,
+ libraries/javalib/gnu/bytecode/Attribute.java,
+ libraries/javalib/gnu/bytecode/ClassFileInput.java,
+ libraries/javalib/gnu/bytecode/ClassType.java,
+ libraries/javalib/gnu/bytecode/ClassTypeWriter.java,
+ libraries/javalib/gnu/bytecode/CodeAttr.java,
+ libraries/javalib/gnu/bytecode/ConstantPool.java,
+ libraries/javalib/gnu/bytecode/ConstantValueAttr.java,
+ libraries/javalib/gnu/bytecode/CpoolClass.java,
+ libraries/javalib/gnu/bytecode/CpoolEntry.java,
+ libraries/javalib/gnu/bytecode/CpoolFloat.java,
+ libraries/javalib/gnu/bytecode/CpoolNameAndType.java,
+ libraries/javalib/gnu/bytecode/CpoolRef.java,
+ libraries/javalib/gnu/bytecode/CpoolString.java,
+ libraries/javalib/gnu/bytecode/CpoolUtf8.java,
+ libraries/javalib/gnu/bytecode/CpoolValue1.java,
+ libraries/javalib/gnu/bytecode/CpoolValue2.java,
+ libraries/javalib/gnu/bytecode/ExceptionsAttr.java,
+ libraries/javalib/gnu/bytecode/Field.java,
+ libraries/javalib/gnu/bytecode/Filter.java,
+ libraries/javalib/gnu/bytecode/IfState.java,
+ libraries/javalib/gnu/bytecode/InnerClassesAttr.java,
+ libraries/javalib/gnu/bytecode/Label.java,
+ libraries/javalib/gnu/bytecode/LineNumbersAttr.java,
+ libraries/javalib/gnu/bytecode/LocalVarsAttr.java,
+ libraries/javalib/gnu/bytecode/Location.java,
+ libraries/javalib/gnu/bytecode/Method.java,
+ libraries/javalib/gnu/bytecode/MiscAttr.java,
+ libraries/javalib/gnu/bytecode/ObjectType.java,
+ libraries/javalib/gnu/bytecode/PrimType.java,
+ libraries/javalib/gnu/bytecode/Scope.java,
+ libraries/javalib/gnu/bytecode/SourceDebugExtAttr.java,
+ libraries/javalib/gnu/bytecode/SourceFileAttr.java,
+ libraries/javalib/gnu/bytecode/SwitchState.java,
+ libraries/javalib/gnu/bytecode/TryState.java,
+ libraries/javalib/gnu/bytecode/Type.java,
+ libraries/javalib/gnu/bytecode/VarEnumerator.java,
+ libraries/javalib/gnu/bytecode/Variable.java,
+ libraries/javalib/gnu/bytecode/ZipArchive.java,
+ libraries/javalib/gnu/bytecode/ZipLoader.java,
+ libraries/javalib/gnu/bytecode/dump.java,
+ libraries/javalib/gnu/bytecode/package.html:
+ New files taken from gnu.bytecode from Kawa.
+
+ * libraries/javalib/gnu/classpath/tools/Util.java,
+ libraries/javalib/gnu/classpath/tools/javap/GnuByteCodeJavap.java,
+ libraries/javalib/gnu/classpath/tools/javap/Javap.java,
+ libraries/javalib/gnu/classpath/tools/javap/JavapMain.java:
+ New files taken from GNU Classpath tools project.
+
+ * libraries/javalib/kaffe/lang/PrimordialClassLoader.java:
+ Added comments, and added explicit check to allow
+ gnu.classpath.tools.* classes to be loaded.
+
2005-03-02 Dalibor Topic <robilad at kaffe.org>
Resynced with GNU Classpath.
Index: kaffe/THIRDPARTY
diff -u kaffe/THIRDPARTY:1.31 kaffe/THIRDPARTY:1.32
--- kaffe/THIRDPARTY:1.31 Mon Feb 7 17:53:54 2005
+++ kaffe/THIRDPARTY Thu Mar 3 18:55:51 2005
@@ -17,17 +17,55 @@
More information on tritonus is available from http://tritonus.org.
-* gjdoc
+* gjdoc, javap, gnu.classpath.tools
This code has been merged in from the GNU Classpath tools project.
Kaffe is tracking this project's CVS HEAD.
-Gjdoc is distributed under the GNU General Public License.
+The GNU Classpath tools project is distributed under the GNU General
+Public License Version 2.
-See license.terms for the text of the GNU General Public License.
+See license.terms for the text of the GNU General Public License
+Version 2.
-More information on gjdoc can be found at
+More information on gjdoc and cp-tools can be found at
http://www.gnu.org/software/cp-tools/.
+
+* gnu.bytecode
+
+This code has been merged in from Kawa. Kaffe is tracking this
+project's CVS HEAD.
+
+The gnu.bytecode classes are licensed under the GNU General Public
+License Version 2 or any later version. The exact copyright notice
+is:
+
+ "The Java classes (with related files and documentation) in these packages
+ are copyright (C) 1996-2001, 2002 Per Bothner.
+
+ These classes are distributed in the hope that they will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License [included below] for more details.
+
+ These classes are free software. You can use and re-distribute a class
+ without restriction (in source or binary form) as long as you use a
+ version has not been modified in any way from a version released
+ by Per Bothner, Cygnus Solutions, or the Free Software Foundation.
+ (See the Kawa manual for more information.)
+ You may make and distribute a modified version, provided you follow
+ the terms of the GNU General Public License; either version 2,
+ or (at your option) any later version. (Version 2 is included below.)
+
+ If you have questions, contact Per Bothner,
+ 18651 Cynthia Avenue, Cupertino CA 95014, USA.
+ By email per at bothner.com."
+
+See license.terms for the text of the GNU General Public License
+Version 2.
+
+More information on Kawa can be found at
+http://www.gnu.org/software/kawa/.
* gnu.crypto, javax.crypto, javax.security.auth, javax.security.sasl,
org.ietf.jgss
Index: kaffe/developers/gdbinit
diff -u kaffe/developers/gdbinit:1.15 kaffe/developers/gdbinit:1.16
--- kaffe/developers/gdbinit:1.15 Wed Mar 10 22:40:01 2004
+++ kaffe/developers/gdbinit Thu Mar 3 18:55:51 2005
@@ -35,7 +35,7 @@
#handle SIGPIPE nostop noprint
define pStr
- p (char*)(($arg0).data)
+ p (char*)(($arg0).value)
end
document pStr
Index: kaffe/kaffe/scripts/javap.in
diff -u kaffe/kaffe/scripts/javap.in:1.6 kaffe/kaffe/scripts/javap.in:1.7
--- kaffe/kaffe/scripts/javap.in:1.6 Fri May 21 14:39:32 2004
+++ kaffe/kaffe/scripts/javap.in Thu Mar 3 18:55:52 2005
@@ -1,6 +1,6 @@
#! /bin/sh
prefix=@prefix@
exec_prefix=@exec_prefix@
-exec @bindir@/@kaffe_TRANSF@ $JAVA_OPTS at.dms.dis.Main ${1+"$@"}
+exec @bindir@/@kaffe_TRANSF@ $JAVA_OPTS gnu.classpath.tools.javap.JavapMain ${1+"$@"}
exit $?
Index: kaffe/libraries/javalib/Makefile.am
diff -u kaffe/libraries/javalib/Makefile.am:1.315 kaffe/libraries/javalib/Makefile.am:1.316
--- kaffe/libraries/javalib/Makefile.am:1.315 Thu Feb 24 15:07:26 2005
+++ kaffe/libraries/javalib/Makefile.am Thu Mar 3 18:55:52 2005
@@ -51,7 +51,10 @@
Klasses_jar_SRCS = \
$(com_jcraft_jzlib_SRCS) \
+ $(gnu_bytecode_SRCS) \
$(gnu_classpath_SRCS) \
+ $(gnu_classpath_tools_SRCS) \
+ $(gnu_classpath_tools_javap_SRCS) \
$(gnu_crypto_SRCS) \
$(gnu_crypto_assembly_SRCS) \
$(gnu_crypto_auth_SRCS) \
@@ -339,6 +342,51 @@
com/jcraft/jzlib/ZOutputStream.java \
com/jcraft/jzlib/ZStream.java \
com/jcraft/jzlib/ZStreamException.java
+gnu_bytecode_SRCS = \
+ gnu/bytecode/Access.java \
+ gnu/bytecode/ArrayClassLoader.java \
+ gnu/bytecode/ArrayType.java \
+ gnu/bytecode/AttrContainer.java \
+ gnu/bytecode/Attribute.java \
+ gnu/bytecode/ClassFileInput.java \
+ gnu/bytecode/ClassType.java \
+ gnu/bytecode/ClassTypeWriter.java \
+ gnu/bytecode/CodeAttr.java \
+ gnu/bytecode/ConstantPool.java \
+ gnu/bytecode/ConstantValueAttr.java \
+ gnu/bytecode/CpoolClass.java \
+ gnu/bytecode/CpoolEntry.java \
+ gnu/bytecode/CpoolFloat.java \
+ gnu/bytecode/CpoolNameAndType.java \
+ gnu/bytecode/CpoolRef.java \
+ gnu/bytecode/CpoolString.java \
+ gnu/bytecode/CpoolUtf8.java \
+ gnu/bytecode/CpoolValue1.java \
+ gnu/bytecode/CpoolValue2.java \
+ gnu/bytecode/ExceptionsAttr.java \
+ gnu/bytecode/Field.java \
+ gnu/bytecode/Filter.java \
+ gnu/bytecode/IfState.java \
+ gnu/bytecode/InnerClassesAttr.java \
+ gnu/bytecode/Label.java \
+ gnu/bytecode/LineNumbersAttr.java \
+ gnu/bytecode/LocalVarsAttr.java \
+ gnu/bytecode/Location.java \
+ gnu/bytecode/Method.java \
+ gnu/bytecode/MiscAttr.java \
+ gnu/bytecode/ObjectType.java \
+ gnu/bytecode/PrimType.java \
+ gnu/bytecode/Scope.java \
+ gnu/bytecode/SourceDebugExtAttr.java \
+ gnu/bytecode/SourceFileAttr.java \
+ gnu/bytecode/SwitchState.java \
+ gnu/bytecode/TryState.java \
+ gnu/bytecode/Type.java \
+ gnu/bytecode/VarEnumerator.java \
+ gnu/bytecode/Variable.java \
+ gnu/bytecode/ZipArchive.java \
+ gnu/bytecode/ZipLoader.java \
+ gnu/bytecode/dump.java
gnu_classpath_SRCS = \
gnu/classpath/RawData.java \
gnu/classpath/RawData32.java \
@@ -347,6 +395,12 @@
gnu/classpath/ServiceProviderLoadingAction.java \
gnu/classpath/SystemProperties.java \
gnu/classpath/VMSystemProperties.java
+gnu_classpath_tools_SRCS = \
+ gnu/classpath/tools/Util.java
+gnu_classpath_tools_javap_SRCS = \
+ gnu/classpath/tools/javap/GnuByteCodeJavap.java \
+ gnu/classpath/tools/javap/Javap.java \
+ gnu/classpath/tools/javap/JavapMain.java
gnu_crypto_SRCS = \
gnu/crypto/Properties.java \
gnu/crypto/Registry.java
Index: kaffe/libraries/javalib/Makefile.in
diff -u kaffe/libraries/javalib/Makefile.in:1.401 kaffe/libraries/javalib/Makefile.in:1.402
--- kaffe/libraries/javalib/Makefile.in:1.401 Thu Feb 24 15:07:27 2005
+++ kaffe/libraries/javalib/Makefile.in Thu Mar 3 18:55:53 2005
@@ -403,7 +403,10 @@
Klasses_jar_SRCS = \
$(com_jcraft_jzlib_SRCS) \
+ $(gnu_bytecode_SRCS) \
$(gnu_classpath_SRCS) \
+ $(gnu_classpath_tools_SRCS) \
+ $(gnu_classpath_tools_javap_SRCS) \
$(gnu_crypto_SRCS) \
$(gnu_crypto_assembly_SRCS) \
$(gnu_crypto_auth_SRCS) \
@@ -693,6 +696,52 @@
com/jcraft/jzlib/ZStream.java \
com/jcraft/jzlib/ZStreamException.java
+gnu_bytecode_SRCS = \
+ gnu/bytecode/Access.java \
+ gnu/bytecode/ArrayClassLoader.java \
+ gnu/bytecode/ArrayType.java \
+ gnu/bytecode/AttrContainer.java \
+ gnu/bytecode/Attribute.java \
+ gnu/bytecode/ClassFileInput.java \
+ gnu/bytecode/ClassType.java \
+ gnu/bytecode/ClassTypeWriter.java \
+ gnu/bytecode/CodeAttr.java \
+ gnu/bytecode/ConstantPool.java \
+ gnu/bytecode/ConstantValueAttr.java \
+ gnu/bytecode/CpoolClass.java \
+ gnu/bytecode/CpoolEntry.java \
+ gnu/bytecode/CpoolFloat.java \
+ gnu/bytecode/CpoolNameAndType.java \
+ gnu/bytecode/CpoolRef.java \
+ gnu/bytecode/CpoolString.java \
+ gnu/bytecode/CpoolUtf8.java \
+ gnu/bytecode/CpoolValue1.java \
+ gnu/bytecode/CpoolValue2.java \
+ gnu/bytecode/ExceptionsAttr.java \
+ gnu/bytecode/Field.java \
+ gnu/bytecode/Filter.java \
+ gnu/bytecode/IfState.java \
+ gnu/bytecode/InnerClassesAttr.java \
+ gnu/bytecode/Label.java \
+ gnu/bytecode/LineNumbersAttr.java \
+ gnu/bytecode/LocalVarsAttr.java \
+ gnu/bytecode/Location.java \
+ gnu/bytecode/Method.java \
+ gnu/bytecode/MiscAttr.java \
+ gnu/bytecode/ObjectType.java \
+ gnu/bytecode/PrimType.java \
+ gnu/bytecode/Scope.java \
+ gnu/bytecode/SourceDebugExtAttr.java \
+ gnu/bytecode/SourceFileAttr.java \
+ gnu/bytecode/SwitchState.java \
+ gnu/bytecode/TryState.java \
+ gnu/bytecode/Type.java \
+ gnu/bytecode/VarEnumerator.java \
+ gnu/bytecode/Variable.java \
+ gnu/bytecode/ZipArchive.java \
+ gnu/bytecode/ZipLoader.java \
+ gnu/bytecode/dump.java
+
gnu_classpath_SRCS = \
gnu/classpath/RawData.java \
gnu/classpath/RawData32.java \
@@ -701,6 +750,14 @@
gnu/classpath/ServiceProviderLoadingAction.java \
gnu/classpath/SystemProperties.java \
gnu/classpath/VMSystemProperties.java
+
+gnu_classpath_tools_SRCS = \
+ gnu/classpath/tools/Util.java
+
+gnu_classpath_tools_javap_SRCS = \
+ gnu/classpath/tools/javap/GnuByteCodeJavap.java \
+ gnu/classpath/tools/javap/Javap.java \
+ gnu/classpath/tools/javap/JavapMain.java
gnu_crypto_SRCS = \
gnu/crypto/Properties.java \
Index: kaffe/libraries/javalib/all.files
diff -u kaffe/libraries/javalib/all.files:1.95 kaffe/libraries/javalib/all.files:1.96
--- kaffe/libraries/javalib/all.files:1.95 Thu Feb 24 15:07:28 2005
+++ kaffe/libraries/javalib/all.files Thu Mar 3 18:55:56 2005
@@ -11,6 +11,50 @@
com/jcraft/jzlib/ZOutputStream.java
com/jcraft/jzlib/ZStream.java
com/jcraft/jzlib/ZStreamException.java
+gnu/bytecode/Access.java
+gnu/bytecode/ArrayClassLoader.java
+gnu/bytecode/ArrayType.java
+gnu/bytecode/AttrContainer.java
+gnu/bytecode/Attribute.java
+gnu/bytecode/ClassFileInput.java
+gnu/bytecode/ClassType.java
+gnu/bytecode/ClassTypeWriter.java
+gnu/bytecode/CodeAttr.java
+gnu/bytecode/ConstantPool.java
+gnu/bytecode/ConstantValueAttr.java
+gnu/bytecode/CpoolClass.java
+gnu/bytecode/CpoolEntry.java
+gnu/bytecode/CpoolFloat.java
+gnu/bytecode/CpoolNameAndType.java
+gnu/bytecode/CpoolRef.java
+gnu/bytecode/CpoolString.java
+gnu/bytecode/CpoolUtf8.java
+gnu/bytecode/CpoolValue1.java
+gnu/bytecode/CpoolValue2.java
+gnu/bytecode/ExceptionsAttr.java
+gnu/bytecode/Field.java
+gnu/bytecode/Filter.java
+gnu/bytecode/IfState.java
+gnu/bytecode/InnerClassesAttr.java
+gnu/bytecode/Label.java
+gnu/bytecode/LineNumbersAttr.java
+gnu/bytecode/LocalVarsAttr.java
+gnu/bytecode/Location.java
+gnu/bytecode/Method.java
+gnu/bytecode/MiscAttr.java
+gnu/bytecode/ObjectType.java
+gnu/bytecode/PrimType.java
+gnu/bytecode/Scope.java
+gnu/bytecode/SourceDebugExtAttr.java
+gnu/bytecode/SourceFileAttr.java
+gnu/bytecode/SwitchState.java
+gnu/bytecode/TryState.java
+gnu/bytecode/Type.java
+gnu/bytecode/VarEnumerator.java
+gnu/bytecode/Variable.java
+gnu/bytecode/ZipArchive.java
+gnu/bytecode/ZipLoader.java
+gnu/bytecode/dump.java
gnu/classpath/RawData.java
gnu/classpath/RawData32.java
gnu/classpath/RawData64.java
@@ -18,6 +62,10 @@
gnu/classpath/ServiceProviderLoadingAction.java
gnu/classpath/SystemProperties.java
gnu/classpath/VMSystemProperties.java
+gnu/classpath/tools/Util.java
+gnu/classpath/tools/javap/GnuByteCodeJavap.java
+gnu/classpath/tools/javap/Javap.java
+gnu/classpath/tools/javap/JavapMain.java
gnu/crypto/Properties.java
gnu/crypto/Registry.java
gnu/crypto/assembly/Assembly.java
===================================================================
Checking out kaffe/libraries/javalib/gnu/bytecode/Access.java
RCS: /home/cvs/kaffe/kaffe/libraries/javalib/gnu/bytecode/Access.java,v
VERS: 1.1
***************
--- /dev/null Sun Aug 4 19:57:58 2002
+++ kaffe/libraries/javalib/gnu/bytecode/Access.java Thu Mar 3 19:00:42 2005
@@ -0,0 +1,82 @@
+// Copyright (c) 1997 Per M.A. Bothner.
+// This is free software; for terms and warranty disclaimer see ./COPYING.
+
+package gnu.bytecode;
+
+/** Access flags. */
+/* When using JDK 1.1, replace this class by java.lang.reflec.Modifiers. */
+
+public class Access {
+ static public final short PUBLIC = 0x0001;
+ static public final short PRIVATE = 0x0002;
+ static public final short PROTECTED = 0x0004;
+ static public final short STATIC = 0x0008;
+ static public final short FINAL = 0x0010;
+ static public final short SUPER = 0x0020;
+ static public final short SYNCHRONIZED= 0x0020;
+ static public final short VOLATILE = 0x0040;
+ static public final short BRIDGE = 0x0040;
+ static public final short TRANSIENT = 0x0080;
+ static public final short VARARGS = 0x0080;
+ static public final short NATIVE = 0x0100;
+ static public final short INTERFACE = 0x0200;
+ static public final short ABSTRACT = 0x0400;
+ static public final short STRICT = 0x0800;
+ static public final short SYNTHETIC = 0x1000;
+ static public final short ANNOTATION = 0x2000;
+ static public final short ENUM = 0x4000;
+ // unassigned 0x8000
+
+ public static final short CLASS_MODIFIERS
+ = (short)(PUBLIC|FINAL|SUPER|INTERFACE|ABSTRACT|SYNTHETIC|ANNOTATION|ENUM);
+ public static final short FIELD_MODIFIERS
+ = (short)(PUBLIC|PRIVATE|PROTECTED|STATIC|FINAL
+ |VOLATILE|TRANSIENT|SYNTHETIC|ENUM);
+ public static final short METHOD_MODIFIERS
+ = (short)(PUBLIC|PRIVATE|PROTECTED|STATIC|FINAL|SYNCHRONIZED
+ |BRIDGE|VARARGS|NATIVE|ABSTRACT|STRICT|SYNTHETIC);
+
+ public static String toString(int flags)
+ {
+ return toString(flags, '\0');
+ }
+
+ /** Return a string naming the access bits in flags.
+ * @param kind 'C' for a class, 'M' for a method, 'F' for a field.
+ */
+ public static String toString(int flags, char kind)
+ {
+ short mask
+ = (kind == 'C' ? CLASS_MODIFIERS
+ : kind == 'F' ? FIELD_MODIFIERS
+ : kind == 'M' ? METHOD_MODIFIERS
+ : (CLASS_MODIFIERS|FIELD_MODIFIERS|METHOD_MODIFIERS));
+ short bad_flags = (short) (flags & ~mask);
+ flags &= mask;
+ StringBuffer buf = new StringBuffer();
+ if ((flags & PUBLIC) != 0) buf.append(" public");
+ if ((flags & PRIVATE) != 0) buf.append(" private");
+ if ((flags & PROTECTED) != 0) buf.append(" protected");
+ if ((flags & STATIC) != 0) buf.append(" static");
+ if ((flags & FINAL) != 0) buf.append(" final");
+ if ((flags & SYNCHRONIZED) != 0)
+ buf.append(kind == 'C' ? " super" : " synchronized");
+ if ((flags & VOLATILE) != 0)
+ buf.append(kind == 'M' ? " bridge" : " volatile");
+ if ((flags & TRANSIENT) != 0)
+ buf.append(kind == 'M' ? " varargs" : " transient");
+ if ((flags & NATIVE) != 0) buf.append(" native");
+ if ((flags & INTERFACE) != 0) buf.append(" interface");
+ if ((flags & ABSTRACT) != 0) buf.append(" abstract");
+ if ((flags & STRICT) != 0) buf.append(" strict");
+ if ((flags & ENUM) != 0) buf.append(" enum");
+ if ((flags & SYNTHETIC) != 0) buf.append(" synthetic");
+ if ((flags & ANNOTATION) != 0) buf.append(" annotation");
+ if (bad_flags != 0)
+ {
+ buf.append(" unknown-flags:0x");
+ buf.append(Integer.toHexString(bad_flags));
+ }
+ return buf.toString();
+ }
+}
===================================================================
Checking out kaffe/libraries/javalib/gnu/bytecode/ArrayClassLoader.java
RCS: /home/cvs/kaffe/kaffe/libraries/javalib/gnu/bytecode/ArrayClassLoader.java,v
VERS: 1.1
***************
--- /dev/null Sun Aug 4 19:57:58 2002
+++ kaffe/libraries/javalib/gnu/bytecode/ArrayClassLoader.java Thu Mar 3 19:00:42 2005
@@ -0,0 +1,79 @@
+package gnu.bytecode;
+import java.util.Hashtable;
+
+/** Load classes from a set of byte arrays.
+ * @author Per Bothner
+ */
+
+public class ArrayClassLoader extends ClassLoader
+{
+ Hashtable map = new Hashtable(100);
+
+ public ArrayClassLoader ()
+ {
+ }
+
+ /** Load classes from the given byte arrays.
+ By convention, the classes we manage are named "lambda"+<INTEGER>. */
+ public ArrayClassLoader (byte[][] classBytes)
+ {
+ for (int i = classBytes.length; --i >= 0; )
+ addClass("lambda" + i, classBytes[i]);
+ }
+
+ public ArrayClassLoader (String[] classNames, byte[][] classBytes)
+ {
+ for (int i = classBytes.length; --i >= 0; )
+ addClass(classNames[i], classBytes[i]);
+ }
+
+ public void addClass(Class clas)
+ {
+ map.put(clas.getName(), clas);
+ }
+
+ public void addClass(String name, byte[] bytes)
+ {
+ map.put(name, bytes);
+ }
+
+ public void addClass (ClassType ctype)
+ throws java.io.IOException
+ {
+ if ((ctype.flags & ClassType.EXISTING_CLASS) != 0)
+ addClass(ctype. getReflectClass());
+ else
+ addClass(ctype.getName(), ctype.writeToArray());
+ }
+
+ public Class loadClass (String name, boolean resolve)
+ throws ClassNotFoundException
+ {
+ Object r = map.get(name);
+ Class clas;
+ if (r == null)
+ {
+ clas = Class.forName(name);
+ }
+ else if (r instanceof byte[])
+ {
+ synchronized (this)
+ {
+ r = map.get(name);
+ if (r instanceof byte[])
+ {
+ byte[] bytes = (byte[]) r;
+ clas = defineClass (name, bytes, 0, bytes.length);
+ map.put(name, clas);
+ }
+ else
+ clas = (Class) r;
+ }
+ }
+ else
+ clas = (Class) r;
+ if (resolve && clas != null)
+ resolveClass (clas);
+ return clas;
+ }
+}
===================================================================
Checking out kaffe/libraries/javalib/gnu/bytecode/ArrayType.java
RCS: /home/cvs/kaffe/kaffe/libraries/javalib/gnu/bytecode/ArrayType.java,v
VERS: 1.1
***************
--- /dev/null Sun Aug 4 19:57:58 2002
+++ kaffe/libraries/javalib/gnu/bytecode/ArrayType.java Thu Mar 3 19:00:42 2005
@@ -0,0 +1,69 @@
+// Copyright (c) 1997 Per M.A. Bothner.
+// This is free software; for terms and warranty disclaimer see ./COPYING.
+
+package gnu.bytecode;
+
+public class ArrayType extends ObjectType
+{
+ public Type elements;
+
+ public ArrayType (Type elements)
+ {
+ this(elements, elements.getName() + "[]");
+ }
+
+ ArrayType (Type elements, String name)
+ {
+ this_name = name;
+ setSignature("[" + elements.getSignature());
+ this.elements = elements;
+ }
+
+ public Type getImplementationType()
+ {
+ Type eltype = elements.getImplementationType();
+ return elements == eltype ? this : make(eltype);
+ }
+
+ /** Name assumed to end with "[]". */
+ static ArrayType make(String name)
+ {
+ Type elements = Type.getType(name.substring(0, name.length()-2));
+ ArrayType array_type = elements.array_type;
+ if (array_type == null)
+ {
+ array_type = new ArrayType(elements, name);
+ elements.array_type = array_type;
+ }
+ return array_type;
+ }
+
+ /** Find or create an ArrayType for the specified element type. */
+ public static ArrayType make(Type elements)
+ {
+ ArrayType array_type = elements.array_type;
+ if (array_type == null)
+ {
+ array_type = new ArrayType(elements, elements.getName() + "[]");
+ elements.array_type = array_type;
+ }
+ return array_type;
+ }
+
+ public Type getComponentType() { return elements; }
+
+ public String getInternalName() { return getSignature(); }
+
+ public int compare(Type other)
+ {
+ if (other == nullType)
+ return 1;
+ if (other instanceof ArrayType)
+ return elements.compare(((ArrayType) other).elements);
+ else if (other.getName().equals("java.lang.Object")
+ || other == tostring_type)
+ return -1;
+ else
+ return -3;
+ }
+}
===================================================================
Checking out kaffe/libraries/javalib/gnu/bytecode/AttrContainer.java
RCS: /home/cvs/kaffe/kaffe/libraries/javalib/gnu/bytecode/AttrContainer.java,v
VERS: 1.1
***************
--- /dev/null Sun Aug 4 19:57:58 2002
+++ kaffe/libraries/javalib/gnu/bytecode/AttrContainer.java Thu Mar 3 19:00:42 2005
@@ -0,0 +1,15 @@
+// Copyright (c) 1997 Per M.A. Bothner.
+// This is free software; for terms and warranty disclaimer see ./COPYING.
+
+package gnu.bytecode;
+
+/** An interface for objects that (may) contain Attribute objects. */
+
+public interface AttrContainer
+{
+ /** Get the (first) Attribute of this container. */
+ public Attribute getAttributes ();
+
+ /** Set the (list of) Attributes of this container. */
+ public void setAttributes (Attribute attribute);
+}
===================================================================
Checking out kaffe/libraries/javalib/gnu/bytecode/Attribute.java
RCS: /home/cvs/kaffe/kaffe/libraries/javalib/gnu/bytecode/Attribute.java,v
VERS: 1.1
***************
--- /dev/null Sun Aug 4 19:57:58 2002
+++ kaffe/libraries/javalib/gnu/bytecode/Attribute.java Thu Mar 3 19:00:42 2005
@@ -0,0 +1,163 @@
+// Copyright (c) 1997 Per M.A. Bothner.
+// This is free software; for terms and warranty disclaimer see ./COPYING.
+
+package gnu.bytecode;
+import java.io.*;
+
+/**
+ * Represents an Attribute of an AttrContainer.
+ * <p>
+ * Various sub-classses are used for standard attributes,
+ * or you can use MiscAttr for a generic attribute.
+ * @author Per Bothner
+ */
+
+public abstract class Attribute
+{
+ /** Every Attribute belongs to some AttrContainer object. */
+ AttrContainer container;
+ /** Return the Attribute container that contains this Attribute. */
+ public final AttrContainer getContainer() { return container; }
+ public final void setContainer(AttrContainer container)
+ { this.container = container; }
+
+ Attribute next;
+ /** Get the next Attribute belonging to getContainer(). */
+ public final Attribute getNext() { return next; }
+ /** Set the next Attribute in the chain belonging to getContainer(). */
+ public final void setNext(Attribute next) { this.next = next; }
+
+ /** Add this to (the front of) of the specified attribute container. */
+ public void addToFrontOf(AttrContainer container)
+ {
+ setContainer(container);
+ setNext(container.getAttributes());
+ container.setAttributes(this);
+ }
+
+ String name; // This is an interned string.
+
+ // If > 0, the constant-pool index of name.
+ // If -1, means attribute should be skipped on output.
+ int name_index;
+
+ /** Returns true if this attribute should be skipped on output. */
+ public final boolean isSkipped() { return name_index < 0; }
+
+ /** Iff skip, cause this attributed to be skipped on output. */
+ public final void setSkipped(boolean skip) { name_index = skip ? -1 : 0; }
+
+ /** Cause this attributed to be skipped on output. */
+ public final void setSkipped() { name_index = -1; }
+
+ public final String getName() { return name; }
+ public final void setName(String name) { this.name = name.intern(); }
+
+ public final int getNameIndex() { return name_index; }
+ public final void setNameIndex(int index) { name_index = index; }
+
+ /** Create a new Attribute.
+ * @param name - an interned String that names the Attribute. */
+ public Attribute (String name)
+ {
+ this.name = name;
+ }
+
+ /** Find an Attribute by name, in an attribute cointainer.
+ * @param container the attribute container to search
+ * @param name the (interned) name of the attribute we are seeking
+ * @return the matching Attribute, or null if the search failed.
+ */
+ public static Attribute get (AttrContainer container, String name)
+ {
+ for (Attribute attr = container.getAttributes();
+ attr != null; attr = attr.next)
+ {
+ if (attr.getName() == name)
+ return attr;
+ }
+ return null;
+ }
+
+ /** Add any needed constant pool entries for this Attribute.
+ * Overridden by sub-classes.
+ * Do any other cleanup needed before writing out a .class file. */
+ public void assignConstants (ClassType cl)
+ {
+ if (name_index == 0)
+ name_index = cl.getConstants().addUtf8(name).getIndex();
+ }
+
+ /** Add any needed constant pool entries for all attributes in a container.
+ * Do any other cleanup needed before writing out a .class file. */
+ public static void assignConstants (AttrContainer container, ClassType cl)
+ {
+ for (Attribute attr = container.getAttributes();
+ attr != null; attr = attr.next)
+ {
+ if (! attr.isSkipped())
+ attr.assignConstants(cl);
+ }
+ }
+
+ /** Return the length of the attribute in bytes.
+ * Does not include the 6-byte header (for the name_index and the length).*/
+ abstract public int getLength();
+
+ /** Return the length of all the attributes (with headers) in bytes. */
+ public static int getLengthAll (AttrContainer container)
+ {
+ int length = 0;
+ for (Attribute attr = container.getAttributes();
+ attr != null; attr = attr.next)
+ {
+ if (! attr.isSkipped())
+ length += 6 + attr.getLength();
+ }
+ return length;
+ }
+
+ /** Write out the contents of the Attribute.
+ * Does not write the 6-byte attribute header. */
+ abstract public void write (DataOutputStream dstr)
+ throws java.io.IOException;
+
+ public static int count (AttrContainer container)
+ {
+ int count = 0;
+ for (Attribute attr = container.getAttributes();
+ attr != null; attr = attr.next)
+ {
+ if (!attr.isSkipped())
+ count++;
+ }
+ return count;
+ }
+
+ public static void writeAll (AttrContainer container, DataOutputStream dstr)
+ throws java.io.IOException
+ {
+ int count = count(container);
+ dstr.writeShort(count);
+ for (Attribute attr = container.getAttributes();
+ attr != null; attr = attr.next)
+ {
+ if (attr.isSkipped())
+ continue;
+ if (attr.name_index == 0)
+ throw new Error("Attribute.writeAll called without assignConstants");
+ dstr.writeShort(attr.name_index);
+ dstr.writeInt(attr.getLength());
+ attr.write(dstr);
+ }
+ }
+
+ public void print (ClassTypeWriter dst)
+ {
+ dst.print("Attribute \"");
+ dst.print(getName());
+ dst.print("\", length:");
+ dst.println(getLength());
+ }
+
+};
===================================================================
Checking out kaffe/libraries/javalib/gnu/bytecode/ClassFileInput.java
RCS: /home/cvs/kaffe/kaffe/libraries/javalib/gnu/bytecode/ClassFileInput.java,v
VERS: 1.1
***************
--- /dev/null Sun Aug 4 19:57:58 2002
+++ kaffe/libraries/javalib/gnu/bytecode/ClassFileInput.java Thu Mar 3 19:00:42 2005
@@ -0,0 +1,318 @@
+// Copyright (c) 1997, 2004 Per M.A. Bothner.
+// This is free software; for terms and warranty disclaimer see ./COPYING.
+
+package gnu.bytecode;
+import java.io.InputStream;
+import java.io.DataInputStream;
+import java.io.IOException;
+
+/** Class to read a ClassType from a DataInputStream (.class file).
+ * @author Per Bothner
+ */
+
+public class ClassFileInput extends DataInputStream
+{
+ ClassType ctype;
+ InputStream str;
+
+ public ClassFileInput (InputStream str)
+ throws IOException
+ {
+ super(str);
+ }
+
+ public ClassFileInput (ClassType ctype, InputStream str)
+ throws IOException, ClassFormatError
+ {
+ super(str);
+ this.ctype = ctype;
+ if (!readHeader())
+ throw new ClassFormatError("invalid magic number");
+ ctype.constants = readConstants();
+ readClassInfo();
+ readFields();
+ readMethods();
+ readAttributes(ctype);
+ }
+
+ /** Read a class (in .class format) from an InputStream.
+ * @return A new ClassType object representing the class that was read.
+ */
+ public static ClassType readClassType (InputStream str)
+ throws IOException, ClassFormatError
+ {
+ ClassType ctype = new ClassType();
+ ClassFileInput reader = new ClassFileInput(ctype, str);
+ return ctype;
+ }
+
+ public boolean readHeader () throws IOException
+ {
+ int magic = readInt();
+ if (magic != 0xcafebabe)
+ return false;
+ short minor_version = readShort();
+ short major_version = readShort();
+ return true;
+ }
+
+ public ConstantPool readConstants () throws IOException
+ {
+ return new ConstantPool(this);
+ }
+
+ public void readClassInfo () throws IOException
+ {
+ ctype.access_flags = readUnsignedShort();
+ CpoolClass clas;
+ String name;
+
+ ctype.thisClassIndex = readUnsignedShort();
+ clas = (CpoolClass) ctype.constants.getForced(ctype.thisClassIndex,
+ ConstantPool.CLASS);
+ name = clas.name.string;
+ ctype.this_name = name.replace('/', '.');
+ ctype.setSignature("L"+name+";");
+
+ ctype.superClassIndex = readUnsignedShort();
+ if (ctype.superClassIndex == 0)
+ ctype.setSuper((ClassType) null);
+ else
+ {
*** Patch too long, truncated ***
More information about the kaffe
mailing list