harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r599291 - in /harmony/enhanced/drlvm/trunk: src/test/regression/H5206/ src/test/regression/H5206/VolatileLongTest.java src/test/regression/H5206/run.test.xml vm/jitrino/src/jet/cg_fld_arr.cpp
Date Thu, 29 Nov 2007 06:17:58 GMT
Author: varlax
Date: Wed Nov 28 22:17:56 2007
New Revision: 599291

URL: http://svn.apache.org/viewvc?rev=599291&view=rev
Log:
Applied HARMONY-5206 [drlvm][jit][jet] vm.jvms.threads.threads110.threads11001 fails in JET
mode and passes in interpreter and OPT mode.
+Added regression test.

Added:
    harmony/enhanced/drlvm/trunk/src/test/regression/H5206/
    harmony/enhanced/drlvm/trunk/src/test/regression/H5206/VolatileLongTest.java   (with props)
    harmony/enhanced/drlvm/trunk/src/test/regression/H5206/run.test.xml   (with props)
Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_fld_arr.cpp

Added: harmony/enhanced/drlvm/trunk/src/test/regression/H5206/VolatileLongTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H5206/VolatileLongTest.java?rev=599291&view=auto
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H5206/VolatileLongTest.java (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H5206/VolatileLongTest.java Wed Nov 28
22:17:56 2007
@@ -0,0 +1,92 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.harmony.drlvm.tests.regression.h5206;
+
+import junit.framework.TestCase;
+
+public class VolatileLongTest extends TestCase {
+    private class Interrupter extends Thread {
+        Thread int_th;
+        long timeout;
+        Interrupter(Thread int_th, long timeout) {
+            this.int_th = int_th;
+            this.timeout = timeout;
+        }
+        public void run() {
+            try {
+                Thread.sleep(timeout);
+            } catch(Throwable ex) {
+            }
+            int_th.interrupt();
+        }
+    }
+    long lo;
+    long hi;
+    volatile long v;
+
+    public static void main(String[] args) {
+        new VolatileLongTest().test();
+    }
+
+    public void test() {
+        lo = 0x00000000FFFFFFFFL;
+        hi = 0xFFFFFFFF00000000L;
+        v = hi;
+
+        Thread t1 = new Thread() {
+            public void run() {
+                while (!isInterrupted()) {
+                    v = lo;
+                    v = hi;
+                }
+            }
+        };
+        Thread t2 = new Thread() {
+            public void run() {
+                while (!isInterrupted()) {
+                    v = hi;
+                    v = lo;
+                }
+            }
+        };
+
+        boolean passed = true;
+        long v_copy = 0;
+
+        t1.start();
+        t2.start();
+        new Interrupter(Thread.currentThread(), 10000).start();
+
+        while(!Thread.currentThread().interrupted()) {
+            Thread.yield();
+            v_copy = v;
+            if(v_copy != lo && v_copy != hi) {
+                passed = false;
+                break;
+            }
+        }
+
+        t1.interrupt();
+        t2.interrupt();
+
+        assertTrue("" + v_copy, passed);
+
+        System.out.println("PASSED");
+    }
+}
+

Propchange: harmony/enhanced/drlvm/trunk/src/test/regression/H5206/VolatileLongTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/drlvm/trunk/src/test/regression/H5206/run.test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H5206/run.test.xml?rev=599291&view=auto
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H5206/run.test.xml (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H5206/run.test.xml Wed Nov 28 22:17:56
2007
@@ -0,0 +1,33 @@
+<!-- 
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+     
+         http://www.apache.org/licenses/LICENSE-2.0
+     
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License. -->
+
+<project name="RUN HARMONY-5206 Regression Test">
+    <target name="run-test">
+        <run-junit-test 
+             test="org.apache.harmony.drlvm.tests.regression.h5206.VolatileLongTest"
+             vmarg="-Xem:jet">
+        </run-junit-test>
+        <!--run-junit-test 
+             test="org.apache.harmony.drlvm.tests.regression.h5206.VolatileLongTest"
+             vmarg="-Xint">
+        </run-junit-test-->
+        <run-junit-test 
+             test="org.apache.harmony.drlvm.tests.regression.h5206.VolatileLongTest"
+             vmarg="-Xem:opt">
+        </run-junit-test>
+    </target>
+</project>
+

Propchange: harmony/enhanced/drlvm/trunk/src/test/regression/H5206/run.test.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_fld_arr.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_fld_arr.cpp?rev=599291&r1=599290&r2=599291&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_fld_arr.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_fld_arr.cpp Wed Nov 28 22:17:56 2007
@@ -294,7 +294,7 @@
             // pop out ref
             vpop();
         }
-        if ( jt == jobj || fieldIsMagic ) {
+        if ( !is_ia32() && (jt == jobj || fieldIsMagic) ) {
             if (fieldIsMagic || !g_refs_squeeze) {
                 AR gr_ref = valloc(jobj);
                 rlock(gr_ref);
@@ -366,7 +366,7 @@
                           where.index(), where.scale());
         mov(where32, Opnd(ref));
     }
-    else if ( jt == jobj || fieldIsMagic ) {
+    else if ( !is_ia32() && (jt == jobj || fieldIsMagic) ) {
         // have the reference on a register
         Val& s0 = vstack(0, true);
         rlock(s0);



Mime
View raw message