|
Message
From: cvs at opencores.org<cvs@o...>
Date: Sat Aug 19 20:39:36 CEST 2006
Subject: [cvs-checkins] MODIFIED: jop ...
Date: 00/06/08 19:20:39 Modified: jop/java/target/src/common/com/jopdesign/sys GC.java JVM.java Log: type 1 for reference array, type info for array copy Revision Changes Path 1.23 jop/java/target/src/common/com/jopdesign/sys/GC.java http://www.opencores.org/cvsweb.shtml/jop/java/target/src/common/com/jopdesign/sys/GC.java.diff?r1=1.22&r2=1.23 (In the diff below, changes in quantity of whitespace are not shown.) Index: GC.java =================================================================== RCS file: /cvsroot/martin/jop/java/target/src/common/com/jopdesign/sys/GC.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -b -r1.22 -r1.23 --- GC.java 19 Aug 2006 17:28:11 -0000 1.22 +++ GC.java 19 Aug 2006 18:39:35 -0000 1.23 @@ -38,9 +38,15 @@ static final int OFF_SIZE = 2; static final int OFF_TYPE = 3; + // use array types 4..11 are standard boolean to long + // our addition: + // 1 reference + // 0 a plain object static final int IS_OBJ = 0; static final int IS_REFARR = 1; - static final int IS_VALARR = 2; + + //!!! be carefule when changing the handle structure, it's + // used in System.arraycopy() and probably in jvm.asm!!! /** * Free and Use list. @@ -142,6 +148,10 @@ startTime = Native.rd(Const.IO_US_CNT); } + public static Object getMutex() { + return mutex; + } + static void addToFreeList(int ref) { // pointer to former freelist head Native.wrMem(freeList, ref+OFF_NEXT); @@ -293,16 +303,14 @@ // get pointer to object int addr = Native.rdMem(ref); int flags = Native.rdMem(ref+OFF_TYPE); - if (flags==IS_VALARR) { - // is an array - } else if (flags==IS_REFARR) { + if (flags==IS_REFARR) { // is an array of references size = Native.rdMem(addr-1); for (i=0; i<size; ++i) { push(Native.rdMem(addr+i)); } // However, multinewarray does probably NOT work - } else { + } else if (flags==IS_OBJ){ // it's a plain object // get pointer to method table @@ -317,6 +325,8 @@ } flags >>= 1; } + } else { + // it's a plain value array } } } @@ -487,7 +497,7 @@ return ref; } - static int newArray(int size, int type, boolean isRef) { + static int newArray(int size, int type) { // we are NOT using JVM var h at address 2 for the // heap pointer anymore. @@ -496,6 +506,7 @@ // long or double array if((type==11)||(type==7)) size <<= 1; + // reference array type is 0 (our convention) ++size; // for the additional size field @@ -524,11 +535,12 @@ ref = getHandle(allocPtr+1, size); } // ref. flags used for array marker - if (isRef) { - Native.wrMem(IS_REFARR, ref+OFF_TYPE); - } else {
- Native.wrMem(IS_VALARR, ref+OFF_TYPE);
- }
+// if (isRef) {
+// Native.wrMem(IS_REFARR, ref+OFF_TYPE);
+// } else {
+// Native.wrMem(IS_VALARR, ref+OFF_TYPE);
+// }
+ Native.wrMem(type, ref+OFF_TYPE);
// TODO: we also need the type (long/double)
// for a correct copy!
1.16 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.15&r2=1.16
(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.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- JVM.java 19 Aug 2006 18:38:23 -0000 1.15
+++ JVM.java 19 Aug 2006 18:39:35 -0000 1.16
@@ -634,7 +634,7 @@
synchronized (o) {
- ret = GC.newArray(count, type, false);
+ ret = GC.newArray(count, type);
/*
h = Native.rdIntMem(2); // get heap pointer
@@ -666,7 +666,7 @@
synchronized (o) {
- ret = GC.newArray(count, 1, true); //1..type not available=reference
+ ret = GC.newArray(count, 1); //1..type not available=reference
}
return ret;
}
|
 |