[kaffe] CVS kaffe (guilhem): Imported two fixes from GNU Classpath.

2003-09-28 Thread Kaffe CVS
PatchSet 4079 
Date: 2003/09/29 05:55:19
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
Imported two fixes from GNU Classpath.

Members: 
ChangeLog:1.1674->1.1675 
libraries/javalib/java/text/DateFormat.java:1.15->1.16 
libraries/javalib/java/text/SimpleDateFormat.java:1.25->1.26 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1674 kaffe/ChangeLog:1.1675
--- kaffe/ChangeLog:1.1674  Mon Sep 29 03:05:27 2003
+++ kaffe/ChangeLog Mon Sep 29 05:55:19 2003
@@ -1,3 +1,9 @@
+2003-09-29  Guilhem Lavaux <[EMAIL PROTECTED]>
+
+   * libraries/javalib/java/text/SimpleDateFormat.java,
+   libraries/javalib/java/text/DateFormat.java: Synch'ed with GNU
+   Classpath.
+
 2003-09-29  Dalibor Topic <[EMAIL PROTECTED]>
 
* libraries/javalib/java/util/zip/GZIPInputStream.java:
@@ -42,6 +48,7 @@
Added prototypes for setupExceptionHandling,
cleanupExceptionHandling.
 
+>>> 1.1674
 2003-09-28  Guilhem Lavaux <[EMAIL PROTECTED]>
 
* libraries/javalib/java/nio/ByteBufferHelper.java: added missing
Index: kaffe/libraries/javalib/java/text/DateFormat.java
diff -u kaffe/libraries/javalib/java/text/DateFormat.java:1.15 
kaffe/libraries/javalib/java/text/DateFormat.java:1.16
--- kaffe/libraries/javalib/java/text/DateFormat.java:1.15  Tue Aug 26 15:03:10 
2003
+++ kaffe/libraries/javalib/java/text/DateFormat.java   Mon Sep 29 05:55:20 2003
@@ -225,6 +225,8 @@
   {
 if (obj instanceof Number)
   obj = new Date(((Number) obj).longValue());
+else if (! (obj instanceof Date))
+  throw new IllegalArgumentException ("Cannot format given Object as a Date");
 return format ((Date) obj, buf, pos);
   }
 
Index: kaffe/libraries/javalib/java/text/SimpleDateFormat.java
diff -u kaffe/libraries/javalib/java/text/SimpleDateFormat.java:1.25 
kaffe/libraries/javalib/java/text/SimpleDateFormat.java:1.26
--- kaffe/libraries/javalib/java/text/SimpleDateFormat.java:1.25Sun Aug 31 
23:13:34 2003
+++ kaffe/libraries/javalib/java/text/SimpleDateFormat.java Mon Sep 29 05:55:20 
2003
@@ -605,9 +605,8 @@
   {
 int fmt_index = 0;
 int fmt_max = pattern.length();
-Calendar loc_calendar = (Calendar)calendar.clone();
 
-loc_calendar.clear();
+calendar.clear();
 boolean saw_timezone = false;
 int quote_start = -1;
 boolean is2DigitYear = false;
@@ -755,8 +754,7 @@
found_zone = true;
saw_timezone = true;
TimeZone tz = TimeZone.getTimeZone (strings[0]);
-   loc_calendar.setTimeZone (tz);
-   loc_calendar.set (Calendar.ZONE_OFFSET, tz.getRawOffset ());
+   calendar.set (Calendar.ZONE_OFFSET, tz.getRawOffset ());
offset = 0;
if (k > 2 && tz instanceof SimpleTimeZone)
  {
@@ -823,17 +821,17 @@
  }
 
// Assign the value and move on.
-   loc_calendar.set(calendar_field, value);
+   calendar.set(calendar_field, value);
   }
 
 if (is2DigitYear)
   {
// Apply the 80-20 heuristic to dermine the full year based on 
// defaultCenturyStart. 
-   int year = defaultCentury + loc_calendar.get(Calendar.YEAR);
-   loc_calendar.set(Calendar.YEAR, year);
-   if (loc_calendar.getTime().compareTo(defaultCenturyStart) < 0)
- loc_calendar.set(Calendar.YEAR, year + 100);  
+   int year = defaultCentury + calendar.get(Calendar.YEAR);
+   calendar.set(Calendar.YEAR, year);
+   if (calendar.getTime().compareTo(defaultCenturyStart) < 0)
+ calendar.set(Calendar.YEAR, year + 100);  
   }
 
 try
@@ -842,10 +840,10 @@
  {
// Use the real rules to determine whether or not this
// particular time is in daylight savings.
-   loc_calendar.clear (Calendar.DST_OFFSET);
-   loc_calendar.clear (Calendar.ZONE_OFFSET);
+   calendar.clear (Calendar.DST_OFFSET);
+   calendar.clear (Calendar.ZONE_OFFSET);
  }
