Skip to content

Commit 1a65719

Browse files
author
Markus Grönlund
committed
8357911: JFR: Fix subtle xor method tagging bug
Reviewed-by: egahlin
1 parent 016cc4f commit 1a65719

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSetUtils.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -112,7 +112,9 @@ class ClearArtifact<const Method*> {
112112
assert(METHOD_IS_NOT_LEAKP(method), "invariant");
113113
assert(METHOD_IS_NOT_TRANSIENT(method), "invariant");
114114
SET_PREVIOUS_EPOCH_METHOD_CLEARED_BIT(method);
115-
CLEAR_PREVIOUS_EPOCH_METHOD_FLAG(method);
115+
if (METHOD_FLAG_USED_PREVIOUS_EPOCH_BIT(method)) {
116+
CLEAR_PREVIOUS_EPOCH_METHOD_FLAG(method);
117+
}
116118
assert(IS_THIS_EPOCH_METHOD_CLEARED_BIT_SET(method), "invariant");
117119
assert(IS_PREVIOUS_EPOCH_METHOD_CLEARED_BIT_SET(method), "invariant");
118120
return true;

src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdMacros.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -104,6 +104,7 @@
104104
#define METHOD_FLAG_USED_THIS_EPOCH(method) (METHOD_FLAG_PREDICATE(method, (TRANSIENT_BIT | THIS_EPOCH_BIT)))
105105
#define METHOD_FLAG_NOT_USED_THIS_EPOCH(method) (!(METHOD_FLAG_USED_THIS_EPOCH(method)))
106106
#define METHOD_FLAG_USED_PREVIOUS_EPOCH(method) (METHOD_FLAG_PREDICATE(method, (TRANSIENT_BIT | PREVIOUS_EPOCH_BIT)))
107+
#define METHOD_FLAG_USED_PREVIOUS_EPOCH_BIT(method) (METHOD_FLAG_PREDICATE(method, (PREVIOUS_EPOCH_BIT)))
107108
#define METHOD_FLAG_NOT_USED_PREVIOUS_EPOCH(method) (!(METHOD_FLAG_USED_PREVIOUS_EPOCH(method)))
108109
#define IS_METHOD_BLESSED(method) (METHOD_FLAG_PREDICATE(method, BLESSED_METHOD_BIT))
109110

0 commit comments

Comments
 (0)