From 3fe3fe05e74faf2bda24bd22245ecc96556d0897 Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Thu, 19 Dec 2024 21:07:06 +0100 Subject: [PATCH] Record more activity in `buildRuntimeMetadata()`. --- .../src/com/oracle/svm/core/code/FrameInfoEncoder.java | 5 +++-- .../com/oracle/svm/hosted/image/NativeImageCodeCache.java | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/code/FrameInfoEncoder.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/code/FrameInfoEncoder.java index 8d891e6b591d..1634beabd0a6 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/code/FrameInfoEncoder.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/code/FrameInfoEncoder.java @@ -295,7 +295,7 @@ void addFrameSlice(FrameData data, List slice) { sliceFrequency.addObject(frameSliceIndex); } - void encodeCompressedData(UnsafeArrayTypeWriter encodingBuffer, Encoders encoders) { + void encodeCompressedData(Runnable recordActivity, UnsafeArrayTypeWriter encodingBuffer, Encoders encoders) { assert !sealed : "already sealed"; sealed = true; @@ -332,6 +332,7 @@ void encodeCompressedData(UnsafeArrayTypeWriter encodingBuffer, Encoders encoder uniqueSuccessorIndex = NO_SUCCESSOR_INDEX_MARKER; } encodeCompressedFrame(encodingBuffer, encoders, frame, uniqueSuccessorIndex); + recordActivity.run(); } /* @@ -901,7 +902,7 @@ private static void afterInstallation(CodeInfo info) { private NonmovableArray encodeFrameDatas(Runnable recordActivity) { UnsafeArrayTypeWriter encodingBuffer = UnsafeArrayTypeWriter.create(ByteArrayReader.supportsUnalignedMemoryAccess()); - frameMetadata.encodeCompressedData(encodingBuffer, encoders); + frameMetadata.encodeCompressedData(recordActivity, encodingBuffer, encoders); for (FrameData data : allDebugInfos) { if (data.frameSliceIndex == UNCOMPRESSED_FRAME_SLICE_INDEX) { data.encodedFrameInfoIndex = encodingBuffer.getBytesWritten(); diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/NativeImageCodeCache.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/NativeImageCodeCache.java index 863c241d40a5..e53a4546ffe1 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/NativeImageCodeCache.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/NativeImageCodeCache.java @@ -435,6 +435,8 @@ protected void buildRuntimeMetadata(DebugContext debug, SnippetReflectionProvide } } + watchdog.recordActivity(); + if (SubstrateOptions.IncludeMethodData.getValue()) { for (HostedField field : hUniverse.getFields()) { if (field.isAccessed() && !field.getWrapped().isInBaseLayer() && !includedFields.contains(field.getWrapped())) {