changeset 6448:e8b025eb340d

added test for deopt while holding lock(s)
author Doug Simon <doug.simon@oracle.com>
date Wed, 26 Sep 2012 21:43:31 +0200
parents d7bcbdf4749c
children de9c0c4b7c9b
files graal/com.oracle.graal.snippets.test/src/com/oracle/graal/snippets/MonitorTest.java
diffstat 1 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.snippets.test/src/com/oracle/graal/snippets/MonitorTest.java	Wed Sep 26 21:42:11 2012 +0200
+++ b/graal/com.oracle.graal.snippets.test/src/com/oracle/graal/snippets/MonitorTest.java	Wed Sep 26 21:43:31 2012 +0200
@@ -31,12 +31,14 @@
 
     @Test
     public void test0() {
-        test("lockObjectSimple", new Object(), "test1");
+        test("lockObjectSimple", new Object(), new Object());
+        test("lockObjectSimple", new Object(), null);
     }
 
     @Test
     public void test0_1() {
-        test("lockThisSimple", "test1");
+        test("lockThisSimple", "test1", new Object());
+        test("lockThisSimple", "test1", null);
     }
 
     @Test
@@ -123,15 +125,19 @@
         return box[0];
     }
 
-    public static String lockObjectSimple(Object o, String value) {
+    public static Object lockObjectSimple(Object o, Object value) {
         synchronized (o) {
+            value.hashCode();
             return value;
         }
     }
 
-    public String lockThisSimple(String value) {
+    public String lockThisSimple(String value, Object o) {
         synchronized (this) {
-            return value;
+            synchronized (value) {
+                o.hashCode();
+                return value;
+            }
         }
     }