# HG changeset patch # User Doug Simon # Date 1348688611 -7200 # Node ID e8b025eb340df1d5cb5cfe94da8e9687945db364 # Parent d7bcbdf4749ca3771e53536fc60fe07d3aadcc96 added test for deopt while holding lock(s) diff -r d7bcbdf4749c -r e8b025eb340d graal/com.oracle.graal.snippets.test/src/com/oracle/graal/snippets/MonitorTest.java --- 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; + } } }