Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8304448: Kitchensink failed: assert(!thread->is_in_any_VTMS_transition()) failed: class prepare events are not allowed in any VTMS transition #13154

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions src/java.base/share/classes/jdk/internal/vm/Continuation.java
Original file line number Diff line number Diff line change
@@ -31,12 +31,8 @@
import jdk.internal.vm.annotation.IntrinsicCandidate;
import sun.security.action.GetPropertyAction;

import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
import java.util.EnumSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Supplier;
import jdk.internal.access.JavaLangAccess;
import jdk.internal.access.SharedSecrets;
@@ -46,6 +42,7 @@
*/
public class Continuation {
private static final Unsafe U = Unsafe.getUnsafe();
private static final long MOUNTED_OFFSET = U.objectFieldOffset(Continuation.class, "mounted");
private static final boolean PRESERVE_SCOPED_VALUE_CACHE;
private static final JavaLangAccess JLA = SharedSecrets.getJavaLangAccess();
static {
@@ -58,8 +55,6 @@ public class Continuation {
PRESERVE_SCOPED_VALUE_CACHE = (value == null) || Boolean.parseBoolean(value);
}

private static final VarHandle MOUNTED;

/** Reason for pinning */
public enum Pinned {
/** Native frame on stack */ NATIVE,
@@ -104,9 +99,6 @@ private static Thread currentCarrierThread() {

// init Pinned to avoid classloading during mounting
pinnedReason(2);

MethodHandles.Lookup l = MethodHandles.lookup();
MOUNTED = l.findVarHandle(Continuation.class, "mounted", boolean.class);
} catch (Exception e) {
throw new InternalError(e);
}
@@ -125,7 +117,7 @@ private static Thread currentCarrierThread() {
private StackChunk tail;

private boolean done;
private volatile boolean mounted = false;
private volatile boolean mounted;
private Object yieldInfo;
private boolean preempted;

@@ -461,9 +453,8 @@ private boolean fence() {
}

private boolean compareAndSetMounted(boolean expectedValue, boolean newValue) {
boolean res = MOUNTED.compareAndSet(this, expectedValue, newValue);
return res;
}
return U.compareAndSetBoolean(this, MOUNTED_OFFSET, expectedValue, newValue);
}

private void setMounted(boolean newValue) {
mounted = newValue; // MOUNTED.setVolatile(this, newValue);