harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfur...@apache.org
Subject svn commit: r580334 - in /harmony/enhanced/drlvm/trunk: src/test/regression/H4866/ src/test/regression/H4874/ vm/jitrino/src/shared/ vm/vmcore/src/jit/
Date Fri, 28 Sep 2007 12:57:42 GMT
Author: mfursov
Date: Fri Sep 28 05:57:41 2007
New Revision: 580334

URL: http://svn.apache.org/viewvc?rev=580334&view=rev
Log:
Fix for HARMONY-4874 [drlvm][jit] Incorrect handling of negative zero double type in Jitrino

with regression test

Fix for HARMONY-4866 [drlvm][jit] Lazy resolution invokes fails if object is null 
with regresstion test


Added:
    harmony/enhanced/drlvm/trunk/src/test/regression/H4866/
    harmony/enhanced/drlvm/trunk/src/test/regression/H4866/Test.java   (with props)
    harmony/enhanced/drlvm/trunk/src/test/regression/H4866/run.test.xml   (with props)
    harmony/enhanced/drlvm/trunk/src/test/regression/H4874/
    harmony/enhanced/drlvm/trunk/src/test/regression/H4874/Test.java   (with props)
    harmony/enhanced/drlvm/trunk/src/test/regression/H4874/run.test.xml   (with props)
Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Algorithms.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp

Added: harmony/enhanced/drlvm/trunk/src/test/regression/H4866/Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H4866/Test.java?rev=580334&view=auto
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H4866/Test.java (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H4866/Test.java Fri Sep 28 05:57:41 2007
@@ -0,0 +1,37 @@
+/*
+ *  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.h4866;
+
+import junit.framework.TestCase;
+
+public class Test extends TestCase {
+    
+    public void test() {
+        try {
+            new MyClass().test(null);
+            fail("No NullPointerException was thrown!");
+        } catch (NullPointerException e) {}
+    }
+
+    public static class MyClass {
+        protected void test(A out) {
+            out.hashCode();
+        }
+    }
+
+}
+class A {}

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

Added: harmony/enhanced/drlvm/trunk/src/test/regression/H4866/run.test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H4866/run.test.xml?rev=580334&view=auto
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H4866/run.test.xml (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H4866/run.test.xml Fri Sep 28 05:57:41
2007
@@ -0,0 +1,9 @@
+<project name="RUN HARMONY-4866 Regression Test">
+    <target name="run-test">
+        <run-junit-test 
+             test="org.apache.harmony.drlvm.tests.regression.h4866.Test"
+             vmarg="-Xem:server">
+        </run-junit-test>
+    </target>
+</project>
+

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

Added: harmony/enhanced/drlvm/trunk/src/test/regression/H4874/Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H4874/Test.java?rev=580334&view=auto
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H4874/Test.java (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H4874/Test.java Fri Sep 28 05:57:41 2007
@@ -0,0 +1,29 @@
+/*
+ *  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.h4874;
+
+import junit.framework.TestCase;
+
+public class Test extends TestCase {
+    
+    public void test() {
+            double one = 1;
+            double result = (-2) % one;
+            assertTrue(Double.compare(result, -0.0) == 0);
+    }
+
+}

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

Added: harmony/enhanced/drlvm/trunk/src/test/regression/H4874/run.test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H4874/run.test.xml?rev=580334&view=auto
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H4874/run.test.xml (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H4874/run.test.xml Fri Sep 28 05:57:41
2007
@@ -0,0 +1,14 @@
+<project name="RUN HARMONY-4874 Regression Test">
+    <target name="run-test">
+        <run-junit-test 
+             test="org.apache.harmony.drlvm.tests.regression.h4874.Test"
+             vmarg="-Xem:opt">
+        </run-junit-test>
+
+        <run-junit-test 
+             test="org.apache.harmony.drlvm.tests.regression.h4874.Test"
+             vmarg="-Xem:jet">
+        </run-junit-test>
+
+    </target>
+</project>

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

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Algorithms.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Algorithms.cpp?rev=580334&r1=580333&r2=580334&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Algorithms.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Algorithms.cpp Fri Sep 28 05:57:41
2007
@@ -43,7 +43,8 @@
 #define __LOp(x) *(int*)x
  
 double jitrino_ieee754_fmod_double(double x, double y) {
-	const double one = 1.0, Zero[] = {0.0, -0.0,};
+	const double one = 1.0, Zero[] = {0.0, -1.0*0.0,};
+
 	int n,hx,hy,hz,ix,iy,sx,i;
 	unsigned lx,ly,lz;
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp?rev=580334&r1=580333&r2=580334&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp Fri Sep 28 05:57:41
2007
@@ -2099,7 +2099,11 @@
 static void *rth_invokevirtual_addr_withresolve(Class_Handle klass, unsigned cp_idx, ManagedObject*
obj) {
     ASSERT_THROW_AREA;
 
-    assert(obj!=NULL);
+    Global_Env* env = VM_Global_State::loader_env;
+    if (obj == NULL) {
+        exn_throw_by_class(env->java_lang_NullPointerException_Class);
+        return NULL;
+    }
 
     Method* m = NULL;
 
@@ -2108,7 +2112,6 @@
     obj_h->object = obj;
 
     hythread_suspend_enable();
-    Global_Env* env = VM_Global_State::loader_env;
     m = resolve_virtual_method_env(env, klass, cp_idx, true);
     hythread_suspend_disable();
 
@@ -2148,7 +2151,11 @@
 static void *rth_invokeinterface_addr_withresolve(Class_Handle klass, unsigned cp_idx, ManagedObject*
obj) {
     ASSERT_THROW_AREA;
 
-    assert(obj!=NULL);
+    Global_Env* env = VM_Global_State::loader_env;
+    if (obj == NULL) {
+        exn_throw_by_class(env->java_lang_NullPointerException_Class);
+        return NULL;
+    }
 
     Method* m = NULL;
 
@@ -2157,7 +2164,6 @@
     obj_h->object = obj;
 
     hythread_suspend_enable();
-    Global_Env* env = VM_Global_State::loader_env;
     m = resolve_interface_method_env(env, klass, cp_idx, true);
     assert(m);
     hythread_suspend_disable();



Mime
View raw message