JS: fix bug in compilation of monitorenter instruction

This commit is contained in:
Alexey Andreev 2021-03-18 14:20:29 +03:00
parent 5d9d64303e
commit 75d06bebbf
2 changed files with 4 additions and 3 deletions

View File

@ -161,7 +161,8 @@ public class AsyncMethodFinder {
} }
if (!hasAsyncMethods && methodRef.getClassName().equals("java.lang.Object") if (!hasAsyncMethods && methodRef.getClassName().equals("java.lang.Object")
&& (methodRef.getName().equals("monitorEnter") || methodRef.getName().equals("monitorExit"))) { && (methodRef.getName().equals("monitorEnter") || methodRef.getName().equals("monitorExit"))
&& methodRef.parameterCount() == 0) {
return; return;
} }
for (CallSite callSite : node.getCallerCallSites()) { for (CallSite callSite : node.getCallerCallSites()) {

View File

@ -433,14 +433,14 @@ public class VMTest {
public synchronized void doWait() { public synchronized void doWait() {
new Thread(() -> { new Thread(() -> {
synchronized (AsyncClinitClass.this) { synchronized (this) {
notify(); notify();
} }
}).start(); }).start();
try { try {
Thread.sleep(1); Thread.sleep(1);
synchronized (AsyncClinitClass.this) { synchronized (this) {
wait(); wait();
} }
} catch (InterruptedException ie) { } catch (InterruptedException ie) {