[kaffe] CVS kaffe (dalibor): Build fixes for kjc

Kaffe CVS cvs-commits at kaffe.org
Thu Sep 9 13:37:01 PDT 2004


PatchSet 5149 
Date: 2004/09/09 20:33:17
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Build fixes for kjc

2004-09-09  Dalibor Topic  <robilad at kaffe.org>

        * libraries/javalib/rebuildLib.in: Increased memory available
        to kjc to 512M. That should prevent it from running out of memory
        on class library builds.

        Reported by: Riccardo Mottola <rmottola at users.sf.net>

2004-09-09  Dalibor Topic  <robilad at kaffe.org>

        * libraries/javalib/java/awt/AWTKeyStroke.java
        (KeyStrokeConstructor, KeycodeInitializer): New internal classes
        to work around KJC problems.

        (AWTKeyStroke, registerSubclass): Use the new internal classes.

2004-09-09  Laszlo 'GCS' Boszormenyi <gcs at lsc.hu>

        * libraries/javalib/javax/swing/AbstractButton.java,
        libraries/javalib/javax/swing/JDesktopPane.java:
        Explicitely identify inner classes to work around KJC problems.

        Reported by: Riccardo Mottola <rmottola at users.sf.net>,
                     Gustavo Guillermo Perez <gustavo at compunauta.com>

Members: 
	ChangeLog:1.2705->1.2706 
	libraries/javalib/rebuildLib.in:1.41->1.42 
	libraries/javalib/java/awt/AWTKeyStroke.java:1.2->1.3 
	libraries/javalib/javax/swing/AbstractButton.java:1.4->1.5 
	libraries/javalib/javax/swing/JDesktopPane.java:1.2->1.3 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2705 kaffe/ChangeLog:1.2706
--- kaffe/ChangeLog:1.2705	Thu Sep  9 18:46:09 2004
+++ kaffe/ChangeLog	Thu Sep  9 20:33:17 2004
@@ -1,3 +1,28 @@
+2004-09-09  Dalibor Topic  <robilad at kaffe.org>
+
+	* libraries/javalib/rebuildLib.in: Increased memory available 
+	to kjc to 512M. That should prevent it from running out of memory
+	on class library builds.
+
+	Reported by: Riccardo Mottola <rmottola at users.sf.net>
+
+2004-09-09  Dalibor Topic  <robilad at kaffe.org>
+
+	* libraries/javalib/java/awt/AWTKeyStroke.java 
+	(KeyStrokeConstructor, KeycodeInitializer): New internal classes
+	to work around KJC problems.
+
+	(AWTKeyStroke, registerSubclass): Use the new internal classes.
+
+2004-09-09  Laszlo 'GCS' Boszormenyi <gcs at lsc.hu>
+
+	* libraries/javalib/javax/swing/AbstractButton.java,
+	libraries/javalib/javax/swing/JDesktopPane.java:
+	Explicitely identify inner classes to work around KJC problems.
+
+	Reported by: Riccardo Mottola <rmottola at users.sf.net>,
+	             Gustavo Guillermo Perez <gustavo at compunauta.com>
+
 2004-09-09  Guilhem Lavaux <guilhem at kaffe.org>
 
 	* config/i386/darwin/md.h, config/powerpc/darwin/md.h
Index: kaffe/libraries/javalib/rebuildLib.in
diff -u kaffe/libraries/javalib/rebuildLib.in:1.41 kaffe/libraries/javalib/rebuildLib.in:1.42
--- kaffe/libraries/javalib/rebuildLib.in:1.41	Mon Jun  7 19:14:28 2004
+++ kaffe/libraries/javalib/rebuildLib.in	Thu Sep  9 20:33:18 2004
@@ -40,9 +40,9 @@
 	fi
 	if [ -z "${JAVAC:-}" ]; then
 # Kaffe needs more than 64 M of memory to compile all of the
-# class library at once using kjc. Set maximal memory to 256 M
-# to be on the safe side. Actual usage is around 80M.
-		JAVAC="$JAVA -ss 500k -mx 256M at.dms.kjc.Main"
+# class library at once using kjc. Set maximal memory to 512 M
+# to be on the safe side. Actual usage is around 200M.
+		JAVAC="$JAVA -ss 500k -mx 512M at.dms.kjc.Main"
 		VERBOSE=-v
 	fi
 	BOOTCLASSPATH=${SRCDIR}/Klasses.jar.bootstrap:$BOOTCLASSPATH; export BOOTCLASSPATH
Index: kaffe/libraries/javalib/java/awt/AWTKeyStroke.java
diff -u kaffe/libraries/javalib/java/awt/AWTKeyStroke.java:1.2 kaffe/libraries/javalib/java/awt/AWTKeyStroke.java:1.3
--- kaffe/libraries/javalib/java/awt/AWTKeyStroke.java:1.2	Sun Aug  8 19:45:58 2004
+++ kaffe/libraries/javalib/java/awt/AWTKeyStroke.java	Thu Sep  9 20:33:19 2004
@@ -107,6 +107,33 @@
    */
   private static Constructor ctor;
 
