Skip to content

Commit 0c0a3cc

Browse files
committed
[GR-56348] Record watchdog activity in layouting and image writing.
PullRequest: graal/19649
2 parents 17cb48a + 4b31895 commit 0c0a3cc

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/LIRNativeImageCodeCache.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ private boolean verifyMethodLayout() {
135135
return true;
136136
}
137137

138-
@SuppressWarnings("try")
138+
@SuppressWarnings({"try", "resource"})
139139
@Override
140140
public void layoutMethods(DebugContext debug, BigBang bb) {
141141

@@ -184,6 +184,8 @@ public void layoutMethods(DebugContext debug, BigBang bb) {
184184
}
185185
orderedTrampolineMap.put(method, sortedTrampolines);
186186
}
187+
188+
DeadlockWatchdog.singleton().recordActivity();
187189
}
188190
}
189191

@@ -222,6 +224,7 @@ private static int computeNextMethodStart(int current, int addend) {
222224
* After the initial method layout, on some platforms some direct calls between methods may be
223225
* too far apart. When this happens a trampoline must be inserted to reach the call target.
224226
*/
227+
@SuppressWarnings("resource")
225228
private void addDirectCallTrampolines(Map<HostedMethod, Integer> curOffsetMap) {
226229
HostedDirectCallTrampolineSupport trampolineSupport = HostedDirectCallTrampolineSupport.singleton();
227230

@@ -295,6 +298,8 @@ private void addDirectCallTrampolines(Map<HostedMethod, Integer> curOffsetMap) {
295298
curPos = computeNextMethodStart(curPos, 0);
296299
callerCompilationNum++;
297300
}
301+
302+
DeadlockWatchdog.singleton().recordActivity();
298303
} while (changed);
299304
}
300305

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/NativeImageHeapWriter.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
import com.oracle.svm.core.imagelayer.ImageLayerBuildingSupport;
5656
import com.oracle.svm.core.meta.MethodPointer;
5757
import com.oracle.svm.core.util.VMError;
58+
import com.oracle.svm.hosted.DeadlockWatchdog;
5859
import com.oracle.svm.hosted.code.CEntryPointLiteralFeature;
5960
import com.oracle.svm.hosted.config.DynamicHubLayout;
6061
import com.oracle.svm.hosted.config.HybridLayout;
@@ -111,6 +112,8 @@ public long writeHeap(DebugContext debug, RelocatableBuffer buffer) {
111112
continue;
112113
}
113114
writeObject(info, buffer);
115+
116+
DeadlockWatchdog.singleton().recordActivity();
114117
}
115118

116119
// Only static fields that are writable get written to the native image heap,
@@ -122,6 +125,7 @@ public long writeHeap(DebugContext debug, RelocatableBuffer buffer) {
122125
return sectionOffsetOfARelocatablePointer;
123126
}
124127

128+
@SuppressWarnings("resource")
125129
private void writeStaticFields(RelocatableBuffer buffer) {
126130
/*
127131
* Write the values of static fields. The arrays for primitive and object fields are empty
@@ -141,6 +145,8 @@ private void writeStaticFields(RelocatableBuffer buffer) {
141145
ObjectInfo fields = (field.getStorageKind() == JavaKind.Object) ? objectFields : primitiveFields;
142146
writeField(buffer, fields, field, null, null);
143147
}
148+
149+
DeadlockWatchdog.singleton().recordActivity();
144150
}
145151
}
146152

0 commit comments

Comments
 (0)