|
40 | 40 | import org.graalvm.word.UnsignedWord; |
41 | 41 |
|
42 | 42 | import com.oracle.svm.core.NeverInline; |
| 43 | +import com.oracle.svm.core.SubstrateOptions; |
43 | 44 | import com.oracle.svm.core.Uninterruptible; |
44 | 45 | import com.oracle.svm.core.c.function.CEntryPointErrors; |
45 | 46 | import com.oracle.svm.core.c.function.CFunctionOptions; |
46 | 47 | import com.oracle.svm.core.config.ConfigurationValues; |
47 | 48 | import com.oracle.svm.core.feature.AutomaticallyRegisteredFeature; |
48 | 49 | import com.oracle.svm.core.feature.InternalFeature; |
| 50 | +import com.oracle.svm.core.graal.isolated.IsolatedCompileClient; |
| 51 | +import com.oracle.svm.core.graal.isolated.IsolatedCompileContext; |
49 | 52 | import com.oracle.svm.core.heap.Heap; |
50 | 53 | import com.oracle.svm.core.heap.VMOperationInfos; |
51 | 54 | import com.oracle.svm.core.imagelayer.ImageLayerBuildingSupport; |
@@ -960,7 +963,23 @@ public static void preventSafepoints() { |
960 | 963 | */ |
961 | 964 | @Uninterruptible(reason = "Called from uninterruptible code.", mayBeInlined = true) |
962 | 965 | public static void markThreadAsCrashed() { |
963 | | - // It would be nice if we could retire the TLAB here but that wouldn't work reliably. |
| 966 | + if (SubstrateOptions.supportCompileInIsolates()) { |
| 967 | + /* |
| 968 | + * Threads that are used for isolated compilation may be attached to both the main |
| 969 | + * and a compilation isolate. So, mark it as crashed in both isolates. |
| 970 | + */ |
| 971 | + IsolatedCompileContext compileContext = IsolatedCompileContext.get(); |
| 972 | + if (compileContext != null) { |
| 973 | + safepointBehaviorTL.setVolatile(compileContext.getClient(), THREAD_CRASHED); |
| 974 | + } |
| 975 | + |
| 976 | + IsolatedCompileClient compileClient = IsolatedCompileClient.get(); |
| 977 | + if (compileClient != null) { |
| 978 | + safepointBehaviorTL.setVolatile(compileClient.getCompiler(), THREAD_CRASHED); |
| 979 | + } |
| 980 | + } |
| 981 | + |
| 982 | + /* It would be nice if we could retire the TLAB here but that wouldn't work reliably. */ |
964 | 983 | safepointBehaviorTL.setVolatile(THREAD_CRASHED); |
965 | 984 | } |
966 | 985 |
|
|
0 commit comments