|
39 | 39 | import org.graalvm.word.UnsignedWord; |
40 | 40 |
|
41 | 41 | import com.oracle.svm.core.NeverInline; |
| 42 | +import com.oracle.svm.core.SubstrateOptions; |
42 | 43 | import com.oracle.svm.core.Uninterruptible; |
43 | 44 | import com.oracle.svm.core.c.function.CEntryPointErrors; |
44 | 45 | import com.oracle.svm.core.c.function.CFunctionOptions; |
45 | 46 | import com.oracle.svm.core.config.ConfigurationValues; |
46 | 47 | import com.oracle.svm.core.feature.AutomaticallyRegisteredFeature; |
47 | 48 | import com.oracle.svm.core.feature.InternalFeature; |
| 49 | +import com.oracle.svm.core.graal.isolated.IsolatedCompileClient; |
| 50 | +import com.oracle.svm.core.graal.isolated.IsolatedCompileContext; |
48 | 51 | import com.oracle.svm.core.heap.Heap; |
49 | 52 | import com.oracle.svm.core.heap.VMOperationInfos; |
50 | 53 | import com.oracle.svm.core.imagelayer.ImageLayerBuildingSupport; |
@@ -1016,7 +1019,23 @@ public static void preventSafepoints() { |
1016 | 1019 | */ |
1017 | 1020 | @Uninterruptible(reason = "Called from uninterruptible code.", mayBeInlined = true) |
1018 | 1021 | public static void markThreadAsCrashed() { |
1019 | | - // It would be nice if we could retire the TLAB here but that wouldn't work reliably. |
| 1022 | + if (SubstrateOptions.supportCompileInIsolates()) { |
| 1023 | + /* |
| 1024 | + * Threads that are used for isolated compilation may be attached to both the main |
| 1025 | + * and a compilation isolate. So, mark it as crashed in both isolates. |
| 1026 | + */ |
| 1027 | + IsolatedCompileContext compileContext = IsolatedCompileContext.get(); |
| 1028 | + if (compileContext != null) { |
| 1029 | + safepointBehaviorTL.setVolatile(compileContext.getClient(), THREAD_CRASHED); |
| 1030 | + } |
| 1031 | + |
| 1032 | + IsolatedCompileClient compileClient = IsolatedCompileClient.get(); |
| 1033 | + if (compileClient != null) { |
| 1034 | + safepointBehaviorTL.setVolatile(compileClient.getCompiler(), THREAD_CRASHED); |
| 1035 | + } |
| 1036 | + } |
| 1037 | + |
| 1038 | + /* It would be nice if we could retire the TLAB here but that wouldn't work reliably. */ |
1020 | 1039 | safepointBehaviorTL.setVolatile(THREAD_CRASHED); |
1021 | 1040 | } |
1022 | 1041 |
|
|
0 commit comments