RFR: 8289164: Convert ResolutionErrorTable to use ResourceHashtable

Ioi Lam iklam at openjdk.org
Fri Jul 1 16:38:46 UTC 2022


On Thu, 30 Jun 2022 15:15:45 GMT, Justin Gu <duke at openjdk.org> wrote:

> Please review my change of converting the resolutionErrorTable from hashtable to resource hashtable. I tested my changes with a mach5 tier1-4 test.

This looks very nice and much simpler than before. I found one issue that needs to be fixed.

src/hotspot/share/classfile/resolutionErrors.cpp line 144:

> 142:   bool do_entry(uintptr_t key, ResolutionErrorEntry* value) {
> 143:     ConstantPool* pool = value -> pool();
> 144:     return !(pool->pool_holder()->is_loader_alive());

The `ResolutionErrorEntry` also needs to be freed. I think it can be done like this:


if (!(pool->pool_holder()->is_loader_alive())) {
  delete value;
  return true;
} else {
  return false;
}


You can add some `tty->print_cr` in `ResolutionErrorEntry::~ResolutionErrorEntry()` to verify that the destructor is actually called (I believe it's not called with the current version of this PR). Or, you can set a breakpoint there inside a debugger.

Similar changes are needed in `ResolutionErrorDeleteIterate`

-------------

Changes requested by iklam (Reviewer).

PR: https://git.openjdk.org/jdk/pull/9337


More information about the hotspot-dev mailing list