aboutsummaryrefslogtreecommitdiff
path: root/libjava/classpath
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2007-04-19 00:24:09 +0000
committerTom Tromey <tromey@gcc.gnu.org>2007-04-19 00:24:09 +0000
commit06a4a507625bf9a3b979ccb275bf4182f07b8ea2 (patch)
treee08786d000d7c3bc2119fb775da6d96fbbe84475 /libjava/classpath
parent5604bf10dd082cdf609d29e1e99a5879758a7c46 (diff)
downloadgcc-06a4a507625bf9a3b979ccb275bf4182f07b8ea2.zip
gcc-06a4a507625bf9a3b979ccb275bf4182f07b8ea2.tar.gz
gcc-06a4a507625bf9a3b979ccb275bf4182f07b8ea2.tar.bz2
libjava
* Regenerated headers with new gjavah. libjava/classpath * tools/gnu/classpath/tools/javah/MethodHelper.java (print): Changed arguments. Directly print method name. * tools/gnu/classpath/tools/javah/ClassWrapper.java (methodNameMap): New field. (makeVtable): Initialize it. (printMethods): Compute name for bridge targets. From-SVN: r123965
Diffstat (limited to 'libjava/classpath')
-rw-r--r--libjava/classpath/ChangeLog9
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/ComponentGraphics.classbin12284 -> 12162 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/TripleKey.classbin1315 -> 1315 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/UnicastConnectionManager.classbin7405 -> 7404 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/ClassWrapper.classbin7779 -> 8524 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/MethodHelper.classbin3041 -> 2902 bytes
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/javah/ClassWrapper.java39
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/javah/MethodHelper.java14
8 files changed, 46 insertions, 16 deletions
diff --git a/libjava/classpath/ChangeLog b/libjava/classpath/ChangeLog
index fac684a..987ac9e 100644
--- a/libjava/classpath/ChangeLog
+++ b/libjava/classpath/ChangeLog
@@ -1,3 +1,12 @@
+2007-04-18 Tom Tromey <tromey@redhat.com>
+
+ * tools/gnu/classpath/tools/javah/MethodHelper.java (print):
+ Changed arguments. Directly print method name.
+ * tools/gnu/classpath/tools/javah/ClassWrapper.java
+ (methodNameMap): New field.
+ (makeVtable): Initialize it.
+ (printMethods): Compute name for bridge targets.
+
2007-04-17 Andrew Haley <aph@redhat.com>
* gnu/java/rmi/server/UnicastConnectionManager.java
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/ComponentGraphics.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/ComponentGraphics.class
index 655eba1..0e67187 100644
--- a/libjava/classpath/lib/gnu/java/awt/peer/gtk/ComponentGraphics.class
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/ComponentGraphics.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/TripleKey.class b/libjava/classpath/lib/gnu/java/rmi/server/TripleKey.class
index faa602b..661d491 100644
--- a/libjava/classpath/lib/gnu/java/rmi/server/TripleKey.class
+++ b/libjava/classpath/lib/gnu/java/rmi/server/TripleKey.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/UnicastConnectionManager.class b/libjava/classpath/lib/gnu/java/rmi/server/UnicastConnectionManager.class
index e5d5579..917dfc9 100644
--- a/libjava/classpath/lib/gnu/java/rmi/server/UnicastConnectionManager.class
+++ b/libjava/classpath/lib/gnu/java/rmi/server/UnicastConnectionManager.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/ClassWrapper.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/ClassWrapper.class
index e759d12..da5ddeb 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/ClassWrapper.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/ClassWrapper.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/MethodHelper.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/MethodHelper.class
index 4565197..2bd3202 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/MethodHelper.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/MethodHelper.class
Binary files differ
diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/ClassWrapper.java b/libjava/classpath/tools/gnu/classpath/tools/javah/ClassWrapper.java
index e238065..2172628 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/javah/ClassWrapper.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/javah/ClassWrapper.java
@@ -1,5 +1,5 @@
/* ClassWrapper.java - wrap ASM class objects
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2007 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,6 +43,7 @@ import java.io.IOException;
import java.io.PrintStream;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -68,6 +69,11 @@ public class ClassWrapper
// A set of all the method names in this class.
HashSet methodNames = new HashSet();
+ // This maps a method name + descriptor, e.g. "method()V", to the
+ // name chosen for the method. This is used when computing the
+ // names of bridge method targets.
+ HashMap methodNameMap = new HashMap();
+
public ClassWrapper(Main classpath)
{
this.classpath = classpath;
@@ -187,18 +193,24 @@ public class ClassWrapper
superClass.makeVtable();
vtable = new ArrayList(superClass.vtable);
bridgeTargets = new HashSet(superClass.bridgeTargets);
+ methodNameMap = new HashMap(superClass.methodNameMap);
}
else
{
// Object.
vtable = new ArrayList();
bridgeTargets = new HashSet();
+ methodNameMap = new HashMap();
}
addLocalMethods();
addInterfaces(this);
- // Make a set of all the targets of bridge methods.
- // We rename bridge methods to avoid problems with C++.
+ // Make a set of all the targets of bridge methods. We rename
+ // bridge target methods to avoid problems with C++. You might
+ // think we could rename the bridge methods themselves, but bridge
+ // methods by definition override a method from the superclass --
+ // and we have to consider the superclass' header as an
+ // unchangeable entity.
Iterator i = methods.iterator();
while (i.hasNext())
{
@@ -232,8 +244,25 @@ public class ClassWrapper
while (i.hasNext())
{
MethodNode m = (MethodNode) i.next();
- boolean isTarget = bridgeTargets.contains(m.name + m.desc);
- MethodHelper.print(out, m, this, isTarget);
+ String nameToUse;
+ String sum = m.name + m.desc;
+ if (bridgeTargets.contains(sum))
+ {
+ if (methodNameMap.containsKey(sum))
+ nameToUse = (String) methodNameMap.get(sum);
+ else
+ {
+ // Bridge target that is new in this class.
+ String cname = this.name;
+ int index = cname.lastIndexOf('/');
+ cname = cname.substring(index + 1);
+ nameToUse = cname + "$" + m.name;
+ }
+ }
+ else
+ nameToUse = Keywords.getCxxName(m.name);
+ methodNameMap.put(sum, nameToUse);
+ MethodHelper.print(out, m, this, nameToUse);
}
}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/MethodHelper.java b/libjava/classpath/tools/gnu/classpath/tools/javah/MethodHelper.java
index 6657f11..4359523 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/javah/MethodHelper.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/javah/MethodHelper.java
@@ -1,5 +1,5 @@
/* MethodHelper.java - helper class for manipulating methods
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2007 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -76,7 +76,7 @@ public class MethodHelper
}
public static void print(CniPrintStream out, MethodNode meth,
- ClassWrapper declarer, boolean isBridgeTarget)
+ ClassWrapper declarer, String realMethodName)
{
if ("<clinit>".equals(meth.name))
return;
@@ -97,15 +97,7 @@ public class MethodHelper
{
out.print(Type.getReturnType(meth.desc));
out.print(" ");
- if (isBridgeTarget)
- {
- out.print("target$");
- out.print(meth.name);
- }
- else
- {
- out.print(Keywords.getCxxName(meth.name));
- }
+ out.print(realMethodName);
}
else
{