-return loc_calendar.getTime();
+return calendar.getTime();
   }
 catch (IllegalArgumentException x)
   {

___
kaffe mailing list
[EMAIL PROTECTED]
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe


Re: Freenet Re: [kaffe] CVS kaffe (guilhem): NIO+NET classes merging from GNU Classpath + KJC updates.

2003-09-28 Thread Guilhem Lavaux
Dalibor Topic wrote:

Kaffe CVS wrote:

PatchSet 4072 Date: 2003/09/28 19:53:51
Author: guilhem
Branch: HEAD
Tag: (none) Log:
NIO+NET classes merging from GNU Classpath + KJC updates.
This KJC should fix the past issue. Please report any misbehaviour 
(regression tests
work here).


In order to test the fresh NIO code, I've tried to run freenet 0.5.2.1 
[1] on top of kaffe from CVS. I've got a ton of those:

java.lang.NullPointerException
   at gnu.java.nio.SelectorImpl.deregisterCancelledKeys 
(SelectorImpl.java:234)
   at gnu.java.nio.SelectorImpl.select (SelectorImpl.java:146)
   at gnu.java.nio.SelectorImpl.selectNow (SelectorImpl.java:86)
   at freenet.transport.AbstractSelectorLoop.mySelect 
(AbstractSelectorLoop.java:394)
   at freenet.transport.WriteSelectorLoop.beforeSelect 
(WriteSelectorLoop.java:255)
   at freenet.transport.AbstractSelectorLoop.loop 
(AbstractSelectorLoop.java:505)
   at freenet.transport.WriteSelectorLoop.run 
(WriteSelectorLoop.java:617)
   at java.lang.Thread.run (Thread.java:321)

cheers,
dalibor topic
Anyway, there are some missing native calls. So it would have really 
astonished if it worked.

Cheers,
Guilhem.
___
kaffe mailing list
[EMAIL PROTECTED]
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe


[kaffe] CVS kaffe (dalibor): Merged in java/util/zip/GZIPInputStream from GNU Classpath

2003-09-28 Thread Kaffe CVS
PatchSet 4078 
Date: 2003/09/29 03:05:27
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Merged in java/util/zip/GZIPInputStream from GNU Classpath

Members: 
ChangeLog:1.1673->1.1674 
libraries/javalib/java/util/zip/GZIPInputStream.java:1.8->1.9 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1673 kaffe/ChangeLog:1.1674
--- kaffe/ChangeLog:1.1673  Mon Sep 29 02:16:47 2003
+++ kaffe/ChangeLog Mon Sep 29 03:05:27 2003
@@ -1,5 +1,10 @@
 2003-09-29  Dalibor Topic <[EMAIL PROTECTED]>
 
+   * libraries/javalib/java/util/zip/GZIPInputStream.java:
+   Replaced by implementation from GNU Classpath.
+   
+2003-09-29  Dalibor Topic <[EMAIL PROTECTED]>
+
* libraries/javalib/java/util/zip/InflaterInputStream.java:
Replaced by implementation from GNU Classpath.
 
Index: kaffe/libraries/javalib/java/util/zip/GZIPInputStream.java
diff -u kaffe/libraries/javalib/java/util/zip/GZIPInputStream.java:1.8 
kaffe/libraries/javalib/java/util/zip/GZIPInputStream.java:1.9
--- kaffe/libraries/javalib/java/util/zip/GZIPInputStream.java:1.8  Fri Aug 16 
18:04:31 2002
+++ kaffe/libraries/javalib/java/util/zip/GZIPInputStream.java  Mon Sep 29 03:05:28 
2003
@@ -1,118 +1,372 @@
-/*
- * Java core library component.
- *
- * Copyright (c) 1997, 1998
- *  Transvirtual Technologies, Inc.  All rights reserved.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file.
- */
+/* java.util.zip.GZIPInputStream
+   Copyright (C) 2001 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+ 
+GNU Classpath is distributed in the hope that it 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 for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
 
 package java.util.zip;
 
 import java.io.InputStream;
 import java.io.IOException;
+import java.io.EOFException;
 
-public class GZIPInputStream extends InflaterInputStream {
-
-protected CRC32 crc;
-protected boolean eos;
-private InputStream strm;
-
-public static final int GZIP_MAGIC = 0x1f8b;
-static final int OLD_GZIP_MAGIC= 0x1f9e;
-
-static final int GZIP_FLAG_ASCII_FLAG  = 0x01; // probably ascii text
-static final int GZIP_FLAG_CONTINUATION= 0x02; // continuation of
-   //  multi-part gzip file
-static final int GZIP_FLAG_EXTRA_FIELD = 0x04; // extra field present
-static final int GZIP_FLAG_ORIG_NAME   = 0x08; // file name present
-static final int GZIP_FLAG_COMMENT = 0x10; // file comment present
-static final int GZIP_FLAG_ENCRYPTED   = 0x20; // file is encrypted
-static final int GZIP_FLAG_RESERVED= 0xc0; // must be zero
-
-public GZIPInputStream(InputStream in) throws IOException {
-   this(in, 512);
-}
-
-public GZIPInputStream(InputStream in, int readsize) throws IOException {
-   super(in, new Inflater(true), readsize);
-   strm = in;
-   crc = new CRC32();
-   eos = false;
-
-/* Check GZIP header */
-checkBytes(new int[] { GZIP_MAGIC >> 8, OLD_GZIP_MAGIC >> 8 });
-checkBytes(new int[] { GZIP_MAGIC & 0xff, OLD_GZIP_MAGIC & 0xff });
-checkBytes(new int[] { Deflater.DEFLATED });
-
-   /* Get flags byte */
-   int flags = checkBytes(null);
-
-   /* Skip time stamp, extra flags, and O/S fields */
-ignoreBytes(6);
-
-   /* Check flags */
-   if ((flags & GZIP_FLAG_CONTINUATION) != 0) {// skip multi-part #
-   ignoreBytes(2);
- 

[kaffe] CVS kaffe (dalibor): Merged in java/util/zip/InflaterInputStream from GNU Classpath

2003-09-28 Thread Kaffe CVS
PatchSet 4077 
Date: 2003/09/29 02:16:47
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Merged in java/util/zip/InflaterInputStream from GNU Classpath

Members: 
ChangeLog:1.1672->1.1673 
libraries/javalib/java/util/zip/InflaterInputStream.java:1.5->1.6 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1672 kaffe/ChangeLog:1.1673
--- kaffe/ChangeLog:1.1672  Mon Sep 29 01:47:45 2003
+++ kaffe/ChangeLog Mon Sep 29 02:16:47 2003
@@ -1,5 +1,10 @@
 2003-09-29  Dalibor Topic <[EMAIL PROTECTED]>
 
+   * libraries/javalib/java/util/zip/InflaterInputStream.java:
+   Replaced by implementation from GNU Classpath.
+
+2003-09-29  Dalibor Topic <[EMAIL PROTECTED]>
+
* libraries/javalib/java/util/zip/CheckedInputStream.java,
libraries/javalib/java/util/zip/CheckedOutputStream.java:
Replaced by implementation from GNU Classpath.
Index: kaffe/libraries/javalib/java/util/zip/InflaterInputStream.java
diff -u kaffe/libraries/javalib/java/util/zip/InflaterInputStream.java:1.5 
kaffe/libraries/javalib/java/util/zip/InflaterInputStream.java:1.6
--- kaffe/libraries/javalib/java/util/zip/InflaterInputStream.java:1.5  Fri Aug 16 
18:04:31 2002
+++ kaffe/libraries/javalib/java/util/zip/InflaterInputStream.java  Mon Sep 29 
02:16:49 2003
@@ -1,108 +1,237 @@
+/* java.util.zip.InflaterInputStream
+   Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it 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 for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
 package java.util.zip;
 
 import java.io.FilterInputStream;
-import java.io.IOException;
 import java.io.InputStream;
+import java.io.IOException;
 
-/*
- * Java core library component.
+/**
+ * This filter stream is used to decompress data compressed in the "deflate"
+ * format. The "deflate" format is described in RFC 1951.
  *
- * Copyright (c) 1997, 1998
- *  Transvirtual Technologies, Inc.  All rights reserved.
+ * This stream may form the basis for other decompression filters, such
+ * as the GZIPInputStream.
  *
- * See the file "license.terms" for information on usage and redistribution
- * of this file.
+ * @author John Leuner
+ * @since 1.1
  */
-public class InflaterInputStream
-  extends FilterInputStream
+public class InflaterInputStream extends FilterInputStream
 {
-   final private static int DEFAULT = 512;
-   protected Inflater inf;
-   protected byte[] buf;
-   protected int len;
-
-public InflaterInputStream(InputStream in) {
-   this(in, new Inflater(), DEFAULT);
-}
-
-public InflaterInputStream(InputStream in, Inflater inf) {
-   this(in, inf, DEFAULT);
-}
-
-public InflaterInputStream(InputStream in, Inflater inf, int size) {
-   super(in);
-   if (in == null)
- throw new NullPointerException("in");
-   if (inf == null)
- throw new NullPointerException("inf");
-   this.inf = inf;
-   if (size < 1)
- throw new IllegalArgumentException("size < 1");
-   buf = new byte[size];
-}
-
-protected void fill() throws IOException {
-   len = super.read(buf, 0, buf.length);
-}
-
-public int read() throws IOException {
-   byte[] b = new byte[1];
-   int r = read(b, 0, 1);
-   if (r == -1) {
-   return (-1);
-   }
-   else {
-   return ((int)b[0]);
-   }
-}
-
-public int read(byte b[], int off, int lenx) throws IOException {
-   if

[kaffe] CVS kaffe (dalibor): Merged in java.util.zip.Checked*putStream from GNU Classpath

2003-09-28 Thread Kaffe CVS
PatchSet 4076 
Date: 2003/09/29 01:47:45
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Merged in java.util.zip.Checked*putStream from GNU Classpath

Members: 
ChangeLog:1.1671->1.1672 
libraries/javalib/java/util/zip/CheckedInputStream.java:1.1->1.2 
libraries/javalib/java/util/zip/CheckedOutputStream.java:1.1->1.2 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1671 kaffe/ChangeLog:1.1672
--- kaffe/ChangeLog:1.1671  Mon Sep 29 00:38:57 2003
+++ kaffe/ChangeLog Mon Sep 29 01:47:45 2003
@@ -1,5 +1,11 @@
 2003-09-29  Dalibor Topic <[EMAIL PROTECTED]>
 
+   * libraries/javalib/java/util/zip/CheckedInputStream.java,
+   libraries/javalib/java/util/zip/CheckedOutputStream.java:
+   Replaced by implementation from GNU Classpath.
+   
+2003-09-29  Dalibor Topic <[EMAIL PROTECTED]>
+
* libraries/javalib/java/util/zip/ZipConstants.java:
Merged in from GNU Classpath to get the right constant names.

Index: kaffe/libraries/javalib/java/util/zip/CheckedInputStream.java
diff -u kaffe/libraries/javalib/java/util/zip/CheckedInputStream.java:1.1 
kaffe/libraries/javalib/java/util/zip/CheckedInputStream.java:1.2
--- kaffe/libraries/javalib/java/util/zip/CheckedInputStream.java:1.1   Tue Jul 14 
17:02:10 1998
+++ kaffe/libraries/javalib/java/util/zip/CheckedInputStream.java   Mon Sep 29 
01:47:46 2003
@@ -1,51 +1,134 @@
-/*
- * Java core library component.
- *
- * Copyright (c) 1997, 1998
- *  Transvirtual Technologies, Inc.  All rights reserved.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file.
- */
+/* CheckedInputStream.java - Compute checksum of data being read
+   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+ 
+GNU Classpath is distributed in the hope that it 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 for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
 
 package java.util.zip;
 
-import java.io.InputStream;
 import java.io.FilterInputStream;
+import java.io.InputStream;
 import java.io.IOException;
 
-public class CheckedInputStream extends FilterInputStream {
-
-private Checksum cksum;
-
-public CheckedInputStream(InputStream in, Checksum sum)
-{
-   super(in);
-   cksum = sum;
-}
-
-public Checksum getChecksum()
-{
-   return (cksum);
-}
+/* Written using on-line Java Platform 1.2 API Specification
+ * and JCL book.
+ * Believed complete and correct.
+ */
 
-public int read() throws IOException
+/**
+ * InputStream that computes a checksum of the data being read using a
+ * supplied Checksum object.
+ *
+ * @see Checksum
+ *
+ * @author Tom Tromey
+ * @date May 17, 1999
+ */
+public class CheckedInputStream extends FilterInputStream
 {
-   int bval = in.read();
-   if (bval == -1) {
-   return (-1);
-   }
-   cksum.update(bval);
-   return (bval);
-}
+  /**
+   * Creates a new CheckInputStream on top of the supplied OutputStream
+   * using the supplied Checksum.
+   */
+  public CheckedInputStream (InputStream in, Checksum sum)
+  {
+super (in);
+this.sum = sum;
+  }
+
+  /**
+   * Returns the Checksum object used. To get the data checksum computed so
+   * far call getChecksum.getValue().
+   */
+  public Checksum getChecksum ()
+  {
+return sum;
+  }
+
+  /**
+   * Reads one byte, updates the checksum and returns the read byte
+   * (or -1 when the end of file was reached).
+   */
+  public int read () throw

[kaffe] Goodbye for Now

2003-09-28 Thread Rob Gonzalez
Hi guys,

I've had a great time working on the project on and off for the past year
or so.  As some of you know, I've been sortof in limbo lately, moving
around the east coast of the US without much access to my own computer.  
Tomorrow I'm leaving for Zurich from which I'll be backpacking to Beijing,
China, where I'll be teaching English for a while.  When I get to China
there's a chance that I'll be able to start working on Kaffe again, but if
that doesn't work out I'll probably be off the project until June, 2004,
when I get back to the states.

I regret that the verifier still needs some fixing before it can really go
prime-time.  Mainly it has to be able to deal with the multiple
inheritence involved with interfaces, but the style also needs some
fixing.  As Dalibor suggested, macros probably aren't the best way to go,
and they certainly have given me trouble when debugging the verifier,
which (unfortunately) relies heavily upon them.

Also, I will unfortunately be unable to make the conference in Saarbrucken
in early October due mostly to time constaints.


Finally for a shameless personal plug: if you're interested in hearing
about my trip at all, drop an email to [EMAIL PROTECTED] (to
unsubscribe it's [EMAIL PROTECTED]).  I have no idea with
what frequency I'll be posting, but because I'll be unable to write
personal emails for a while it's a lame attempt to keep my friends
up-to-date with my happenings.

This project has been moving forward at an amazing pace lately.  I have no
doubts that it's still going to be going strong when get back :)  I've
learned a ton by working on it and especially by reading the posts and
talking to the other developers.  Thanks guys.


cheers,
Rob


___
kaffe mailing list
[EMAIL PROTECTED]
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe


[kaffe] CVS kaffe (dalibor): Merged in java/util/zip/ZipConstants from Classpath

2003-09-28 Thread Kaffe CVS
PatchSet 4075 
Date: 2003/09/29 00:38:57
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Merged in java/util/zip/ZipConstants from Classpath

Members: 
ChangeLog:1.1670->1.1671 
libraries/javalib/java/util/zip/ZipConstants.java:1.7->1.8 
libraries/javalib/java/util/zip/ZipInputStream.java:1.14->1.15 
libraries/javalib/java/util/zip/ZipOutputStream.java:1.12->1.13 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1670 kaffe/ChangeLog:1.1671
--- kaffe/ChangeLog:1.1670  Sun Sep 28 22:30:18 2003
+++ kaffe/ChangeLog Mon Sep 29 00:38:57 2003
@@ -1,3 +1,12 @@
+2003-09-29  Dalibor Topic <[EMAIL PROTECTED]>
+
+   * libraries/javalib/java/util/zip/ZipConstants.java:
+   Merged in from GNU Classpath to get the right constant names.
+   
+   * libraries/javalib/java/util/zip/ZipOutputStream.java,
+   libraries/javalib/java/util/zip/ZipInputStream.java:
+   Modified to use the right zip constant names.
+
 2003-09-28  Dalibor Topic <[EMAIL PROTECTED]>
 
* kaffe/kaffevm/exception.h:
Index: kaffe/libraries/javalib/java/util/zip/ZipConstants.java
diff -u kaffe/libraries/javalib/java/util/zip/ZipConstants.java:1.7 
kaffe/libraries/javalib/java/util/zip/ZipConstants.java:1.8
--- kaffe/libraries/javalib/java/util/zip/ZipConstants.java:1.7 Sat Nov 24 01:52:55 
2001
+++ kaffe/libraries/javalib/java/util/zip/ZipConstants.java Mon Sep 29 00:38:59 
2003
@@ -1,78 +1,97 @@
-/*
- * Java core library component.
- *
- * Copyright (c) 1997, 1998
- *  Transvirtual Technologies, Inc.  All rights reserved.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file.
- */
+/* java.util.zip.ZipConstants
+   Copyright (C) 2001 Free Software Foundation, Inc.
 
-package java.util.zip;
-
-// This isn't documented so I don't know what it contains  !!!
-
-interface ZipConstants {
+This file is part of GNU Classpath.
 
-  int CEN_SIGNATURE = 0;
-  int CEN_VERSIONMADE = 4;
-  int CEN_VERSIONEXTRACT = 6;
-  int CEN_FLAGS = 8;
-  int CEN_METHOD = 10;
-  int CEN_TIME = 12;
-  int CEN_DATE = 14;
-  int CEN_CRC = 16;
-  int CEN_COMPRESSEDSIZE = 20;
-  int CEN_UNCOMPRESSEDSIZE = 24;
-  int CEN_FILENAMELEN = 28;
-  int CEN_EXTRAFIELDLEN = 30;
-  int CEN_FILECOMMENTLEN = 32;
-  int CEN_DISKNUMBER = 34;
-  int CEN_INTERNALATTR = 36;
-  int CEN_EXTERNALATTR = 38;
-  int CEN_LCLOFFSET = 42;
-
-  int CEN_RECSZ = 46;
-
-  long CEN_HEADSIG = 0x02014b50;
-
-  int END_SIGNATURE = 0;
-  int END_DISKNUMBER = 4;
-  int END_CENDISKNUMBER = 6;
-  int END_TOTALCENONDISK = 8;
-  int END_TOTALCEN = 10;
-  int END_CENSIZE = 12;
-  int END_CENOFFSET = 16;
-  int END_COMMENTLEN = 20;
-
-  int END_RECSZ = 22;
-
-  long END_ENDSIG = 0x06054b50;
-
-  int LOC_SIGNATURE = 0;
-  int LOC_VERSIONEXTRACT = 4;
-  int LOC_FLAGS = 6;
-  int LOC_METHOD = 8;
-  int LOC_TIME = 10;
-  int LOC_DATE = 12;
-  int LOC_CRC = 14;
-  int LOC_COMPRESSEDSIZE = 18;
-  int LOC_UNCOMPRESSEDSIZE = 22;
-  int LOC_FILENAMELEN = 26;
-  int LOC_EXTRAFIELDLEN = 28;
-
-  int LOC_RECSZ = 30;
-
-  long LOC_HEADSIG = 0x04034b50;
-
-  long DATA_HEADSIG = 0x08074b50;
-  int DATA_SIGNATURE = 0;
-  int DATA_CRC = 4;
-  int DATA_COMPRESSEDSIZE = 8;
-  int DATA_UNCOMPRESSEDSIZE = 12;
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it 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 for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
 
-  int DATA_RECSZ = 16;
+package java.util.zip;
 
-  int DEFLATED = 8;
-  int STORED = 0;
+interface Zi

[kaffe] CVS kaffe (dalibor): Refactored interpreter exception handling into separate functions

2003-09-28 Thread Kaffe CVS
PatchSet 4074 
Date: 2003/09/28 22:30:18
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Refactored interpreter exception handling into separate functions

Members: 
ChangeLog:1.1669->1.1670 
kaffe/kaffevm/exception.h:1.22->1.23 
kaffe/kaffevm/support.c:1.60->1.61 
kaffe/kaffevm/intrp/machine.c:1.32->1.33 
kaffe/kaffevm/intrp/machine.h:1.8->1.9 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1669 kaffe/ChangeLog:1.1670
--- kaffe/ChangeLog:1.1669  Sun Sep 28 20:07:15 2003
+++ kaffe/ChangeLog Sun Sep 28 22:30:18 2003
@@ -1,3 +1,22 @@
+2003-09-28  Dalibor Topic <[EMAIL PROTECTED]>
+
+   * kaffe/kaffevm/exception.h:
+   {INTERPRETER] removed vmExcept_setIntrpFrame, moved to
+   intrp/machine.c and renamed to setFrame.
+
+   * kaffe/kaffevm/support.c:
+   (callMethodA, callMethodV)[INTERPRETER] Call new functions in
+   machine.c.
+   
+   * kaffe/kaffevm/intrp/machine.c:
+   (setFrame, setupExceptionHandling, cleanupExceptionHandling) New
+   functions.
+   (virtualMachine) Call the new functions.
+
+   * kaffe/kaffevm/intrp/machine.h:
+   Added prototypes for setupExceptionHandling,
+   cleanupExceptionHandling.
+
 2003-09-28  Guilhem Lavaux <[EMAIL PROTECTED]>
 
* libraries/javalib/java/nio/ByteBufferHelper.java: added missing
Index: kaffe/kaffe/kaffevm/exception.h
diff -u kaffe/kaffe/kaffevm/exception.h:1.22 kaffe/kaffe/kaffevm/exception.h:1.23
--- kaffe/kaffe/kaffevm/exception.h:1.22Sun Jul 27 16:53:46 2003
+++ kaffe/kaffe/kaffevm/exception.h Sun Sep 28 22:30:19 2003
@@ -33,6 +33,7 @@
 struct Hjava_lang_Class;
 struct Hjava_lang_Object;
 struct Hjava_lang_Throwable;
+
 struct _methods;
 struct _errorInfo;
 
@@ -146,19 +147,6 @@
 {
JTHREAD_LONGJMP(frame->jbuf, 1);
 }
-
-#if defined(INTERPRETER)
-static inline void 
-vmExcept_setIntrpFrame(VmExceptHandler* eh, u4 pc, struct _methods* meth, struct 
Hjava_lang_Object* syncobj)
-{
-   assert(eh);
-   assert(meth);
-   
-   eh->meth = meth;
-   eh->frame.intrp.pc = pc;
-   eh->frame.intrp.syncobj = syncobj;
-}
-#endif
 
 static inline void 
 vmExcept_setSyncObj(VmExceptHandler* eh, struct Hjava_lang_Object* syncobj)
Index: kaffe/kaffe/kaffevm/support.c
diff -u kaffe/kaffe/kaffevm/support.c:1.60 kaffe/kaffe/kaffevm/support.c:1.61
--- kaffe/kaffe/kaffevm/support.c:1.60  Sun Aug 31 22:09:02 2003
+++ kaffe/kaffe/kaffevm/support.c   Sun Sep 28 22:30:19 2003
@@ -623,11 +623,7 @@
lockObject(syncobj);
}
 
-   vmExcept_setIntrpFrame(&mjbuf, 0, meth, syncobj);
-   if (tid != NULL && unhand(tid)->PrivateInfo != 0) {
-   mjbuf.prev = (VmExceptHandler*)unhand(tid)->exceptPtr;
-   unhand(tid)->exceptPtr = (struct Hkaffe_util_Ptr*)&mjbuf;
-   }
+   setupExceptionHandling(&mjbuf, meth, syncobj, tid);
 
/* Make the call - system dependent */
sysdepCallMethod(&call);
@@ -636,9 +632,7 @@
unlockObject(syncobj);
}
 
-   if (tid != NULL && unhand(tid)->PrivateInfo != 0) {
-   unhand(tid)->exceptPtr = (struct Hkaffe_util_Ptr*)mjbuf.prev;
-   }
+   cleanupExceptionHandling(&mjbuf, tid);
}
 #endif
if (!promoted && call.retsize == 1) {
@@ -843,11 +837,7 @@
lockObject(syncobj);
}
 
-   vmExcept_setIntrpFrame(&mjbuf, 0, meth, syncobj);
-   if (tid != NULL && unhand(tid)->PrivateInfo != 0) {
-   mjbuf.prev = (VmExceptHandler*)unhand(tid)->exceptPtr;
-   unhand(tid)->exceptPtr = (struct Hkaffe_util_Ptr*)&mjbuf;
-   }
+   setupExceptionHandling(&mjbuf, meth, syncobj, tid);
 
/* Make the call - system dependent */
sysdepCallMethod(&call);
@@ -856,9 +846,7 @@
unlockObject(syncobj);
}
 
-   if (tid != NULL && unhand(tid)->PrivateInfo != 0) {
-   unhand(tid)->exceptPtr = (struct Hkaffe_util_Ptr*)mjbuf.prev;
-   }
+   cleanupExceptionHandling(&mjbuf, tid);
}
 #endif
 }
