[kaffe] CVS kaffe (dalibor): updated Klasses.jar.boostrap

2003-08-22 Thread Kaffe CVS
PatchSet 3970 
Date: 2003/08/22 09:02:39
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
updated Klasses.jar.boostrap

Members: 
ChangeLog:1.1567-1.1568 
libraries/javalib/Klasses.jar.bootstrap:1.32-1.33 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1567 kaffe/ChangeLog:1.1568
--- kaffe/ChangeLog:1.1567  Thu Aug 21 11:45:34 2003
+++ kaffe/ChangeLog Fri Aug 22 09:02:39 2003
@@ -1,3 +1,10 @@
+2003-08-22  Dalibor Topic [EMAIL PROTECTED],
+
+   * libraries/javalib/Klasses.jar.bootstrap:
+   Regenerated to fix build problems.
+
+   Reported by: Ito Kazumitsu [EMAIL PROTECTED]
+
 2003-08-21  Dalibor Topic [EMAIL PROTECTED],
 Helmer Kraemer  [EMAIL PROTECTED]
 
Index: kaffe/libraries/javalib/Klasses.jar.bootstrap
cvs rdiff: failed to read diff file header /tmp/cvsYQRt3h for Klasses.jar.bootstrap,v: 
end of file
system command returned non-zero exit status: 1: aborting

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


Re: [kaffe] core dumped during rebuildLib

2003-08-22 Thread Dalibor Topic
Hi Ito,

I believe the problem was due to my changes to java.lang.Class. I 
changed the interface of a native method. I've regenerated 
Klasses.jar.bootstrap and I hope that will fix it.

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


[kaffe] CVS kaffe (hkraemer): fixed mem leak in garbage collector

2003-08-22 Thread Kaffe CVS
PatchSet 3971 
Date: 2003/08/22 11:42:13
Author: hkraemer
Branch: HEAD
Tag: (none) 
Log:
fixed mem leak in garbage collector

Members: 
ChangeLog:1.1568-1.1569 
kaffe/kaffevm/mem/gc-incremental.c:1.66-1.67 
kaffe/kaffevm/mem/gc-mem.c:1.45-1.46 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1568 kaffe/ChangeLog:1.1569
--- kaffe/ChangeLog:1.1568  Fri Aug 22 09:02:39 2003
+++ kaffe/ChangeLog Fri Aug 22 11:42:13 2003
@@ -1,3 +1,13 @@
+2003-08-22  Helmer Kraemer  [EMAIL PROTECTED]
+
+   * kaffe/kaffevm/mem/gc-mem.c:
+   (gc_heap_free) properly free empty primitive blocks
+
+   * kaffe/kaffevm/mem/gc-incremental.c:
+   (gcWalkMemory, startGC, gcMan, finishGC,gcMalloc,createGC)
+   manage objects that have a finalizer and objects that don't
+   have one in different white and black lists
+   
 2003-08-22  Dalibor Topic [EMAIL PROTECTED],
 
* libraries/javalib/Klasses.jar.bootstrap:
Index: kaffe/kaffe/kaffevm/mem/gc-incremental.c
diff -u kaffe/kaffe/kaffevm/mem/gc-incremental.c:1.66 
kaffe/kaffe/kaffevm/mem/gc-incremental.c:1.67
--- kaffe/kaffe/kaffevm/mem/gc-incremental.c:1.66   Sat Jul 26 16:50:51 2003
+++ kaffe/kaffe/kaffevm/mem/gc-incremental.cFri Aug 22 11:42:15 2003
@@ -47,11 +47,12 @@
 Hjava_lang_Thread* garbageman;
 static Hjava_lang_Thread* finalman;
 
-static gcList gclists[5];
-static const int mustfree = 4; /* temporary list */
-static const int white = 3;
-static const int grey = 2;
-static const int black = 1;
+static gcList gclists[6];
+static const int nofin_white = 5;
+static const int fin_white = 4;
+static const int grey = 3;
+static const int nofin_black = 2;
+static const int fin_black = 1;
 static const int finalise = 0;
 
 static int gc_init = 0;
