diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/LIRNativeImageCodeCache.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/LIRNativeImageCodeCache.java index d66ad09a1058..b808f68f0362 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/LIRNativeImageCodeCache.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/LIRNativeImageCodeCache.java @@ -135,7 +135,7 @@ private boolean verifyMethodLayout() { return true; } - @SuppressWarnings("try") + @SuppressWarnings({"try", "resource"}) @Override public void layoutMethods(DebugContext debug, BigBang bb) { @@ -184,6 +184,8 @@ public void layoutMethods(DebugContext debug, BigBang bb) { } orderedTrampolineMap.put(method, sortedTrampolines); } + + DeadlockWatchdog.singleton().recordActivity(); } } @@ -222,6 +224,7 @@ private static int computeNextMethodStart(int current, int addend) { * After the initial method layout, on some platforms some direct calls between methods may be * too far apart. When this happens a trampoline must be inserted to reach the call target. */ + @SuppressWarnings("resource") private void addDirectCallTrampolines(Map curOffsetMap) { HostedDirectCallTrampolineSupport trampolineSupport = HostedDirectCallTrampolineSupport.singleton(); @@ -295,6 +298,8 @@ private void addDirectCallTrampolines(Map curOffsetMap) { curPos = computeNextMethodStart(curPos, 0); callerCompilationNum++; } + + DeadlockWatchdog.singleton().recordActivity(); } while (changed); } diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/NativeImageHeapWriter.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/NativeImageHeapWriter.java index dde6229f23d3..35fe27ec4f03 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/NativeImageHeapWriter.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/NativeImageHeapWriter.java @@ -55,6 +55,7 @@ import com.oracle.svm.core.imagelayer.ImageLayerBuildingSupport; import com.oracle.svm.core.meta.MethodPointer; import com.oracle.svm.core.util.VMError; +import com.oracle.svm.hosted.DeadlockWatchdog; import com.oracle.svm.hosted.code.CEntryPointLiteralFeature; import com.oracle.svm.hosted.config.DynamicHubLayout; import com.oracle.svm.hosted.config.HybridLayout; @@ -111,6 +112,8 @@ public long writeHeap(DebugContext debug, RelocatableBuffer buffer) { continue; } writeObject(info, buffer); + + DeadlockWatchdog.singleton().recordActivity(); } // Only static fields that are writable get written to the native image heap, @@ -122,6 +125,7 @@ public long writeHeap(DebugContext debug, RelocatableBuffer buffer) { return sectionOffsetOfARelocatablePointer; } + @SuppressWarnings("resource") private void writeStaticFields(RelocatableBuffer buffer) { /* * Write the values of static fields. The arrays for primitive and object fields are empty @@ -141,6 +145,8 @@ private void writeStaticFields(RelocatableBuffer buffer) { ObjectInfo fields = (field.getStorageKind() == JavaKind.Object) ? objectFields : primitiveFields; writeField(buffer, fields, field, null, null); } + + DeadlockWatchdog.singleton().recordActivity(); } }