Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8275150: URLClassLoaderTable should store OopHandle instead of Handle #5972

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -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;
}