harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r521703 - in /harmony/enhanced/drlvm/trunk: src/test/regression/H3110/ src/test/regression/H3110/FieldTest.java src/test/regression/H3110/run.test.xml vm/vmcore/src/util/em64t/base/ini_em64t.cpp
Date Fri, 23 Mar 2007 12:39:56 GMT
Author: varlax
Date: Fri Mar 23 05:39:55 2007
New Revision: 521703

URL: http://svn.apache.org/viewvc?view=rev&rev=521703
Log:
Applied HARMONY-3110 [drlvm][jit][x86_64] java.lang.reflect.Field.get(Object) returns incorrect
value of a float field
Added regression test

Added:
    harmony/enhanced/drlvm/trunk/src/test/regression/H3110/
    harmony/enhanced/drlvm/trunk/src/test/regression/H3110/FieldTest.java
    harmony/enhanced/drlvm/trunk/src/test/regression/H3110/run.test.xml
Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/ini_em64t.cpp

Added: harmony/enhanced/drlvm/trunk/src/test/regression/H3110/FieldTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H3110/FieldTest.java?view=auto&rev=521703
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H3110/FieldTest.java (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H3110/FieldTest.java Fri Mar 23 05:39:55
2007
@@ -0,0 +1,25 @@
+package org.apache.harmony.drlvm.tests.regression.H3110;
+
+import java.lang.reflect.*;
+import junit.framework.TestCase;
+
+public class FieldTest extends TestCase {
+
+    public float amount = .555f;
+
+    public void test_getFloat() throws Exception {
+            Field floatField = FieldTest.class.getField("amount");
+            FieldTest ft = new FieldTest();
+        
+            float fv = floatField.getFloat(ft);
+            assertEquals(amount, fv);
+    }
+
+    public void test_get() throws Exception {
+            Field floatField = FieldTest.class.getField("amount");
+            FieldTest ft = new FieldTest();
+        
+            Float fo = (Float) floatField.get(ft);
+            assertEquals(amount, fo.floatValue());
+    }
+}
\ No newline at end of file

Added: harmony/enhanced/drlvm/trunk/src/test/regression/H3110/run.test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H3110/run.test.xml?view=auto&rev=521703
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H3110/run.test.xml (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H3110/run.test.xml Fri Mar 23 05:39:55
2007
@@ -0,0 +1,9 @@
+<project name="RUN HARMONY-3110 Regression Test">
+    <target name="run-test">
+        <run-junit-test
+            test="org.apache.harmony.drlvm.tests.regression.H3110.FieldTest"
+            vmarg="-Xem:opt">
+        </run-junit-test>
+    </target>
+</project>
+

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/ini_em64t.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/ini_em64t.cpp?view=diff&rev=521703&r1=521702&r2=521703
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/ini_em64t.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/ini_em64t.cpp Fri Mar 23 05:39:55
2007
@@ -323,9 +323,9 @@
             break;
         case JAVA_TYPE_FLOAT:
             if (fr_nargs < MAX_FR) {
-                fr_args[fr_nargs++] = (double) args[arg_num++].f;
+                *(float *)&fr_args[fr_nargs++] = args[arg_num++].f;
             } else {
-                *(double *)(stack_args + stack_nargs) = (double) args[arg_num++].f;
+                *(float *)(stack_args + stack_nargs) = args[arg_num++].f;
                 ++stack_nargs;
             }
             break;



Mime
View raw message