Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
*/
package com.oracle.svm.core.locks;

import jdk.graal.compiler.word.Word;
import org.graalvm.nativeimage.CurrentIsolate;
import org.graalvm.nativeimage.IsolateThread;
import org.graalvm.nativeimage.Platform;
Expand All @@ -35,6 +34,8 @@
import com.oracle.svm.core.c.CIsolateDataFactory;
import com.oracle.svm.core.util.VMError;

import jdk.graal.compiler.word.Word;

/**
* A mutex that has minimal requirements on Java code. The implementation does not perform memory
* allocation, exception unwinding, or other complicated operations. This allows it to be used in
Expand All @@ -56,6 +57,7 @@ public class VMMutex extends VMLockingPrimitive {
private final String name;
IsolateThread owner;

@Deprecated
@Platforms(Platform.HOSTED_ONLY.class)
public VMMutex() {
this.name = CIsolateDataFactory.getUnspecifiedSuffix();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@

import static com.oracle.svm.core.Uninterruptible.CALLED_FROM_UNINTERRUPTIBLE_CODE;

import com.oracle.svm.core.deopt.DeoptimizationSlotPacking;
import jdk.graal.compiler.word.Word;
import org.graalvm.nativeimage.CurrentIsolate;
import org.graalvm.nativeimage.IsolateThread;
import org.graalvm.nativeimage.Platform;
Expand All @@ -46,6 +44,7 @@
import com.oracle.svm.core.code.CodeInfoTable;
import com.oracle.svm.core.code.UntetheredCodeInfo;
import com.oracle.svm.core.config.ConfigurationValues;
import com.oracle.svm.core.deopt.DeoptimizationSlotPacking;
import com.oracle.svm.core.deopt.DeoptimizedFrame;
import com.oracle.svm.core.deopt.Deoptimizer;
import com.oracle.svm.core.heap.RestrictHeapAccess;
Expand All @@ -61,6 +60,7 @@

import jdk.graal.compiler.api.replacements.Fold;
import jdk.graal.compiler.core.common.NumUtil;
import jdk.graal.compiler.word.Word;

/**
* Provides methods to iterate over the physical Java stack frames of a thread (native stack frames
Expand Down Expand Up @@ -203,14 +203,24 @@ public static void initializeForContinuation(JavaStackWalk walk, StoredContinuat

@Uninterruptible(reason = "Prevent deoptimization of stack frames while in this method.", callerMustBe = true)
private static void initializeFromFrameAnchor(JavaStackWalk walk, IsolateThread thread, Pointer endSP) {
assert thread.isNonNull();
assert thread != CurrentIsolate.getCurrentThread() : "Walking the stack without specifying a start SP is only allowed when walking other threads";
assert VMOperation.isInProgressAtSafepoint() : "Walking the stack of another thread is only safe when that thread is stopped at a safepoint";

JavaFrameAnchor frameAnchor = JavaFrameAnchors.getFrameAnchor(thread);
if (frameAnchor.isNull()) {
/* Threads that do not have a frame anchor at a safepoint are not walkable. */
if (frameAnchor.isNull() || SafepointBehavior.isCrashedThread(thread)) {
/*
* Threads that do not have a frame anchor at a safepoint are not walkable. This can for
* example happen for attached threads that do not have any Java frames at the moment.
* Threads that are marked as crashed are also not walkable because they may no longer
* have a stack. For such threads, we must not access any data in the frame anchor (as
* it is a stack allocated struct).
*/
markAsNotWalkable(walk);
} else {
initWalk(walk, thread, frameAnchor.getLastJavaSP(), endSP, frameAnchor.getLastJavaIP(), frameAnchor.getPreviousAnchor());
Pointer startSP = frameAnchor.getLastJavaSP();
assert startSP.isNonNull();
initWalk0(walk, startSP, endSP, frameAnchor.getLastJavaIP(), frameAnchor.getPreviousAnchor());
}
}

Expand Down