-
Type:
Enhancement
-
Resolution: Unresolved
-
Priority:
P4
-
None
-
Affects Version/s: 26
-
Component/s: hotspot
Sonar complains there is define/undefine of a global macro WALK_FORWARD_IN_BLOCK_START.
AfterJDK-8358735, we have this:
#ifdef ASSERT
#define WALK_FORWARD_IN_BLOCK_START true
#else
#define WALK_FORWARD_IN_BLOCK_START false
#endif // ASSERT
while (WALK_FORWARD_IN_BLOCK_START && p + obj->size() < left) {
p += obj->size();
obj = cast_to_oop(p);
assert(oopDesc::is_oop(obj), "Should be an object");
assert(Klass::is_valid(obj->klass()), "Not a valid klass ptr");
// Check assumptions in previous block comment if this assert fires
guarantee(false, "Should never need forward walk in block start");
}
#undef WALK_FORWARD_IN_BLOCK_START
But it makes no sense, since we can just wrap the entire while loop with #ifdef ASSERT.
After
#ifdef ASSERT
#define WALK_FORWARD_IN_BLOCK_START true
#else
#define WALK_FORWARD_IN_BLOCK_START false
#endif // ASSERT
while (WALK_FORWARD_IN_BLOCK_START && p + obj->size() < left) {
p += obj->size();
obj = cast_to_oop(p);
assert(oopDesc::is_oop(obj), "Should be an object");
assert(Klass::is_valid(obj->klass()), "Not a valid klass ptr");
// Check assumptions in previous block comment if this assert fires
guarantee(false, "Should never need forward walk in block start");
}
#undef WALK_FORWARD_IN_BLOCK_START
But it makes no sense, since we can just wrap the entire while loop with #ifdef ASSERT.
- caused by
-
JDK-8358735 GenShen: block_start() may be incorrect after class unloading
-
- Resolved
-
- links to
-
Review(master)
openjdk/jdk/28333