@@ -430,8 +431,26 @@
info = GCMEM2BLOCK(unit);
idx = GCMEM2IDX(info, unit);
 
+   if (GC_GET_COLOUR(info, idx) == GC_COLOUR_BLACK) {
+   return;
+   }
+
UREMOVELIST(unit);
-   UAPPENDLIST(gclists[black], unit);
+
+   /* if the object is about to be finalized, put it directly
+* into the finalise list, otherwise put it into the black
+* list.
+*/
+   if (GC_GET_STATE(info, idx) == GC_STATE_INFINALIZE) {
+   gcStats.finalobj += 1;
+   gcStats.finalmem += GCBLOCKSIZE(info);
+   UAPPENDLIST(gclists[finalise], unit);
+   } else if (GC_GET_STATE(info, idx) == GC_STATE_NEEDFINALIZE) {
+   UAPPENDLIST(gclists[fin_black], unit);
+   } else {
+   UAPPENDLIST(gclists[nofin_black], unit);
+   }
+   
GC_SET_COLOUR(info, idx, GC_COLOUR_BLACK);
 
assert(GC_GET_FUNCS(info, idx)  
@@ -474,7 +493,6 @@
 gcMan(void* arg)
 {
gc_unit* unit;
-   gc_unit* nunit;
gc_block* info;
int idx;
Collector *gcif = (Collector*)arg;
@@ -554,27 +572,33 @@

startGC(gcif);
 
-   for (unit = gclists[grey].cnext; unit != gclists[grey]; unit = 
gclists[grey].cnext) {
+   /* process any objects found by walking the root references */
+   while (gclists[grey].cnext != gclists[grey]) {
+   unit = gclists[grey].cnext;
gcWalkMemory(gcif, UTOMEM(unit));
}
+
/* Now walk any white objects which will be finalized.  They
 * may get reattached, so anything they reference must also
 * be live just in case.
 */
-   for (unit = gclists[white].cnext; unit != gclists[white]; unit = 
nunit) {
-   nunit = unit-cnext;
+   while (gclists[fin_white].cnext != gclists[fin_white]) {
+   unit = gclists[fin_white].cnext;
info = GCMEM2BLOCK(unit);
idx = GCMEM2IDX(info, unit);
-   if (GC_GET_STATE(info, idx) == GC_STATE_NEEDFINALIZE) {
-   /* this assert is somewhat expensive */
-   DBG(GCDIAG,
-   assert(gc_heap_isobject(info, unit)));
-   GC_SET_STATE(info, idx, GC_STATE_INFINALIZE);
-   markObjectDontCheck(unit, info, idx);
-   }
+   
+   assert (GC_GET_STATE(info, idx) == GC_STATE_NEEDFINALIZE);
+
+   /* this assert is somewhat expensive */
+   DBG(GCDIAG,
+   assert(gc_heap_isobject(info, unit)));
+   GC_SET_STATE(info, idx, GC_STATE_INFINALIZE);
+   markObjectDontCheck(unit, info, idx);
}
-   /* We may now have more grey objects, so walk them */
-   for (unit = gclists[grey].cnext; unit != gclists[grey]; unit = 
gclists[grey].cnext) {
+
+   /* now 

Re: [kaffe] CVS kaffe (hkraemer): fixed mem leak in garbage collector

2003-08-22 Thread Dalibor Topic
Kaffe CVS wrote:
PatchSet 3971 
Date: 2003/08/22 11:42:13
Author: hkraemer
Branch: HEAD
Tag: (none) 
Log:
fixed mem leak in garbage collector
Great catch, Helmer! Now I'm able to run japitools 0.9.3 on kaffe (when 
I build kaffe's class library with kjc, jode has problems parsing 
java1.4's class file format properly, which is what jikes 1.18 generates 
by default).

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


[kaffe] CVS kaffe (dalibor): Fix for RMI examples from RMI Trail of Sun's Java Tutorial from http://java.sun.

2003-08-22 Thread Kaffe CVS
PatchSet 3973 
Date: 2003/08/22 13:24:40
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Fix for RMI examples from RMI Trail of Sun's Java Tutorial from 
http://java.sun.com/docs/books/tutorial/rmi/index.html.

RMInputStream loads its classes using java.rmi.server.RMIClassLoader. The class loader 
should link the classes it loads, otherwise we get crashes.

The rest is a fix for deserialization. Field types are passed as signatures, not class 
names. That means, it's not such a good idea, to pass them to Class.forName directly. 
I'm letting the TypeSignature thingy do the work now (like it was in the original 
Classpath code), but I'm also passing the class loader through, which is supposed to 
be used to load the classes.

Members: 
ChangeLog:1.1570-1.1571 
libraries/javalib/gnu/java/lang/reflect/TypeSignature.java:1.1-1.2 
libraries/javalib/java/io/ObjectInputStream.java:1.24-1.25 
libraries/javalib/java/io/ObjectStreamField.java:1.2-1.3 
libraries/javalib/java/rmi/server/RMIClassLoader.java:1.2-1.3 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1570 kaffe/ChangeLog:1.1571
--- kaffe/ChangeLog:1.1570  Fri Aug 22 12:26:42 2003
+++ kaffe/ChangeLog Fri Aug 22 13:24:40 2003
@@ -1,5 +1,26 @@
 2003-08-22  Helmer Kraemer  [EMAIL PROTECTED]
 
+   * gnu/java/lang/reflect/TypeSignature.java:
+   (getClassForEncoding) added new method that accepts a class loader
+   and uses it to load and link the requested class.
+   
+   * java/io/ObjectInputStream.java:
+   (readClassDescriptor) Field types are passed as signatures, not
+   class names. That means it's not such a good idea to pass them
+   to Class.forName directly. 
+   (resolveClass) use Class.forName with given class loader. removed
+   resolveClass(String).
+   (currentLoader) new helper method.
+   
+   * java/io/ObjectStreamField.java:
+   (ObjectStreamField) new constructor that accepts a class loader
+   parameter and uses it load the requested type.
+
+   * java/rmi/server/RMIClassLoader.java:
+   (loadClass) link classes that get loaded, otherwise kaffe crashes.
+   
+2003-08-22  Helmer Kraemer  [EMAIL PROTECTED]
+
* kaffe/kaffevm/mem/gc-mem.c:
(gc_heap_free) properly free empty primitive blocks
 
Index: kaffe/libraries/javalib/gnu/java/lang/reflect/TypeSignature.java
diff -u kaffe/libraries/javalib/gnu/java/lang/reflect/TypeSignature.java:1.1 
kaffe/libraries/javalib/gnu/java/lang/reflect/TypeSignature.java:1.2
--- kaffe/libraries/javalib/gnu/java/lang/reflect/TypeSignature.java:1.1Wed 
May 21 10:42:29 2003
+++ kaffe/libraries/javalib/gnu/java/lang/reflect/TypeSignature.javaFri Aug 22 
13:24:42 2003
@@ -150,6 +150,12 @@
   public static Class getClassForEncoding(String type_code, boolean descriptor)
 throws ClassNotFoundException
   {
+return getClassForEncoding(type_code, descriptor, null);
+  }
+
+  public static Class getClassForEncoding(String type_code, boolean descriptor, 
ClassLoader loader)
+throws ClassNotFoundException
+  {
 if (descriptor)
   {
 switch (type_code.charAt(0))
@@ -181,7 +187,7 @@
   case '[':
   }
   }
-return Class.forName(type_code.replace('/', '.'));
+return Class.forName(type_code.replace('/', '.'), true, loader);
   }
 
   /**
Index: kaffe/libraries/javalib/java/io/ObjectInputStream.java
diff -u kaffe/libraries/javalib/java/io/ObjectInputStream.java:1.24 
kaffe/libraries/javalib/java/io/ObjectInputStream.java:1.25
--- kaffe/libraries/javalib/java/io/ObjectInputStream.java:1.24 Wed Aug 20 06:19:16 
2003
+++ kaffe/libraries/javalib/java/io/ObjectInputStream.java  Fri Aug 22 13:24:42 
2003
@@ -455,21 +455,13 @@
if (type_code == 'L' || type_code == '[')
{
  class_name = (String)readObject ();
- /* We need to fully resolve only when an object is concerned.
-  * in the other case just use TypeSignature
-  */
- if (class_name.charAt(0) == 'L')
-   of = new ObjectStreamField (field_name,
-  resolveClass(class_name.substring(1,
-  class_name.length()-1)));
- else
-   of = new ObjectStreamField (field_name, class_name);
}
else
{
  class_name = String.valueOf (type_code);
- of = new ObjectStreamField (field_name, class_name);
-   }
+}
+   
+of = new ObjectStreamField (field_name, class_name, currentLoader());

fields[i] = of;
   }
@@ -592,22 +584,16 @@
   protected Class resolveClass (ObjectStreamClass osc)
 throws ClassNotFoundException, IOException
   {
-return resolveClass (osc.getName ());
+return Class.forName (osc.getName(), true, currentLoader()); 
   }
 
-  private Class resolveClass (String class_name)
- throws ClassNotFoundException, IOException
+  private ClassLoader 

Re: [kaffe] CVS kaffe (hkraemer): fixed mem leak in garbage collector

2003-08-22 Thread Timothy Stack
On Friday, August 22, 2003, at 05:43 AM, Kaffe CVS wrote:

PatchSet 3971
Date: 2003/08/22 11:42:13
Author: hkraemer
Branch: HEAD
Tag: (none)
Log:
fixed mem leak in garbage collector
Can you elaborate on what was going on here?

thanks,

tim

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


Re: [kaffe] Kaffe Party/Documentation/Tools/Pizza/Development fund?

2003-08-22 Thread Jim Pick
Toad wrote:

 So the question I wonder about is whether money would be of any use to a
 different project, one that I personally would give moderate amounts if
 it produced a clear benefit. Since what we did is out of the question,
 not having an unemployable programmer in your mist (stupid me for not
 going to university... I'd have fucked it up though...), is there
 anything else that it could be used for?

I can think of lots of fun ways to blow some money.  Some ideas: 
t-shirts, mugs, pizza, beer, hardware.  I'm not sure how to make that
translate into a clear benefit (eg. quality code) though.  Beer might
actually be counter-productive.  :-)

We could try to do some marketing - eg. go to various conferences and
do presentations.  That might attract some more developers.

I remember that, a few years ago, cosource.com seemed had a tiny bit of
momentum doing the free software bounty thing, but it seems to have
died.

  If somebody did want to give money, I'm sure some contributors might be
  able to use it.  Since a lot of work is being done on Kaffe in an
  academic environment, maybe a scholarship would be a nice thing to be
  able to offer to some starving student...
 
 Well, I would like to give some money, if there was a use for it.
 What's a scholarship, exactly? Paying the full $50,000 tuition fees for
 somebody to go through uni? That could pay my personal salary for three
 years, or a typical UK programmer's for a year. So I presume you meant
 something else :)

The only scholarship I ever got was one-time grant of $2500 (CDN$)
from the British Columbia government when I got out of high school.
Every bit helps - that's equivalent to a lot of hours of working at
Starbucks for minimum wage.  I think grants to non-students would be
cool too.

Personally, I'm not too motivated to set up anything that involves
paperwork.  But if somebody wants to put up some seed money for a grant
or scholarship of some sort, and it could be done through some other
organization (eg. Freenet, FSF, SPI, OSDL, OPG, etc.), I think that
would be really cool.  We could definitely do a webpage for it and/or an
announcement.

Cheers,

 - Jim

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


Re: [kaffe] Kaffe Party/Documentation/Tools/Pizza/Development fund?

2003-08-22 Thread kaffe-admin
On Fri, Aug 22, 2003 at 11:09:19AM -0700, Jim Pick wrote:
 On Fri, 22 Aug 2003 17:02:29 +0100
 Toad [EMAIL PROTECTED] wrote:
 
  It seems to me that a significant number of people would donate hard
  cash to a Kaffe fund of some type, as long as there was sufficient
  transparency in its use (we solved this problem at Freenet by setting up
  a 501(c)(3); it pays my salary now; other projects, handling less money,
  have dealt with this differently e.g. Wine). There are various things it
  could be used for; I suspect you know them better than I do. At FP.org,
  we use it mainly to pay for me (but I work rather cheap by US
  standards - $18K/annum at present), and for web hosting. Does Kaffe need 
  any particular technical resources at the moment? Is there anything else
  that money could be used for for the clear and unambiguous benefit of
  Kaffe as a free software project?
 
 My personal preference is to not have to handle money.  I did add a
 sponsorship page to the website to try to raise some money to pay for
 the colocated server costs -- the server is colocated at
 communitycolo.net, which is a 501(c)(3) itself.  I haven't gotten any
 outside offers of sponsorship yet, though.

Indeed. The love of money is the root of all evil. The lack of money is
the root of all starvation :)
 
 Speaking for myself, I'm just doing it in my spare time for fun.  When
 Transvirtual was still alive, it was sort of related to my job, but
 Transvirtual is gone now.  I don't think the free software business

