From 438f0206d60869ecc3ceb45fc90ff55c037cc810 Mon Sep 17 00:00:00 2001 From: Duncan MacGregor Date: Mon, 20 Jan 2020 15:14:19 +0000 Subject: [PATCH] Fix `Object#wait()` for loom refactoring. --- .../hotspot/test/HotSpotMonitorValueTest.java | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMonitorValueTest.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMonitorValueTest.java index 66d84366009..8a9e67ad7c8 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMonitorValueTest.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMonitorValueTest.java @@ -55,19 +55,17 @@ protected InstalledCode addMethod(DebugContext debug, ResolvedJavaMethod method, Call call = (Call) i; if (call.target instanceof ResolvedJavaMethod) { ResolvedJavaMethod target = (ResolvedJavaMethod) call.target; - if (target.equals(lookupObjectWait())) { + if (target.equals(lookupObjectWait0())) { BytecodeFrame frame = call.debugInfo.frame(); BytecodeFrame caller = frame.caller(); assertNotNull(caller); - assertNull(caller.caller()); - assertDeepEquals(2, frame.numLocks); - assertDeepEquals(2, caller.numLocks); - StackLockValue lock1 = (StackLockValue) frame.getLockValue(0); - StackLockValue lock2 = (StackLockValue) frame.getLockValue(1); - StackLockValue lock3 = (StackLockValue) caller.getLockValue(0); - StackLockValue lock4 = (StackLockValue) caller.getLockValue(1); + assertNotNull(caller.caller()); + assertDeepEquals(0, frame.numLocks); + assertDeepEquals(2, caller.caller().numLocks); + StackLockValue lock1 = (StackLockValue) caller.caller().getLockValue(0); + StackLockValue lock2 = (StackLockValue) caller.caller().getLockValue(1); - List locks = Arrays.asList(lock1, lock2, lock3, lock4); + List locks = Arrays.asList(lock1, lock2); for (StackLockValue lock : locks) { for (StackLockValue other : locks) { if (other != lock) { @@ -76,19 +74,18 @@ protected InstalledCode addMethod(DebugContext debug, ResolvedJavaMethod method, } } } - assertDeepEquals(lock3.getOwner(), lock4.getOwner()); - assertThat(lock1.getOwner(), not(lock2.getOwner())); + assertDeepEquals(lock1.getOwner(), lock2.getOwner()); return super.addMethod(debug, method, compResult); } } } } - throw new AssertionError("Could not find debug info for call to Object.wait(long)"); + throw new AssertionError("Could not find debug info for call to Object.wait0(long)"); } - private ResolvedJavaMethod lookupObjectWait() { + private ResolvedJavaMethod lookupObjectWait0() { try { - return getMetaAccess().lookupJavaMethod(Object.class.getDeclaredMethod("wait", long.class)); + return getMetaAccess().lookupJavaMethod(Object.class.getDeclaredMethod("wait0", long.class)); } catch (Exception e) { throw new GraalError("Could not find Object.wait(long): %s", e); }