Index: kaffe/kaffe/kaffevm/intrp/machine.c
diff -u kaffe/kaffe/kaffevm/intrp/machine.c:1.32 
kaffe/kaffe/kaffevm/intrp/machine.c:1.33
--- kaffe/kaffe/kaffevm/intrp/machine.c:1.32Sun Jul 27 16:53:47 2003
+++ kaffe/kaffe/kaffevm/intrp/machine.c Sun Sep 28 22:30:20 2003
@@ -168,11 +168,7 @@
/* If we have any exception handlers we must prepare to catch them.
 * We also need to catch if we are synchronised (so we can release it).
 */
-   vmExcept_setIntrpFrame(&mjbuf, 0, meth, mobj);
-   if (tid != NULL && unhand(tid)->PrivateInfo != 0) {
-   mjbuf.prev = (VmExceptHandler*)unhand(tid)->exceptPtr;
-

Freenet Re: [kaffe] CVS kaffe (guilhem): NIO+NET classes merging from GNU Classpath + KJC updates.

2003-09-28 Thread Dalibor Topic
Kaffe CVS wrote:
PatchSet 4072 
Date: 2003/09/28 19:53:51
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
NIO+NET classes merging from GNU Classpath + KJC updates.

This KJC should fix the past issue. Please report any misbehaviour (regression tests
work here).
In order to test the fresh NIO code, I've tried to run freenet 0.5.2.1 
[1] on top of kaffe from CVS. I've got a ton of those:

java.lang.NullPointerException
   at gnu.java.nio.SelectorImpl.deregisterCancelledKeys 
(SelectorImpl.java:234)
   at gnu.java.nio.SelectorImpl.select (SelectorImpl.java:146)
   at gnu.java.nio.SelectorImpl.selectNow (SelectorImpl.java:86)
   at freenet.transport.AbstractSelectorLoop.mySelect 
(AbstractSelectorLoop.java:394)
   at freenet.transport.WriteSelectorLoop.beforeSelect 
(WriteSelectorLoop.java:255)
   at freenet.transport.AbstractSelectorLoop.loop 
(AbstractSelectorLoop.java:505)
   at freenet.transport.WriteSelectorLoop.run (WriteSelectorLoop.java:617)
   at java.lang.Thread.run (Thread.java:321)

cheers,
dalibor topic
[1] http://freenetproject.org/snapshots/freenet-0.5.2.1.tar.gz

___
kaffe mailing list
[EMAIL PROTECTED]
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe


[kaffe] CVS kaffe (guilhem): NIO: added missing file.

2003-09-28 Thread Kaffe CVS
PatchSet 4073 
Date: 2003/09/28 20:07:15
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
NIO: added missing file.

Members: 
ChangeLog:1.1668->1.1669 
libraries/javalib/java/nio/ByteBufferHelper.java:INITIAL->1.1 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1668 kaffe/ChangeLog:1.1669
--- kaffe/ChangeLog:1.1668  Sun Sep 28 19:53:51 2003
+++ kaffe/ChangeLog Sun Sep 28 20:07:15 2003
@@ -1,5 +1,10 @@
 2003-09-28  Guilhem Lavaux <[EMAIL PROTECTED]>
 
+   * libraries/javalib/java/nio/ByteBufferHelper.java: added missing
+   file.
+
+2003-09-28  Guilhem Lavaux <[EMAIL PROTECTED]>
+
* libraries/javalib/gnu/java/net/PlainDatagramSocketImpl.java,
libraries/javalib/gnu/java/net/PlainSocketImpl.java,
libraries/javalib/gnu/java/net/SocketInputStream.java,
===
Checking out kaffe/libraries/javalib/java/nio/ByteBufferHelper.java
RCS:  /home/cvs/kaffe/kaffe/libraries/javalib/java/nio/ByteBufferHelper.java,v
VERS: 1.1
***
--- /dev/null   Sun Aug  4 19:57:58 2002
+++ kaffe/libraries/javalib/java/nio/ByteBufferHelper.java  Sun Sep 28 20:09:43 
2003
@@ -0,0 +1,437 @@
+/* ByteBufferImpl.java -- 
+   Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it 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 for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package java.nio;
+
+/**
+ * @author Michael Koch <[EMAIL PROTECTED]>
+ */
+final class ByteBufferHelper
+{
+  private static final void checkRemainingForRead (ByteBuffer buffer, int bytes)
+  {
+if (buffer.remaining() < bytes)
+  throw new BufferUnderflowException();
+  }
+  
+  private static final void checkRemainingForWrite (ByteBuffer buffer, int bytes)
+  {
+if (buffer.remaining() < bytes)
+  throw new BufferOverflowException();
+  }
+
+  private static final void checkAvailableForRead (ByteBuffer buffer,
+   int index, int bytes)
+  {
+if (buffer.limit() < (index + bytes))
+  throw new BufferUnderflowException();
+  }
+  
+  private static final void checkAvailableForWrite (ByteBuffer buffer,
+int index, int bytes)
+  {
+if (buffer.limit() < (index + bytes))
+  throw new BufferOverflowException();
+  }
+  
+  public static final char getChar (ByteBuffer buffer)
+  {
+checkRemainingForRead (buffer, 2);
+
+if (buffer.order() == ByteOrder.LITTLE_ENDIAN)
+  {
+return (char) ((buffer.get() & 0xff)
+   + ((buffer.get() & 0xff) << 8));
+  }
+
+return (char) (((buffer.get() & 0xff) << 8)
+   + (buffer.get() & 0xff));
+  }
+  
+  public static final ByteBuffer putChar (ByteBuffer buffer, char value)
+  {
+checkRemainingForWrite (buffer, 2);
+
+if (buffer.order() == ByteOrder.LITTLE_ENDIAN)
+  {
+buffer.put ((byte) (value & 0x00ff));
+buffer.put ((byte) ((value & 0xff00) >> 8));
+  }
+else
+  {
+buffer.put ((byte) ((value & 0xff00) >> 8));
+buffer.put ((byte) (value & 0x00ff));
+  }
+
+return buffer;
+  }
+  
+  public static final char getChar (ByteBuffer buffer, int index)
+  {
+checkAvailableForRead (buffer, index, 2);
+
+if (buffer.order() == ByteOrder.LITTLE_ENDIAN)
+  {
+return (char) ((buffer.get (index

[kaffe] CVS kaffe (guilhem): NIO+NET classes merging from GNU Classpath + KJC updates.

2003-09-28 Thread Kaffe CVS
PatchSet 4072 
Date: 2003/09/28 19:53:51
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
NIO+NET classes merging from GNU Classpath + KJC updates.

This KJC should fix the past issue. Please report any misbehaviour (regression tests
work here).

Members: 
ChangeLog:1.1667->1.1668 
include/Makefile.am:1.48->1.49 
include/Makefile.in:1.122->1.123 
libraries/clib/net/PlainDatagramSocketImpl.c:1.29->1.30 
libraries/clib/net/PlainSocketImpl.c:1.32->1.33 
libraries/javalib/Klasses.jar.bootstrap:1.38->1.39 
libraries/javalib/Makefile.am:1.135->1.136 
libraries/javalib/Makefile.in:1.183->1.184 
libraries/javalib/bootstrap.classlist:1.31->1.32 
libraries/javalib/essential.files:1.27->1.28 
libraries/javalib/kjc.jar:1.21->1.22 
libraries/javalib/gnu/java/net/PlainDatagramSocketImpl.java:INITIAL->1.1 
libraries/javalib/gnu/java/net/PlainSocketImpl.java:INITIAL->1.1 
libraries/javalib/gnu/java/net/SocketInputStream.java:INITIAL->1.1 
libraries/javalib/gnu/java/net/SocketOutputStream.java:INITIAL->1.1 
libraries/javalib/gnu/java/nio/DatagramChannelImpl.java:1.3->1.4 
libraries/javalib/gnu/java/nio/DatagramChannelSelectionKey.java:INITIAL->1.1 
libraries/javalib/gnu/java/nio/FileLockImpl.java:INITIAL->1.1 
libraries/javalib/gnu/java/nio/NIOConstants.java:INITIAL->1.1 
libraries/javalib/gnu/java/nio/NIODatagramSocket.java:INITIAL->1.1 
libraries/javalib/gnu/java/nio/NIOSocket.java:INITIAL->1.1 
libraries/javalib/gnu/java/nio/SelectionKeyImpl.java:1.3->1.4 
libraries/javalib/gnu/java/nio/SelectorImpl.java:1.2->1.3 
libraries/javalib/gnu/java/nio/SocketChannelImpl.java:1.5->1.6 
libraries/javalib/gnu/java/nio/SocketChannelSelectionKey.java:INITIAL->1.1 
libraries/javalib/java/net/DatagramSocket.java:1.15->1.16 
libraries/javalib/java/net/PlainDatagramSocketImpl.java:1.10->1.11(DEAD) 
libraries/javalib/java/net/PlainSocketImpl.java:1.17->1.18(DEAD) 
libraries/javalib/java/net/ServerSocket.java:1.16->1.17 
libraries/javalib/java/net/Socket.java:1.26->1.27 
libraries/javalib/java/net/SocketInputStream.java:1.8->1.9(DEAD) 
libraries/javalib/java/net/SocketOutputStream.java:1.4->1.5(DEAD) 
libraries/javalib/java/nio/ByteBufferImpl.java:1.2->1.3 
libraries/javalib/java/nio/DirectByteBufferImpl.java:1.2->1.3 
libraries/javalib/java/nio/MappedByteBufferImpl.java:1.1->1.2 
libraries/javalib/java/nio/channels/FileChannelImpl.java:1.1->1.2 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1667 kaffe/ChangeLog:1.1668
--- kaffe/ChangeLog:1.1667  Sun Sep 28 19:47:40 2003
+++ kaffe/ChangeLog Sun Sep 28 19:53:51 2003
@@ -1,3 +1,59 @@
+2003-09-28  Guilhem Lavaux <[EMAIL PROTECTED]>
+
+   * libraries/javalib/gnu/java/net/PlainDatagramSocketImpl.java,
+   libraries/javalib/gnu/java/net/PlainSocketImpl.java,
+   libraries/javalib/gnu/java/net/SocketInputStream.java,
+   libraries/javalib/gnu/java/net/SocketOutputStream.java,
+   Moved implementation dependent NET classes to gnu/java/net as
+   requested by new NET classes from GNU Classpath.
+   (PlainSocketImpl.getNativeFD) Added and also a field called native_fd.
+   (PlainDatagramSocketImpl.getNativeFD) Added and also a field called
+   native_fd.
+
+   * libraries/javalib/gnu/java/nio/DatagramChannelImpl.java,
+   libraries/javalib/gnu/java/nio/DatagramChannelSelectionKey.java,
+   libraries/javalib/gnu/java/nio/FileLockImpl.java,
+   libraries/javalib/gnu/java/nio/NIOConstants.java,
+   libraries/javalib/gnu/java/nio/NIODatagramSocket.java,
+   libraries/javalib/gnu/java/nio/NIOSocket.java,
+   libraries/javalib/gnu/java/nio/SelectionKeyImpl.java,
+   libraries/javalib/gnu/java/nio/SelectorImpl.java,
+   libraries/javalib/gnu/java/nio/SocketChannelImpl.java,
+   libraries/javalib/gnu/java/nio/SocketChannelSelectionKey.java,
+   libraries/javalib/java/nio/ByteBufferImpl.java,
+   libraries/javalib/java/nio/DirectByteBufferImpl.java,
+   libraries/javalib/java/nio/MappedByteBufferImpl.java,
+   libraries/javalib/java/nio/channels/FileChannelImpl.java:
+   Merged new NIO classes from GNU Classpath.
+
+   * libraries/javalib/java/net/DatagramSocket.java,
+   libraries/javalib/java/net/PlainDatagramSocketImpl.java,
+   libraries/javalib/java/net/PlainSocketImpl.java,
+   libraries/javalib/java/net/ServerSocket.java,
+   libraries/javalib/java/net/Socket.java,
+   libraries/javalib/java/net/SocketInputStream.java,
+   libraries/javalib/java/net/SocketOutputStream.java,
+   libraries/clib/net/PlainDatagramSocketImpl.c,
+   libraries/clib/net/PlainSocketImpl.c:
+   Updated NET classes from GNU Classpath. Native implementation must
+   initialize the new field called n

[kaffe] CVS kaffe (hkraemer): fixes and improvement for the garbage collector

2003-09-28 Thread Kaffe CVS
PatchSet 4071 
Date: 2003/09/28 19:47:40
Author: hkraemer
Branch: HEAD
Tag: (none) 
Log:
fixes and improvement for the garbage collector

* fixed the endless loop in startGC when running javalayer 0.3.0
* (hopefully) made the heap management more efficient

Members: 
ChangeLog:1.1666->1.1667 
kaffe/kaffevm/mem/gc-incremental.c:1.67->1.68 
kaffe/kaffevm/mem/gc-mem.c:1.46->1.47 
kaffe/kaffevm/mem/gc-mem.h:1.16->1.17 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1666 kaffe/ChangeLog:1.1667
--- kaffe/ChangeLog:1.1666  Sat Sep 27 12:37:46 2003
+++ kaffe/ChangeLog Sun Sep 28 19:47:40 2003
@@ -1,3 +1,25 @@
+2003-09-28  Helmer Kraemer  <[EMAIL PROTECTED]>
+
+   * kaffe/kaffevm/mem/gc-incremental.c:
+   (startGC, finaliserMan) properly deal with objects on the finaliser
+   list when starting a gc pass (fixes endless loop)
+   (createGC) initialise the heap and reserve primitive pages for OOM
+   handling
+   
+   * kaffe/kaffevm/gc-mem.h: (struct gc_block) added pnext and pprev
+   fields for management of primitive blocks; removed inuse field
+   (GCBLOCKINUSE) new macro to test whether a gc_block is used
+
+   replaced all uses of the inuse field by calls to the GCBLOCKINUSE
+   macro
+
+   * kaffe/kaffevm/gc-mem.c: (gc_get_prim_freelist, gc_add_to_prim_freelist,
+   gc_remove_from_prim_freelist, gc_merge_with_successor) new helper
+   methods for management of primitive blocks
+   (gc_primitive_alloc, gc_primitive_free) manage primitive blocks
+   using a best fit algorithm
+   (gc_heap_grow) don't forget to lock the gc_heap_lock 
+   
 2003-09-27  Guilhem Lavaux <[EMAIL PROTECTED]>
 
* libraries/javalib/kjc.jar: Fix for path method invocation.
Index: kaffe/kaffe/kaffevm/mem/gc-incremental.c
diff -u kaffe/kaffe/kaffevm/mem/gc-incremental.c:1.67 
kaffe/kaffe/kaffevm/mem/gc-incremental.c:1.68
--- kaffe/kaffe/kaffevm/mem/gc-incremental.c:1.67   Fri Aug 22 11:42:15 2003
+++ kaffe/kaffe/kaffevm/mem/gc-incremental.cSun Sep 28 19:47:41 2003
@@ -228,7 +228,7 @@
uintp p = (uintp) UTOMEM(unit) - gc_heap_base;
int idx;
 
-   if (!(p & (MEMALIGN - 1)) && p < gc_heap_range && info->inuse) {
+   if (!(p & (MEMALIGN - 1)) && p < gc_heap_range && GCBLOCKINUSE(info)) {
/* Make sure 'unit' refers to the beginning of an
 * object.  We do this by making sure it is correctly
 * aligned within the block.
@@ -246,7 +246,7 @@
 static inline void
 markObjectDontCheck(gc_unit *unit, gc_block *info, int idx)
 {
-   /* If object's been traced before, don't do it again */
+   /* If the object has been traced before, don't do it again. */
if (GC_GET_COLOUR(info, idx) != GC_COLOUR_WHITE) {
return;
}
@@ -382,15 +382,15 @@
}
 
info = GCMEM2BLOCK(mem);
-   if (!info->inuse) {
+   if (!GCBLOCKINUSE(info)) {
/* go down block list to find out whether we were hitting
 * in a large object
 */
-   while (!info->inuse && (uintp)info > (uintp)gc_block_base) {
+   while (!GCBLOCKINUSE(info) && (uintp)info > (uintp)gc_block_base) {
info--;
}
/* must be a large block, hence nr must be 1 */
-   if (!info->inuse || info->nr != 1) {
+   if (!GCBLOCKINUSE(info) || info->nr != 1) {
return (0);
}
}
@@ -663,6 +663,8 @@
 startGC(Collector *gcif)
 {
gc_unit* unit;
+   gc_block* info;
+   int idx;
 
gcStats.freedmem = 0;
gcStats.freedobj = 0;
@@ -685,10 +687,25 @@
/* measure time */
startTiming(&gc_time, "gctime-scan");
 
-   /* Walk all objects on the finalizer list */
+   /*
+* Since objects whose finaliser has to be run need to
+* be kept alive, we have to mark them here. They will
+* be put back into the finalise list later on during
+* the gc pass.
+*
+* Since these objects are treated like garbage, we have
+* to set their colour to white before marking them.
+*/
while (gclists[finalise].cnext != &gclists[finalise]) {
unit = gclists[finalise].cnext;
-   gcMarkObject(gcif, UTOMEM(unit));
+   info = GCMEM2BLOCK(unit);
+   idx = GCMEM2IDX(info, unit);
+
+   GC_SET_COLOUR (info, idx, GC_COLOUR_WHITE);
+   gcStats.finalobj -= 1;
+   gcStats.finalmem -= GCBLOCKSIZE(info);
+
+   markObjectDontCheck(unit, info, idx); 
}
 
(*walkRootSet)(gcif);
@@ -851,27 +868,52 @@
}
assert(finalRunning == true);
 
+   /*
+* Loop until the list of objects whose finaliser needs to be run is 
empty
+* [ checking 

[kaffe] CVS kaffe-extras (guilhem): Last update was containing a class cast misbehaviour when using 'super'. That on

2003-09-28 Thread Kaffe CVS
PatchSet 16 
Date: 2003/09/28 19:06:50
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
Last update was containing a class cast misbehaviour when using 'super'. That one 
should be
right (hopefully ;-) ).

Members: 
patches/kjc-method-call.diff:1.2->1.3 

Index: kaffe-extras/patches/kjc-method-call.diff
diff -u kaffe-extras/patches/kjc-method-call.diff:1.2 
kaffe-extras/patches/kjc-method-call.diff:1.3
--- kaffe-extras/patches/kjc-method-call.diff:1.2   Sun Sep 28 18:04:23 2003
+++ kaffe-extras/patches/kjc-method-call.diff   Sun Sep 28 19:06:50 2003
@@ -1,5 +1,59 @@
 kjc-suite-2.1B/src/kjc/JMethodCallExpression.java  2003-09-28 19:54:48.0 
+0200
-+++ kjc-suite-2.1B.new/src/kjc/JMethodCallExpression.java  2003-09-28 
19:48:12.0 +0200
+--- kjc-suite-2.1B/src/kjc/CMethod.java2003-09-28 21:02:42.0 +0200
 kjc-suite-2.1B.new/src/kjc/CMethod.java2003-09-28 20:46:29.0 +0200
+@@ -550,6 +550,7 @@
+   // --
+   // CODE GENERATION
+   // --
++  //
+ 
+   /**
+* Generates a sequence of bytecode
+@@ -557,7 +558,25 @@
+* @param   nonVirtual  force non-virtual dispatching
+*/
+   public void genCode(GenerationContext context, boolean nonVirtual) {
++genCode(context, null, nonVirtual);
++  }
++
++  /**
++   * Generates a sequence of bytecode
++   * @param   codethe code sequence
++   * @param prefixClass the class that should be used as a prefix in the 
method call.
++   * @param   nonVirtual  force non-virtual dispatching
++   */
++  public void genCode(GenerationContext context, CClass prefixClass,
++boolean nonVirtual) {
+ CodeSequence code = context.getCodeSequence();
++
++if (prefixClass == null)
++  prefixClass = owner;
++
++if (!prefixClass.descendsFrom(owner))
++  throw new IllegalArgumentException(
++  "prefixClass " + prefixClass + " doesn't descends from the owner " + owner + " 
of the method " + getIdent());
+ 
+ if (getOwner().isInterface()) {
+   int size = 0;
+@@ -566,7 +585,7 @@
+   size += parameters[i].getSize();
+   }
+ 
+-  code.plantInstruction(new InvokeinterfaceInstruction(getPrefixName(),
++  code.plantInstruction(new 
InvokeinterfaceInstruction(prefixClass.getQualifiedName(),
+  getIdent(),
+  getSignature(),
+  size + 1)); // this
+@@ -583,7 +602,7 @@
+   }
+ 
+   code.plantMethodRefInstruction(opcode,
+-   getPrefixName(),
++   prefixClass.getQualifiedName(),
+getIdent(),
+getSignature());
+ }
+--- kjc-suite-2.1B/src/kjc/JMethodCallExpression.java  2003-09-28 21:02:42.0 
+0200
 kjc-suite-2.1B.new/src/kjc/JMethodCallExpression.java  2003-09-28 
20:58:09.0 +0200
 @@ -40,7 +40,7 @@
 */
public JMethodCallExpression(TokenReference where,
@@ -18,7 +72,7 @@
  CReferenceType[]  exceptions = method.getThrowables();
  
  for (int i = 0; i < exceptions.length; i++) {
-@@ -281,6 +283,20 @@
+@@ -281,6 +283,21 @@
  return this; 
}
  
@@ -26,12 +80,13 @@
 +  {
 +prefixClass = null;
 +
-+if (prefix != null && !method.isStatic() && 
-+!method.getOwner().getJavaName().equals("java.lang.Object"))
-+  prefixClass = prefixType.getCClass();
++// Case already handled by findMethod.
++if (method.getOwner().getJavaName().equals("java.lang.Object") ||
++  prefix instanceof JSuperExpression)
++  return;
 +
-+if (prefix instanceof JSuperExpression)
-+  prefixClass = prefixType.getCClass().getSuperClass();
++if (prefix != null && !method.isStatic())
++  prefixClass = prefixType.getCClass();
 +else if (prefix instanceof JTypeNameExpression)
 +  prefixClass = ((JTypeNameExpression)prefix).getClassType().getCClass();
 +  }
@@ -39,7 +94,7 @@
protected void findMethod(CExpressionContext context, CClass local, CType[] 
argTypes)  throws PositionedError {
  TypeFactory factory = context.getTypeFactory();
  
-@@ -316,9 +332,20 @@
+@@ -316,9 +333,20 @@
  
try {
  if (! prefix.getType(factory).isTypeVariable()) {
@@ -63,7 +118,7 @@
  } else {
// find method in a type of the bound;
CReferenceType[]bound =  ((CTypeVariable) 
prefix.getType(factory)).getBounds();
-@@ -364,7 +391,7 @@
+@@ -364,7 +392,7 @@
}
throw new CMethodNotFoundError(getTokenReference(), this, prefixName + ident, 
argTypes);
  }
@@ -72,7 +127,7 @@
// --
// CODE GE

[kaffe] CVS kaffe-extras (guilhem): Updated KJC method call patch.

2003-09-28 Thread Kaffe CVS
PatchSet 15 
Date: 2003/09/28 18:04:23
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
Updated KJC method call patch.

To ensure compatibility we must follow JLS 13.1: java.lang.Object method
should be called directly, if a Typename is precised use it, if super is used
use super class type to call the method.

Members: 
patches/kjc-method-call.diff:1.1->1.2 

Index: kaffe-extras/patches/kjc-method-call.diff
diff -u kaffe-extras/patches/kjc-method-call.diff:1.1 
kaffe-extras/patches/kjc-method-call.diff:1.2
--- kaffe-extras/patches/kjc-method-call.diff:1.1   Sat Sep 27 12:26:40 2003
+++ kaffe-extras/patches/kjc-method-call.diff   Sun Sep 28 18:04:23 2003
@@ -1,61 +1,5 @@
-diff -x KjcScanner.java -ur kopi-2.1B/src/kjc/CMethod.java 
kjc-suite-2.1B.new/src/kjc/CMethod.java
 kopi-2.1B/src/kjc/CMethod.java 2003-09-26 19:29:48.0 +0200
-+++ kjc-suite-2.1B.new/src/kjc/CMethod.java2003-09-25 17:48:51.0 +0200
-@@ -550,6 +550,7 @@
-   // --
-   // CODE GENERATION
-   // --
-+  //
- 
-   /**
-* Generates a sequence of bytecode
-@@ -557,7 +558,25 @@
-* @param   nonVirtual  force non-virtual dispatching
-*/
-   public void genCode(GenerationContext context, boolean nonVirtual) {
-+genCode(context, null, nonVirtual);
-+  }
-+
-+  /**
-+   * Generates a sequence of bytecode
-+   * @param   codethe code sequence
-+   * @param prefixClass the class that should be used as a prefix in the 
method call.
-+   * @param   nonVirtual  force non-virtual dispatching
-+   */
-+  public void genCode(GenerationContext context, CClass prefixClass,
-+boolean nonVirtual) {
- CodeSequence code = context.getCodeSequence();
-+
-+if (prefixClass == null)
-+  prefixClass = owner;
-+
-+if (!prefixClass.descendsFrom(owner))
-+  throw new IllegalArgumentException(
-+  "prefixClass doesn't descends from the owner of the method");
- 
- if (getOwner().isInterface()) {
-   int size = 0;
-@@ -566,7 +585,7 @@
-   size += parameters[i].getSize();
-   }
- 
--  code.plantInstruction(new InvokeinterfaceInstruction(getPrefixName(),
-+  code.plantInstruction(new 
InvokeinterfaceInstruction(prefixClass.getQualifiedName(),
-  getIdent(),
-  getSignature(),
-  size + 1)); // this
-@@ -583,7 +602,7 @@
-   }
- 
-   code.plantMethodRefInstruction(opcode,
--   getPrefixName(),
-+   prefixClass.getQualifiedName(),
-getIdent(),
-getSignature());
- }
-diff -x KjcScanner.java -ur kopi-2.1B/src/kjc/JMethodCallExpression.java 
kjc-suite-2.1B.new/src/kjc/JMethodCallExpression.java
 kopi-2.1B/src/kjc/JMethodCallExpression.java   2002-07-15 20:53:33.0 
+0200
-+++ kjc-suite-2.1B.new/src/kjc/JMethodCallExpression.java  2003-09-26 
19:05:46.0 +0200
+--- kjc-suite-2.1B/src/kjc/JMethodCallExpression.java  2003-09-28 19:54:48.0 
+0200
 kjc-suite-2.1B.new/src/kjc/JMethodCallExpression.java  2003-09-28 
19:48:12.0 +0200
 @@ -40,7 +40,7 @@
 */
public JMethodCallExpression(TokenReference where,
@@ -74,21 +18,28 @@
  CReferenceType[]  exceptions = method.getThrowables();
  
  for (int i = 0; i < exceptions.length; i++) {
-@@ -281,6 +283,13 @@
+@@ -281,6 +283,20 @@
  return this; 
}
  
 +  protected void adjustMethodCall(CExpressionContext context, CClass local)
 +  {
-+// Make a stupid decision. Take the class in the prefix to build the call prefix.
-+if (prefix != null)
++prefixClass = null;
++
++if (prefix != null && !method.isStatic() && 
++!method.getOwner().getJavaName().equals("java.lang.Object"))
 +  prefixClass = prefixType.getCClass();
++
++if (prefix instanceof JSuperExpression)
++  prefixClass = prefixType.getCClass().getSuperClass();
++else if (prefix instanceof JTypeNameExpression)
++  prefixClass = ((JTypeNameExpression)prefix).getClassType().getCClass();
 +  }
 +
protected void findMethod(CExpressionContext context, CClass local, CType[] 
argTypes)  throws PositionedError {
  TypeFactory factory = context.getTypeFactory();
  
-@@ -316,9 +325,20 @@
+@@ -316,9 +332,20 @@
  
try {
  if (! prefix.getType(factory).isTypeVariable()) {
@@ -112,7 +63,7 @@
  } else {
// find method in a type of the bound;
CReferenceType[]bound =  ((CTypeVariable) 
prefix.getType(factory)).getBounds();
-@@ -364,7 +384,7 @@
+@@ -364,7 +391,7 @@
}
throw new CMethodNotFoundError(getTok

Re: [kaffe] IncompatibleClassChangeError

2003-09-28 Thread Guilhem Lavaux
Ito Kazumitsu wrote:

Hi,

Some of the regression test cases, SoTimeout, KaffeVerifyBug, Bean,
and MapTest, fail because of IncompatibleClassChangeError.
bash-2.05b$ java SoTimeout
java.lang.IncompatibleClassChangeError: java/net/SocketImpl.setOption
  at java.net.ServerSocket.setSoTimeout (ServerSocket.java:401)
  at SoTimeout.main (SoTimeout.java:51)
Failure:   Time out.
bash-2.05b$ java KaffeVerifyBug
java.lang.IncompatibleClassChangeError: java/net/SocketImpl.getOption
  at java.net.Socket.getLocalAddress (Socket.java:78)
  at java.net.Socket.isBound (Socket.java:1059)
  at java.net.Socket.connect (Socket.java:405)
  at java.net.Socket.connect (Socket.java:375)
  at java.net.Socket. (Socket.java:292)
  at java.net.Socket. (Socket.java:149)
  at KaffeVerifyBug.doit (KaffeVerifyBug.java:21)
  at KaffeVerifyBug.main (KaffeVerifyBug.java:9)
bash-2.05b$ java Bean
 Class: class Bean
 Method: public java.lang.String[] Bean.getArray()
 Method: public void Bean.setArray(int,java.lang.String)
 Method: public final void java.lang.Object.wait() throws java.lang.InterruptedException
 Method: public void Bean.setValue(java.lang.String)
 Method: public java.lang.String Bean.getValue()
 Method: public final void java.lang.Object.wait(long,int) throws java.lang.InterruptedException
 Method: public native int java.lang.Object.hashCode()
 Method: public final native java.lang.Class java.lang.Object.getClass()
 Method: public static void Bean.main(java.lang.String[])
 Method: public final native void java.lang.Object.notifyAll()
 Method: public final void java.lang.Object.wait(long) throws java.lang.InterruptedException
 Method: public java.lang.String Bean.getArray(int)
 Method: public java.lang.String java.lang.Object.toString()
 Method: public void Bean.setArray(java.lang.String[])
 Method: public final native void java.lang.Object.notify()
 Method: public boolean java.lang.Object.equals(java.lang.Object)
 Property: type class java.lang.Class, read public final native java.lang.Class java.lang.Object.getClass(), write 
 Editor: 
 Property: type class java.lang.String, read public java.lang.String Bean.getValue(), write public void Bean.setValue(java.lang.String)
java.lang.IncompatibleClassChangeError: java/beans/PropertyEditor.getClass
  at Bean.main (Bean.java:38)
bash-2.05b$ java MapTest
FAILURE: reproduce with these arguments: 30 1064708517339
java.lang.IncompatibleClassChangeError: java/util/Map.getClass
  at MapTest.checkMap (MapTest.java:51)
  at MapTest.main (MapTest.java:28)
 

Yeah, that's the error. :(

Cheers,
Guilhem.
___
kaffe mailing list
[EMAIL PROTECTED]
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe


Re: [kaffe] About IllegalAccessException...

2003-09-28 Thread Guilhem Lavaux
Ito Kazumitsu wrote:

Hi,

 

":" == Guilhem Lavaux <[EMAIL PROTECTED]> writes:
   

:> I think I found it by myself: it's the paragraph 15.12.4.1 of the Java 
:> Language Specification. I'm committing it now.

Thank you very much.  My problem has been solved.  This fix was
needed to run the development version of HSQLDB.
 

Please wait a minute before doing extensive testing. I noticed yesterday 
my patch introduced another bug which confuse things a little... 
(Especially if you try to call a.getClass() where 'a' is an object).

Cheers,
Guilhem.
___
kaffe mailing list
[EMAIL PROTECTED]
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe