[kaffe] CVS kaffe (robilad): Updated gnu.bytecode snapshot to latest version
Kaffe CVS
cvs-commits at kaffe.org
Tue Sep 20 16:12:11 PDT 2005
PatchSet 6923
Date: 2005/09/20 23:07:23
Author: robilad
Branch: HEAD
Tag: (none)
Log:
Updated gnu.bytecode snapshot to latest version
Members:
ChangeLog:1.4445->1.4446
libraries/javalib/gnu/bytecode/ClassFileInput.java:1.1->1.2
libraries/javalib/gnu/bytecode/ClassType.java:1.1->1.2
libraries/javalib/gnu/bytecode/CodeAttr.java:1.1->1.2
libraries/javalib/gnu/bytecode/Method.java:1.1->1.2
libraries/javalib/gnu/bytecode/ObjectType.java:1.1->1.2
libraries/javalib/gnu/bytecode/Type.java:1.1->1.2
libraries/javalib/gnu/bytecode/Variable.java:1.1->1.2
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4445 kaffe/ChangeLog:1.4446
--- kaffe/ChangeLog:1.4445 Tue Sep 20 21:44:38 2005
+++ kaffe/ChangeLog Tue Sep 20 23:07:23 2005
@@ -1,5 +1,16 @@
2005-09-20 Dalibor Topic <robilad at kaffe.org>
+ * libraries/javalib/gnu/bytecode/ClassFileInput.java,
+ libraries/javalib/gnu/bytecode/ClassType.java,
+ libraries/javalib/gnu/bytecode/CodeAttr.java,
+ libraries/javalib/gnu/bytecode/Method.java,
+ libraries/javalib/gnu/bytecode/ObjectType.java,
+ libraries/javalib/gnu/bytecode/Type.java,
+ libraries/javalib/gnu/bytecode/Variable.java:
+ Updated to latest version from Kawa.
+
+2005-09-20 Dalibor Topic <robilad at kaffe.org>
+
* configure.ac: Check for libgif if libungif is not found.
It's a different name for the library, apparently.
Index: kaffe/libraries/javalib/gnu/bytecode/ClassFileInput.java
diff -u kaffe/libraries/javalib/gnu/bytecode/ClassFileInput.java:1.1 kaffe/libraries/javalib/gnu/bytecode/ClassFileInput.java:1.2
--- kaffe/libraries/javalib/gnu/bytecode/ClassFileInput.java:1.1 Thu Mar 3 18:55:56 2005
+++ kaffe/libraries/javalib/gnu/bytecode/ClassFileInput.java Tue Sep 20 23:07:27 2005
@@ -209,9 +209,9 @@
Method method = attr.getMethod();
if (attr.parameter_scope == null)
attr.parameter_scope = method.pushScope();
- if (attr.parameter_scope.end == null)
- attr.parameter_scope.end = new Label(code.PC);
Scope scope = attr.parameter_scope;
+ if (scope.end == null)
+ scope.end = new Label(code.PC);
ConstantPool constants = method.getConstants();
int count = readUnsignedShort();
int prev_start = scope.start.position;
Index: kaffe/libraries/javalib/gnu/bytecode/ClassType.java
diff -u kaffe/libraries/javalib/gnu/bytecode/ClassType.java:1.1 kaffe/libraries/javalib/gnu/bytecode/ClassType.java:1.2
--- kaffe/libraries/javalib/gnu/bytecode/ClassType.java:1.1 Thu Mar 3 18:55:56 2005
+++ kaffe/libraries/javalib/gnu/bytecode/ClassType.java Tue Sep 20 23:07:27 2005
@@ -179,7 +179,7 @@
* @return the interfaces this class is declared to implement
* (not those inherited from its superclass/superinterfaces).
*/
- public ClassType[] getInterfaces()
+ public synchronized ClassType[] getInterfaces()
{
if (interfaces == null
&& (flags & EXISTING_CLASS) != 0 && getReflectClass() != null)
@@ -416,6 +416,20 @@
Method meth = addMethod(name, flags);
meth.setSignature(signature);
return meth;
+ }
+
+ /** Add a method to this ClassType.
+ * If an existing method matches, return that. Otherwise, create
+ * a new one. */
+ public Method getMethod (java.lang.reflect.Method method)
+ {
+ String name = method.getName();
+ Class[] parameterClasses = method.getParameterTypes();
+ Type[] parameterTypes = new Type[parameterClasses.length];
+ for (int i = parameterClasses.length; --i >= 0; )
+ parameterTypes[i] = Type.make(parameterClasses[i]);
+ return addMethod(name, method.getModifiers(),
+ parameterTypes, Type.make(method.getReturnType()));
}
public final synchronized Method getDeclaredMethods()
Index: kaffe/libraries/javalib/gnu/bytecode/CodeAttr.java
diff -u kaffe/libraries/javalib/gnu/bytecode/CodeAttr.java:1.1 kaffe/libraries/javalib/gnu/bytecode/CodeAttr.java:1.2
--- kaffe/libraries/javalib/gnu/bytecode/CodeAttr.java:1.1 Thu Mar 3 18:55:56 2005
+++ kaffe/libraries/javalib/gnu/bytecode/CodeAttr.java Tue Sep 20 23:07:27 2005
@@ -501,7 +501,7 @@
Scope scope = new Scope ();
if (locals == null)
locals = new LocalVarsAttr(getMethod());
- locals.enterScope(scope);
+ enterScope(scope);
if (locals.parameter_scope == null)
locals.parameter_scope = scope;
return scope;
@@ -1947,18 +1947,14 @@
public void emitTryStart(boolean has_finally, Type result_type)
{
- TryState try_state = new TryState(this);
if (result_type != null && result_type.isVoid())
result_type = null;
+ Variable[] savedStack = null;
if (result_type != null || SP > 0)
- {
- pushScope();
- if (result_type != null)
- try_state.saved_result = addLocal(result_type);
- }
+ pushScope();
if (SP > 0)
{
- Variable[] savedStack = new Variable[SP];
+ savedStack = new Variable[SP];
int i = 0;
while (SP > 0)
{
@@ -1966,8 +1962,11 @@
emitStore(var);
savedStack[i++] = var;
}
- try_state.savedStack = savedStack;
}
+ TryState try_state = new TryState(this);
+ try_state.savedStack = savedStack;
+ if (result_type != null)
+ try_state.saved_result = addLocal(result_type);
if (has_finally)
try_state.finally_subr = new Label();
}
Index: kaffe/libraries/javalib/gnu/bytecode/Method.java
diff -u kaffe/libraries/javalib/gnu/bytecode/Method.java:1.1 kaffe/libraries/javalib/gnu/bytecode/Method.java:1.2
--- kaffe/libraries/javalib/gnu/bytecode/Method.java:1.1 Thu Mar 3 18:55:57 2005
+++ kaffe/libraries/javalib/gnu/bytecode/Method.java Tue Sep 20 23:07:27 2005
@@ -107,7 +107,6 @@
/**
* Allocate slots for a local variable (or parameter).
* @param local the variable we need to allocate
- * @result the index of the (first) slot.
* @deprecated
*/
public void allocate_local (Variable local)
Index: kaffe/libraries/javalib/gnu/bytecode/ObjectType.java
diff -u kaffe/libraries/javalib/gnu/bytecode/ObjectType.java:1.1 kaffe/libraries/javalib/gnu/bytecode/ObjectType.java:1.2
--- kaffe/libraries/javalib/gnu/bytecode/ObjectType.java:1.1 Thu Mar 3 18:55:57 2005
+++ kaffe/libraries/javalib/gnu/bytecode/ObjectType.java Tue Sep 20 23:07:27 2005
@@ -71,7 +71,14 @@
catch (java.lang.ClassNotFoundException ex)
{
if ((flags & EXISTING_CLASS) != 0)
- throw new RuntimeException("no such class: "+getName());
+ {
+ RuntimeException rex
+ = new RuntimeException("no such class: "+getName());
+ /* #ifdef use:java.lang.Throwable.getCause */
+ rex.initCause(ex);
+ /* #endif */
+ throw rex;
+ }
}
return reflectClass;
}
Index: kaffe/libraries/javalib/gnu/bytecode/Type.java
diff -u kaffe/libraries/javalib/gnu/bytecode/Type.java:1.1 kaffe/libraries/javalib/gnu/bytecode/Type.java:1.2
--- kaffe/libraries/javalib/gnu/bytecode/Type.java:1.1 Thu Mar 3 18:55:57 2005
+++ kaffe/libraries/javalib/gnu/bytecode/Type.java Tue Sep 20 23:07:27 2005
@@ -19,7 +19,7 @@
/** The type used to implement types not natively understood by the JVM.
* Usually, the identity function. However, a language might handle
- * union types or template types or type expression scalculated at
+ * union types or template types or type expressions calculated at
* run time. In that case return the type used at the JVM level,
* and known at compile time.
*/
Index: kaffe/libraries/javalib/gnu/bytecode/Variable.java
diff -u kaffe/libraries/javalib/gnu/bytecode/Variable.java:1.1 kaffe/libraries/javalib/gnu/bytecode/Variable.java:1.2
--- kaffe/libraries/javalib/gnu/bytecode/Variable.java:1.1 Thu Mar 3 18:55:57 2005
+++ kaffe/libraries/javalib/gnu/bytecode/Variable.java Tue Sep 20 23:07:27 2005
@@ -32,14 +32,11 @@
}
private int flags = SIMPLE_FLAG;
- /* The SIMPLE_FLAG records the isSimple (q.v.) state. */
+ /** The SIMPLE_FLAG records the isSimple (q.v.) state. */
private static final int SIMPLE_FLAG = 0x1;
- /* The PARAMETER_FLAG bit is true for parameters. */
+ /** The PARAMETER_FLAG bit is true for parameters. */
private static final int PARAMETER_FLAG = 0x2;
- /* The ARTIFICIAL_FLAG bits marks internals variables.
- PARAMETER_FLAG|ARTIFICIAL_FLAG means an incoming parameter. */
- private static final int ARTIFICIAL_FLAG = 0x4;
- private static final int LIVE_FLAG = 0x8;
+ private static final int LIVE_FLAG = 0x4;
static final int UNASSIGNED = -1;
/** The local variable slot number used by this variable.
@@ -83,16 +80,6 @@
setFlag(parameter, PARAMETER_FLAG);
}
- public final boolean isArtificial ()
- {
- return (flags & ARTIFICIAL_FLAG) != 0;
- }
-
- public final void setArtificial (boolean artificial)
- {
- setFlag(artificial, ARTIFICIAL_FLAG);
- }
-
/** Assign a local variable to a given local variable slot.
* @param varIndex the index of the local variables.
* @return true iff we succeeded (i.e. the slot was unused) */
@@ -122,7 +109,6 @@
/**
* Allocate slots for a local variable (or parameter).
- * @return the index of the (first) slot.
*/
public void allocateLocal (CodeAttr code)
{
More information about the kaffe
mailing list