Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GR-56348] Record watchdog activity in layouting and image writing. #10341

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private boolean verifyMethodLayout() {
return true;
}

@SuppressWarnings("try")
@SuppressWarnings({"try", "resource"})
@Override
public void layoutMethods(DebugContext debug, BigBang bb) {

Expand Down Expand Up @@ -184,6 +184,8 @@ public void layoutMethods(DebugContext debug, BigBang bb) {
}
orderedTrampolineMap.put(method, sortedTrampolines);
}

DeadlockWatchdog.singleton().recordActivity();
}
}

Expand Down Expand Up @@ -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<HostedMethod, Integer> curOffsetMap) {
HostedDirectCallTrampolineSupport trampolineSupport = HostedDirectCallTrampolineSupport.singleton();

Expand Down Expand Up @@ -295,6 +298,8 @@ private void addDirectCallTrampolines(Map<HostedMethod, Integer> curOffsetMap) {
curPos = computeNextMethodStart(curPos, 0);
callerCompilationNum++;
}

DeadlockWatchdog.singleton().recordActivity();
} while (changed);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand All @@ -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();
}
}

Expand Down