Skip to content
Closed
10 changes: 6 additions & 4 deletions src/hotspot/share/classfile/javaClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1273,8 +1273,11 @@ void java_lang_Class::set_protection_domain(oop java_class, oop pd) {

void java_lang_Class::set_component_mirror(oop java_class, oop comp_mirror) {
assert(_component_mirror_offset != 0, "must be set");
java_class->obj_field_put(_component_mirror_offset, comp_mirror);
}
assert(java_lang_Class::as_Klass(java_class) != nullptr &&
java_lang_Class::as_Klass(java_class)->is_array_klass(), "must be");
java_class->obj_field_put(_component_mirror_offset, comp_mirror);
}

oop java_lang_Class::component_mirror(oop java_class) {
assert(_component_mirror_offset != 0, "must be set");
return java_class->obj_field(_component_mirror_offset);
Expand Down Expand Up @@ -1355,8 +1358,7 @@ void java_lang_Class::set_is_primitive(oop java_class) {


oop java_lang_Class::create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS) {
// This should be improved by adding a field at the Java level or by
// introducing a new VM klass (see comment in ClassFileParser)
// Mirrors for basic types have a null klass field, which makes them special.
oop java_class = InstanceMirrorKlass::cast(vmClasses::Class_klass())->allocate_instance(nullptr, CHECK_NULL);
if (type != T_VOID) {
Klass* aklass = Universe::typeArrayKlass(type);
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/classfile/javaClasses.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ inline bool java_lang_Class::is_primitive(oop java_class) {
#ifdef ASSERT
// The heapwalker walks through Classes that have had their Klass pointers removed, so can't assert this.
// assert(is_primitive == java_class->bool_field(_is_primitive_offset), "must match what we told Java");
if (is_primitive) {
if (java_class->bool_field(_is_primitive_offset)) {
Klass* k = ((Klass*)java_class->metadata_field(_array_klass_offset));
assert(k == nullptr || is_java_primitive(ArrayKlass::cast(k)->element_type()),
"Should be either the T_VOID primitive or a java primitive");
Expand Down
9 changes: 0 additions & 9 deletions src/hotspot/share/include/jvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -546,15 +546,6 @@ JVM_GetClassInterfaces(JNIEnv *env, jclass cls);
JNIEXPORT jboolean JNICALL
JVM_IsInterface(JNIEnv *env, jclass cls);

JNIEXPORT jobject JNICALL
JVM_GetProtectionDomain(JNIEnv *env, jclass cls);

JNIEXPORT jboolean JNICALL
JVM_IsArrayClass(JNIEnv *env, jclass cls);

JNIEXPORT jboolean JNICALL
JVM_IsPrimitiveClass(JNIEnv *env, jclass cls);

JNIEXPORT jboolean JNICALL
JVM_IsHiddenClass(JNIEnv *env, jclass cls);

Expand Down