Skip to content
Merged
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 @@ -353,6 +353,10 @@ private void maybeExecuteCallback() {
/*
* Before executing the callback, reset the safepoint requested counter as we
* don't want to trigger another callback execution in the near future.
*
* Recurring callbacks typically execute VM-internal code that performs hardly
* any safepoint checks. We explicitly don't update the recurring callback
* statistics anywhere in this method as this could skew the numbers.
*/
setCounter(SafepointCheckCounter.MAX_VALUE);
try {
Expand All @@ -364,7 +368,6 @@ private void maybeExecuteCallback() {
*/
} finally {
lastCallbackExecution = System.nanoTime();
updateStatistics();
}
}
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@
*/
public class SafepointCheckCounter {
private static final FastThreadLocalInt valueTL = FastThreadLocalFactory.createInt("SafepointCheckCounter.value").setMaxOffset(FastThreadLocal.FIRST_CACHE_LINE);
/** Can be used to reset the thread-local value after a safepoint. */
static final int MAX_VALUE = Integer.MAX_VALUE;
/**
* Can be used to reset the thread-local value after a safepoint. We explicitly keep some
* distance to {@link Integer#MAX_VALUE} to avoid corner cases.
*/
static final int MAX_VALUE = Integer.MAX_VALUE >>> 1;

@Uninterruptible(reason = CALLED_FROM_UNINTERRUPTIBLE_CODE, mayBeInlined = true)
static boolean compareAndSet(IsolateThread thread, int oldValue, int newValue) {
Expand Down