|
Message
From: cvs at opencores.org<cvs@o...>
Date: Mon Jun 4 13:44:35 CEST 2007
Subject: [cvs-checkins] MODIFIED: jop ...
Date: 00/07/06 04:13:44 Modified: jop/java/target/src/common/com/jopdesign/sys JVM.java Log: aastore write-barrier Revision Changes Path 1.29 jop/java/target/src/common/com/jopdesign/sys/JVM.java http://www.opencores.org/cvsweb.shtml/jop/java/target/src/common/com/jopdesign/sys/JVM.java.diff?r1=1.28&r2=1.29 (In the diff below, changes in quantity of whitespace are not shown.) Index: JVM.java =================================================================== RCS file: /cvsroot/martin/jop/java/target/src/common/com/jopdesign/sys/JVM.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -b -r1.28 -r1.29 --- JVM.java 1 Jun 2007 16:53:49 -0000 1.28 +++ JVM.java 4 Jun 2007 11:44:35 -0000 1.29 @@ -95,20 +95,29 @@ private static void f_dastore() { JVMHelp.noim();} private static void f_aastore(int ref, int index, int value) { - if (ref==0) throw new NullPointerException(); - if (index<0 || index>=Native.rdMem(ref+GC.OFF_MTAB_ALEN)) - throw new ArrayIndexOutOfBoundsException(); +// JVMHelp.wr("aas"); + if ((ref&0x07)!=0) { + System.out.print("aas-problem ref="); + System.out.println(ref); + } + if (ref==0) throw new NullPointerException("yy"); + if (index<0 || index>=Native.rdMem(ref+GC.OFF_MTAB_ALEN)) { + + System.out.print("aastore: ref="); + System.out.println(ref); + System.out.print("aastore: index="); + System.out.println(index); + System.out.print("aastore: value="); + System.out.println(value); + System.out.print("aastore: len="); + System.out.println(Native.rdMem(ref+GC.OFF_MTAB_ALEN)); + System.out.print("aastore: type="); + System.out.println(Native.rdMem(ref+GC.OFF_TYPE)); - synchronized (GC.mutex) { - /* - // push the object on mark stack if not - // black - that's the what kind of - // write barrier? - if (ref!=0 && Native.rdMem(ref+GC.OFF_SPACE)!=GC.toSpace) { - GC.push(ref); + throw new ArrayIndexOutOfBoundsException("xx"); } - */ + synchronized (GC.mutex) { // handle indirection ref = Native.rdMem(ref); // snapshot-at-beginning barrier @@ -656,14 +665,14 @@ return objref; } - int p = Native.rdMem(objref+1); // handle indirection - p -= 4; // start of class info + int p = Native.rdMem(objref+GC.OFF_MTAB_ALEN); // ptr to MTAB + p -= GC.CLASS_HEADR; // start of class info for (;;) { if (p==cons) { return objref; } else { - p = Native.rdMem(p+2); + p = Native.rdMem(p+2); // super class ptr if (p==0) break; // we are at Object } } @@ -679,8 +688,8 @@ if (objref==0) { return 0; } - int p = Native.rdMem(objref+1); // handle indirection - p -= 4; // start of class info + int p = Native.rdMem(objref+GC.OFF_MTAB_ALEN); // handle indirection + p -= GC.CLASS_HEADR; // start of class info for (;;) { if (p==cons) { @@ -727,6 +736,7 @@ private static int f_multianewarray() { + JVMHelp.wr("multianewarray - GC issue?"); // // be careful! We have to manipulate the stack frame. // If the layout changes we have to change this method. @@ -813,9 +823,11 @@ private static void f_resE0() { JVMHelp.noim();} private static void f_putstatic_ref(int val, int addr) {
+// GC.log("psr");
synchronized (GC.mutex) {
// snapshot-at-beginning barrier
int oldVal = Native.rdMem(addr);
+// GC.log("psr-old", oldVal);
if (oldVal!=0 && Native.rdMem(oldVal+GC.OFF_SPACE)!=GC.toSpace) {
GC.push(oldVal);
}
@@ -825,6 +837,7 @@
private static void f_resE2() { JVMHelp.noim();}
private static void f_putfield_ref(int ref, int val, int index) {
+// GC.log("pfr");
if (ref==0) {
throw new NullPointerException();
}
@@ -838,10 +851,15 @@
}
*/
+// GC.log("pfr-ref", ref);
+// GC.log("pfr-val", val);
+// GC.log("pfr-index", index);
// handle indirection
ref = Native.rdMem(ref);
// snapshot-at-beginning barrier
int oldVal = Native.rdMem(ref+index);
+// GC.log("pfr-addr", ref);
+// GC.log("pfr-old", oldVal);
if (oldVal!=0 && Native.rdMem(oldVal+GC.OFF_SPACE)!=GC.toSpace) {
GC.push(oldVal);
}
|
 |