Skip to content

Commit d441bce

Browse files
committed
[GR-68724] Report watchdog activity in RestrictHeapAccessCalleesImpl.aggregateMethods.
PullRequest: graal/21860
2 parents aeef6ca + 1249703 commit d441bce

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageGenerator.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,10 @@ protected boolean runPointsToAnalysis(String imageName, OptionValues options, De
841841
bb.runAnalysis(debug, (universe) -> {
842842
try (StopTimer t2 = TimerCollection.createTimerAndStart(TimerCollection.Registry.FEATURES)) {
843843
bb.getHostVM().notifyClassReachabilityListener(universe, config);
844-
featureHandler.forEachFeature(feature -> feature.duringAnalysis(config));
844+
featureHandler.forEachFeature(feature -> {
845+
feature.duringAnalysis(config);
846+
loader.watchdog.recordActivity();
847+
});
845848
}
846849
/* Analysis is finished if no additional iteration was requested. */
847850
return !config.getAndResetRequireAnalysisIteration() && !concurrentConfig.getAndResetRequireAnalysisIteration();

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/code/RestrictHeapAccessCalleesImpl.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import java.util.Map;
3232
import java.util.Set;
3333

34+
import com.oracle.svm.hosted.DeadlockWatchdog;
3435
import org.graalvm.collections.EconomicSet;
3536
import org.graalvm.collections.UnmodifiableEconomicSet;
3637
import org.graalvm.nativeimage.ImageSingletons;
@@ -107,13 +108,16 @@ public Map<AnalysisMethod, RestrictionInfo> getCallerMap() {
107108
public void aggregateMethods(Collection<AnalysisMethod> methods) {
108109
assert !initialized : "RestrictHeapAccessCallees.aggregateMethods: Should only initialize once.";
109110
Map<AnalysisMethod, RestrictionInfo> aggregation = new HashMap<>();
111+
DeadlockWatchdog watchdog = DeadlockWatchdog.singleton();
112+
watchdog.recordActivity();
110113
for (AnalysisMethod method : methods) {
111114
if (method.isAnnotationPresent(RestrictHeapAccess.class)) {
112115
setMethodRestrictionInfo(method, aggregation);
113116
}
114117
}
115118
MethodAggregator visitor = new MethodAggregator(aggregation, assertionErrorConstructorList);
116119
AnalysisMethodCalleeWalker walker = new AnalysisMethodCalleeWalker();
120+
watchdog.recordActivity();
117121
for (AnalysisMethod method : aggregation.keySet().toArray(AnalysisMethod.EMPTY_ARRAY)) {
118122
walker.walkMethod(method, visitor);
119123
}

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/meta/UniverseBuilder.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import java.util.function.Function;
4545
import java.util.stream.Collectors;
4646

47+
import com.oracle.svm.hosted.DeadlockWatchdog;
4748
import org.graalvm.nativeimage.ImageInfo;
4849
import org.graalvm.nativeimage.Platform;
4950
import org.graalvm.nativeimage.Platforms;
@@ -149,6 +150,7 @@ public UniverseBuilder(AnalysisUniverse aUniverse, AnalysisMetaAccess aMetaAcces
149150
@SuppressWarnings("try")
150151
public void build(DebugContext debug) {
151152
aUniverse.seal();
153+
DeadlockWatchdog.singleton().recordActivity();
152154

153155
try (Indent indent = debug.logAndIndent("build universe")) {
154156
for (AnalysisType aType : aUniverse.getTypes()) {
@@ -193,6 +195,7 @@ public void build(DebugContext debug) {
193195
});
194196
}
195197

198+
DeadlockWatchdog.singleton().recordActivity();
196199
HostedConfiguration.initializeDynamicHubLayout(hMetaAccess);
197200

198201
Collection<HostedType> allTypes = hUniverse.types.values();

0 commit comments

Comments
 (0)