+  private static class KeycodeInitializer implements PrivilegedAction
+  {
+    // Using reflection saves the hassle of keeping this in sync with KeyEvent,
+    // at the price of an expensive initialization.
+
+    public Object run()
+    {
+      Field[] fields = KeyEvent.class.getFields();
+      int i = fields.length;
+      try
+	{
+	  while (--i >= 0)
+	    {
+	      Field f = fields[i];
+	      String name = f.getName();
+	      if (name.startsWith("VK_"))
+		vktable.put(name.substring(3), f.get(null));
+	    }
+	}
+      catch (Exception e)
+	{
+	  throw (Error) new InternalError().initCause(e);
+	}
+      return null;
+    }
+  }
+
   /**
    * A table of keyCode names to values.
    *
@@ -115,31 +142,7 @@
   private static final HashMap vktable = new HashMap();
   static
   {
-    // Using reflection saves the hassle of keeping this in sync with KeyEvent,
-    // at the price of an expensive initialization.
-    AccessController.doPrivileged(new PrivilegedAction()
-      {
-        public Object run()
-        {
-          Field[] fields = KeyEvent.class.getFields();
-          int i = fields.length;
-          try
-            {
-              while (--i >= 0)
-                {
-                  Field f = fields[i];
-                  String name = f.getName();
-                  if (name.startsWith("VK_"))
-                    vktable.put(name.substring(3), f.get(null));
-                }
-            }
-          catch (Exception e)
-            {
-              throw (Error) new InternalError().initCause(e);
-            }
-          return null;
-        }
-      });
+    AccessController.doPrivileged(new KeycodeInitializer());
   }
 
   /**
@@ -216,6 +219,28 @@
     this.onKeyRelease = onKeyRelease;
   }
 
+  private static class KeyStrokeConstructor implements PrivilegedExceptionAction
+  {
+    private final Class subclass;
+
+    public KeyStrokeConstructor(final Class subclass)
+    {
+      this.subclass = subclass;
+    }
+
+    public Object run()
+      throws NoSuchMethodException, InstantiationException,
+      IllegalAccessException, InvocationTargetException
+    {
+      Constructor c = subclass.getDeclaredConstructor(null);
+      c.setAccessible(true);
+      // Create a new instance, to make sure that we can, and
+      // to cause any ClassCastException.
+      AWTKeyStroke dummy = (AWTKeyStroke) c.newInstance(null);
+      return c;
+    }
+  }
+
   /**
    * Registers a new subclass as being the type of keystrokes to generate in
    * the factory methods. This operation flushes the cache of stored keystrokes
@@ -243,21 +268,7 @@
        }
     try
       {
-        ctor = (Constructor) AccessController.doPrivileged
-          (new PrivilegedExceptionAction()
-            {
-              public Object run()
-                throws NoSuchMethodException, InstantiationException,
-                       IllegalAccessException, InvocationTargetException
-              {
-                Constructor c = subclass.getDeclaredConstructor(null);
-                c.setAccessible(true);
-                // Create a new instance, to make sure that we can, and
-                // to cause any ClassCastException.
-                AWTKeyStroke dummy = (AWTKeyStroke) c.newInstance(null);
-                return c;
-              }
-            });
+        ctor = (Constructor) AccessController.doPrivileged(new KeyStrokeConstructor(subclass));
       }
     catch (PrivilegedActionException e)
       {
Index: kaffe/libraries/javalib/javax/swing/AbstractButton.java
diff -u kaffe/libraries/javalib/javax/swing/AbstractButton.java:1.4 kaffe/libraries/javalib/javax/swing/AbstractButton.java:1.5
--- kaffe/libraries/javalib/javax/swing/AbstractButton.java:1.4	Tue Aug 10 16:17:31 2004
+++ kaffe/libraries/javalib/javax/swing/AbstractButton.java	Thu Sep  9 20:33:19 2004
@@ -303,7 +303,7 @@
    * A Java Accessibility extension of the AbstractButton.
      */
   protected abstract class AccessibleAbstractButton
-    extends AccessibleJComponent implements AccessibleAction, AccessibleValue,
+    extends JComponent.AccessibleJComponent implements AccessibleAction, AccessibleValue,
                                             AccessibleText
   {
     private static final long serialVersionUID = -5673062525319836790L;
Index: kaffe/libraries/javalib/javax/swing/JDesktopPane.java
diff -u kaffe/libraries/javalib/javax/swing/JDesktopPane.java:1.2 kaffe/libraries/javalib/javax/swing/JDesktopPane.java:1.3
--- kaffe/libraries/javalib/javax/swing/JDesktopPane.java:1.2	Tue Aug 17 17:55:05 2004
+++ kaffe/libraries/javalib/javax/swing/JDesktopPane.java	Thu Sep  9 20:33:19 2004
@@ -84,7 +84,7 @@
   /**
    * AccessibleJDesktopPane
    */
-  protected class AccessibleJDesktopPane extends AccessibleJComponent
+  protected class AccessibleJDesktopPane extends JComponent.AccessibleJComponent
   {
     /** DOCUMENT ME! */
     private static final long serialVersionUID = 6079388927946077570L;




More information about the kaffe mailing list