< prev index next >
src/share/vm/ci/ciInstanceKlass.cpp
Print this page
rev 12906 : [mq]: gc_interface
@@ -64,17 +64,20 @@
_has_injected_fields = -1;
_implementor = NULL; // we will fill these lazily
Thread *thread = Thread::current();
if (ciObjectFactory::is_initialized()) {
+ _holder = JNIHandles::make_local(thread, ik->klass_holder());
_loader = JNIHandles::make_local(thread, ik->class_loader());
_protection_domain = JNIHandles::make_local(thread,
ik->protection_domain());
_is_shared = false;
} else {
+ Handle h_holder(thread, ik->klass_holder());
Handle h_loader(thread, ik->class_loader());
Handle h_protection_domain(thread, ik->protection_domain());
+ _holder = JNIHandles::make_global(h_holder);
_loader = JNIHandles::make_global(h_loader);
_protection_domain = JNIHandles::make_global(h_protection_domain);
_is_shared = true;
}
@@ -92,11 +95,11 @@
_field_cache = NULL;
}
// Version for unloaded classes:
ciInstanceKlass::ciInstanceKlass(ciSymbol* name,
- jobject loader, jobject protection_domain)
+ jobject holder, jobject loader, jobject protection_domain)
: ciKlass(name, T_OBJECT)
{
assert(name->byte_at(0) != '[', "not an instance klass");
_init_state = (InstanceKlass::ClassState)0;
_nonstatic_field_size = -1;
@@ -132,10 +135,23 @@
return _has_subklass;
)
}
// ------------------------------------------------------------------
+// ciInstanceKlass::holder
+oop ciInstanceKlass::holder() {
+ ASSERT_IN_VM;
+ return JNIHandles::resolve(_holder);
+}
+
+// ------------------------------------------------------------------
+// ciInstanceKlass::holder_handle
+jobject ciInstanceKlass::holder_handle() {
+ return _holder;
+}
+
+// ------------------------------------------------------------------
// ciInstanceKlass::loader
oop ciInstanceKlass::loader() {
ASSERT_IN_VM;
return JNIHandles::resolve(_loader);
}
< prev index next >