8387214: TraceJavaAssertions is unused

Reviewed-by: jsjolen, shade
This commit is contained in:
Coleen Phillimore 2026-06-24 17:37:11 +00:00
parent 3e17dc9eb1
commit e8aaa9e59c
3 changed files with 2 additions and 30 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -83,13 +83,6 @@ void JavaAssertions::addOption(const char* name, bool enable) {
if (name_copy[i] == JVM_SIGNATURE_DOT) name_copy[i] = JVM_SIGNATURE_SLASH;
}
if (TraceJavaAssertions) {
tty->print_cr("JavaAssertions: adding %s %s=%d",
head == &_classes ? "class" : "package",
name_copy[0] != '\0' ? name_copy : "'default'",
enable);
}
// Prepend a new item to the list. Items added later take precedence, so
// prepending allows us to stop searching the list after the first match.
*head = new OptionList(name_copy, enable, *head);
@ -183,14 +176,6 @@ JavaAssertions::match_package(const char* classname) {
return nullptr;
}
inline void JavaAssertions::trace(const char* name,
const char* typefound, const char* namefound, bool enabled) {
if (TraceJavaAssertions) {
tty->print_cr("JavaAssertions: search for %s found %s %s=%d",
name, typefound, namefound[0] != '\0' ? namefound : "'default'", enabled);
}
}
bool JavaAssertions::enabled(const char* classname, bool systemClass) {
assert(classname != nullptr, "must have a classname");
@ -201,18 +186,15 @@ bool JavaAssertions::enabled(const char* classname, bool systemClass) {
// First check options that apply to classes. If we find a match we're done.
OptionList* p;
if ((p = match_class(classname))) {
trace(classname, "class", p->name(), p->enabled());
return p->enabled();
}
// Now check packages, from most specific to least.
if ((p = match_package(classname))) {
trace(classname, "package", p->name(), p->enabled());
return p->enabled();
}
// No match. Return the default status.
bool result = systemClass ? systemClassDefault() : userClassDefault();
trace(classname, systemClass ? "system" : "user", "default", result);
return result;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -57,9 +57,6 @@ private:
static void fillJavaArrays(const OptionList* p, int len, objArrayHandle names,
typeArrayHandle status, TRAPS);
static inline void trace(const char* name, const char* typefound,
const char* namefound, bool enabled);
static inline OptionList* match_class(const char* classname);
static OptionList* match_package(const char* classname);
@ -90,8 +87,6 @@ inline bool JavaAssertions::userClassDefault() {
}
inline void JavaAssertions::setUserClassDefault(bool enabled) {
if (TraceJavaAssertions)
tty->print_cr("JavaAssertions::setUserClassDefault(%d)", enabled);
_userDefault = enabled;
}
@ -100,8 +95,6 @@ inline bool JavaAssertions::systemClassDefault() {
}
inline void JavaAssertions::setSystemClassDefault(bool enabled) {
if (TraceJavaAssertions)
tty->print_cr("JavaAssertions::setSystemClassDefault(%d)", enabled);
_sysDefault = enabled;
}

View File

@ -461,9 +461,6 @@ const int ObjectAlignmentInBytes = 8;
develop(bool, VerifyStackAtCalls, false, \
"Verify that the stack pointer is unchanged after calls") \
\
develop(bool, TraceJavaAssertions, false, \
"Trace java language assertions") \
\
develop(bool, VerifyCodeCache, false, \
"Verify code cache on memory allocation/deallocation") \
\