8249837: Avoid direct or implicit Thread::current() calls when we already have a current thread variable

Add current thread OR remove unneeded HandleMark

Reviewed-by: kvn, dholmes
This commit is contained in:
Coleen Phillimore 2020-07-30 10:41:31 -04:00
parent 79f02a67ce
commit 9798a0846b
50 changed files with 108 additions and 143 deletions

View file

@ -873,7 +873,6 @@ void nmethod::log_identity(xmlStream* log) const {
void nmethod::log_new_nmethod() const {
if (LogCompilation && xtty != NULL) {
ttyLocker ttyl;
HandleMark hm;
xtty->begin_elem("nmethod");
log_identity(xtty);
xtty->print(" entry='" INTPTR_FORMAT "' size='%d'", p2i(code_begin()), size());
@ -931,7 +930,6 @@ void nmethod::print_nmethod(bool printmethod) {
// Print the header part, then print the requested information.
// This is both handled in decode2().
if (printmethod) {
HandleMark hm;
ResourceMark m;
if (is_compiled_by_c1()) {
tty->cr();
@ -2405,6 +2403,7 @@ void nmethod::verify() {
void nmethod::verify_interrupt_point(address call_site) {
// Verify IC only when nmethod installation is finished.
if (!is_not_installed()) {
if (CompiledICLocker::is_safe(this)) {
@ -2415,6 +2414,8 @@ void nmethod::verify_interrupt_point(address call_site) {
}
}
HandleMark hm(Thread::current());
PcDesc* pd = pc_desc_at(nativeCall_at(call_site)->return_address());
assert(pd != NULL, "PcDesc must exist");
for (ScopeDesc* sd = new ScopeDesc(this, pd->scope_decode_offset(),
@ -2554,7 +2555,6 @@ void nmethod::print(outputStream* st) const {
}
void nmethod::print_code() {
HandleMark hm;
ResourceMark m;
ttyLocker ttyl;
// Call the specialized decode method of this class.
@ -2584,7 +2584,6 @@ void nmethod::print_dependencies() {
// Print the oops from the underlying CodeBlob.
void nmethod::print_oops(outputStream* st) {
HandleMark hm;
ResourceMark m;
st->print("Oops:");
if (oops_begin() < oops_end()) {
@ -2610,7 +2609,6 @@ void nmethod::print_oops(outputStream* st) {
// Print metadata pool.
void nmethod::print_metadata(outputStream* st) {
HandleMark hm;
ResourceMark m;
st->print("Metadata:");
if (metadata_begin() < metadata_end()) {