business is the problem. I work for a nonprofit. We don't have
shareholders. We don't need most of our cash to walk out the back door
to overpaid upper management and shareholders who are not necessary in
the first place without the need to buy offices etc. Cathedrals of
inefficiency, just like the copyright system they created :)

Okay, that may start a flame war... please respond to me personally if
that is your intent :)

 model worked very well -- I think Kaffe will do best as a pure
 community-run free software project.  I don't think I'd personally be
 motivated to work on it for grants of money -- I already have a pretty
 good career here in the Silicon Valley area.

Well, in that case, there will always be commercial software, and it
will always have the power to pass stupid laws to ban free software, and
we won't be able to do anything about it because we will work for the
corporations agitating for the stupid laws (even if we work in
hardware). On a more practical level, yes, it does not make sense to
just give money to people who would have worked on the project anyway.
They will end up squabbling about it and causing all sorts of problems.
One possible solution would be bounties for fixing a particular bug or
getting a particular application or IO subsystem working. The problem
with this is that progress is generally from many sources. I see that it
has worked pretty well for my own project, because of some slightly
bizarre circumstances, and we have seen fairly rapid progress. Of course
we have a lot of press coverage, and we are a cool, rather
politicized, whether we want to be or not, project... So the question I
wonder about is whether money would be of any use to a different
project, one that I personally would give moderate amounts if it
produced a clear benefit. Since what we did is out of the question, not
having an unemployable programmer in your mist (stupid me for not going
to university... I'd have fucked it up though...), is there anything
else that it could be used for?
 
 If somebody did want to give money, I'm sure some contributors might be
 able to use it.  Since a lot of work is being done on Kaffe in an
 academic environment, maybe a scholarship would be a nice thing to be
 able to offer to some starving student...

Well, I would like to give some money, if there was a use for it.
What's a scholarship, exactly? Paying the full $50,000 tuition fees for
somebody to go through uni? That could pay my personal salary for three
years, or a typical UK programmer's for a year. So I presume you meant
something else :)
 
 Cheers,
 
  - Jim

-- 
Matthew J Toseland - [EMAIL PROTECTED]
Freenet Project Official Codemonkey - http://freenetproject.org/
ICTHUS - Nothing is impossible. Our Boss says so.


pgp0.pgp
Description: PGP signature