Skip to content
Permalink
Browse files
8275150: URLClassLoaderTable should store OopHandle instead of Handle
Reviewed-by: stefank, minqi
  • Loading branch information
calvinccheung committed Oct 18, 2021
1 parent 72a976e commit bad75e6796aa7940a9418e317021242ba11d8d50
Showing 1 changed file with 6 additions and 5 deletions.
@@ -34,7 +34,8 @@
#include "memory/oopFactory.hpp"
#include "memory/resourceArea.hpp"
#include "oops/instanceKlass.hpp"
#include "runtime/handles.hpp"
#include "oops/oopHandle.inline.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/javaCalls.hpp"
#include "services/threadService.hpp"

@@ -72,7 +73,7 @@ InstanceKlass* UnregisteredClasses::load_class(Symbol* name, const char* path, T
}

class URLClassLoaderTable : public ResourceHashtable<
Symbol*, Handle,
Symbol*, OopHandle,
137, // prime number
ResourceObj::C_HEAP> {};

@@ -103,12 +104,12 @@ Handle UnregisteredClasses::get_url_classloader(Symbol* path, TRAPS) {
if (_url_classloader_table == NULL) {
_url_classloader_table = new (ResourceObj::C_HEAP, mtClass)URLClassLoaderTable();
}
Handle* url_classloader_ptr = _url_classloader_table->get(path);
OopHandle* url_classloader_ptr = _url_classloader_table->get(path);
if (url_classloader_ptr != NULL) {
return *url_classloader_ptr;
return Handle(THREAD, (*url_classloader_ptr).resolve());
} else {
Handle url_classloader = create_url_classloader(path, CHECK_NH);
_url_classloader_table->put(path, url_classloader);
_url_classloader_table->put(path, OopHandle(Universe::vm_global(), url_classloader()));
path->increment_refcount();
return url_classloader;
}

1 comment on commit bad75e6

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on bad75e6 Oct 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.