|
Message
From: cvs at opencores.org<cvs@o...>
Date: Fri Jun 1 18:53:50 CEST 2007
Subject: [cvs-checkins] MODIFIED: jop ...
Date: 00/07/06 01:18:53 Modified: jop/java/target/src/common/com/jopdesign/sys JVM.java Log: aastore in Java (JVM.java) Revision Changes Path 1.28 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.27&r2=1.28 (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.27 retrieving revision 1.28 diff -u -b -r1.27 -r1.28 --- JVM.java 30 May 2007 23:05:59 -0000 1.27 +++ JVM.java 1 Jun 2007 16:53:49 -0000 1.28 @@ -93,7 +93,33 @@ private static void f_lastore() { JVMHelp.noim(); /* jvm.asm */ } private static void f_fastore() { JVMHelp.noim();} private static void f_dastore() { JVMHelp.noim();} - private static void f_aastore() { 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(); + + 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); + } + */ + + // handle indirection + ref = Native.rdMem(ref); + // snapshot-at-beginning barrier + int oldVal = Native.rdMem(ref+index); + if (oldVal!=0 && Native.rdMem(oldVal+GC.OFF_SPACE)!=GC.toSpace) { + GC.push(oldVal); + } + Native.wrMem(value, ref+index); + } + } + private static void f_bastore() { JVMHelp.noim();} private static void f_castore() { JVMHelp.noim();} private static void f_sastore() { JVMHelp.noim();}
|
 |