This commit is contained in:
Serguei Spitsyn 2014-08-29 11:35:03 -07:00
commit f1aa6a6d0c
29 changed files with 62 additions and 132 deletions

@ -64,7 +64,10 @@ static jmethodID listAdd_ID = 0;
#define THROW_NEW_DEBUGGER_EXCEPTION(str) { throw_new_debugger_exception(env, str); return;}
void throw_new_debugger_exception(JNIEnv* env, const char* errMsg) {
(*env)->ThrowNew(env, (*env)->FindClass(env, "sun/jvm/hotspot/debugger/DebuggerException"), errMsg);
jclass clazz;
clazz = (*env)->FindClass(env, "sun/jvm/hotspot/debugger/DebuggerException");
CHECK_EXCEPTION;
(*env)->ThrowNew(env, clazz, errMsg);
}
struct ps_prochandle* get_proc_handle(JNIEnv* env, jobject this_obj) {
@ -149,11 +152,14 @@ static void fillThreadsAndLoadObjects(JNIEnv* env, jobject this_obj, struct ps_p
const char* name;
jobject loadObject;
jobject loadObjectList;
jstring str;
base = get_lib_base(ph, i);
name = get_lib_name(ph, i);
loadObject = (*env)->CallObjectMethod(env, this_obj, createLoadObject_ID,
(*env)->NewStringUTF(env, name), (jlong)0, (jlong)base);
str = (*env)->NewStringUTF(env, name);
CHECK_EXCEPTION;
loadObject = (*env)->CallObjectMethod(env, this_obj, createLoadObject_ID, str, (jlong)0, (jlong)base);
CHECK_EXCEPTION;
loadObjectList = (*env)->GetObjectField(env, this_obj, loadObjectList_ID);
CHECK_EXCEPTION;
@ -298,13 +304,18 @@ JNIEXPORT jlong JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_l
JNIEXPORT jobject JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_lookupByAddress0
(JNIEnv *env, jobject this_obj, jlong addr) {
uintptr_t offset;
jobject obj;
jstring str;
const char* sym = NULL;
struct ps_prochandle* ph = get_proc_handle(env, this_obj);
sym = symbol_for_pc(ph, (uintptr_t) addr, &offset);
if (sym == NULL) return 0;
return (*env)->CallObjectMethod(env, this_obj, createClosestSymbol_ID,
(*env)->NewStringUTF(env, sym), (jlong)offset);
str = (*env)->NewStringUTF(env, sym);
CHECK_EXCEPTION_(NULL);
obj = (*env)->CallObjectMethod(env, this_obj, createClosestSymbol_ID, str, (jlong)offset);
CHECK_EXCEPTION_(NULL);
return obj;
}
/*

@ -90,7 +90,9 @@ struct DebuggerWith2Objects : DebuggerWithObject {
*/
static void throwNewDebuggerException(JNIEnv* env, const char* errMsg) {
env->ThrowNew(env->FindClass("sun/jvm/hotspot/debugger/DebuggerException"), errMsg);
jclass clazz = env->FindClass("sun/jvm/hotspot/debugger/DebuggerException");
CHECK_EXCEPTION;
env->ThrowNew(clazz, errMsg);
}
// JNI ids for some fields, methods
@ -962,6 +964,7 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_proc_ProcDebuggerLoca
CHECK_EXCEPTION_(0);
jboolean isCopy;
jlong* ptr = env->GetLongArrayElements(res, &isCopy);
CHECK_EXCEPTION_(NULL);
for (int i = 0; i < NPRGREG; i++) {
ptr[i] = (jlong) (uintptr_t) gregs[i];
}
@ -1253,6 +1256,7 @@ JNIEXPORT jstring JNICALL Java_sun_jvm_hotspot_debugger_proc_ProcDebuggerLocal_d
(JNIEnv *env, jobject this_object, jstring name) {
jboolean isCopy;
const char* ptr = env->GetStringUTFChars(name, &isCopy);
CHECK_EXCEPTION_(NULL);
char buf[2*SYMBOL_BUF_SIZE + 1];
jstring res = 0;
if (cplus_demangle((char*) ptr, buf, sizeof(buf)) != DEMANGLE_ESPACE) {
@ -1439,7 +1443,9 @@ JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_proc_ProcDebuggerLocal_init
"createClosestSymbol", "(Ljava/lang/String;J)Lsun/jvm/hotspot/debugger/cdbg/ClosestSymbol;");
CHECK_EXCEPTION;
listAdd_ID = env->GetMethodID(env->FindClass("java/util/List"), "add", "(Ljava/lang/Object;)Z");
jclass list_clazz = env->FindClass("java/util/List");
CHECK_EXCEPTION;
listAdd_ID = env->GetMethodID(list_clazz, "add", "(Ljava/lang/Object;)Z");
CHECK_EXCEPTION;
// part of the class sharing workaround

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -49,7 +49,6 @@ public class ArrayKlass extends Klass {
higherDimension = new MetadataField(type.getAddressField("_higher_dimension"), 0);
lowerDimension = new MetadataField(type.getAddressField("_lower_dimension"), 0);
vtableLen = new CIntField(type.getCIntegerField("_vtable_len"), 0);
componentMirror = new OopField(type.getOopField("_component_mirror"), 0);
javaLangCloneableName = null;
javaLangObjectName = null;
javaIoSerializableName = null;
@ -63,7 +62,6 @@ public class ArrayKlass extends Klass {
private static MetadataField higherDimension;
private static MetadataField lowerDimension;
private static CIntField vtableLen;
private static OopField componentMirror;
public Klass getJavaSuper() {
SystemDictionary sysDict = VM.getVM().getSystemDictionary();
@ -74,7 +72,6 @@ public class ArrayKlass extends Klass {
public Klass getHigherDimension() { return (Klass) higherDimension.getValue(this); }
public Klass getLowerDimension() { return (Klass) lowerDimension.getValue(this); }
public long getVtableLen() { return vtableLen.getValue(this); }
public Oop getComponentMirror() { return componentMirror.getValue(this); }
// constant class names - javaLangCloneable, javaIoSerializable, javaLangObject
// Initialized lazily to avoid initialization ordering dependencies between ArrayKlass and SymbolTable
@ -144,6 +141,5 @@ public class ArrayKlass extends Klass {
visitor.doMetadata(higherDimension, true);
visitor.doMetadata(lowerDimension, true);
visitor.doCInt(vtableLen, true);
visitor.doOop(componentMirror, true);
}
}

@ -1,5 +1,5 @@
#
# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -125,7 +125,6 @@ SUNWprivate_1.1 {
JVM_GetClassSignature;
JVM_GetClassSigners;
JVM_GetClassTypeAnnotations;
JVM_GetComponentType;
JVM_GetDeclaredClasses;
JVM_GetDeclaringClass;
JVM_GetEnclosingMethodInfo;

@ -1,5 +1,5 @@
#
# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -125,7 +125,6 @@ SUNWprivate_1.1 {
JVM_GetClassSignature;
JVM_GetClassSigners;
JVM_GetClassTypeAnnotations;
JVM_GetComponentType;
JVM_GetDeclaredClasses;
JVM_GetDeclaringClass;
JVM_GetEnclosingMethodInfo;

@ -325,6 +325,10 @@ ifeq ($(USE_CLANG), true)
else ifeq ($(shell expr $(CC_VER_MAJOR) = 5 \& $(CC_VER_MINOR) = 1), 1)
OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
OPT_CFLAGS/unsafe.o += -O1
# Clang 6.0
else ifeq ($(shell expr $(CC_VER_MAJOR) = 6 \& $(CC_VER_MINOR) = 0), 1)
OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
OPT_CFLAGS/unsafe.o += -O1
else
$(error "Update compiler workarounds for Clang $(CC_VER_MAJOR).$(CC_VER_MINOR)")
endif

@ -1,5 +1,5 @@
#
# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -123,7 +123,6 @@
_JVM_GetClassSignature
_JVM_GetClassSigners
_JVM_GetClassTypeAnnotations
_JVM_GetComponentType
_JVM_GetDeclaredClasses
_JVM_GetDeclaringClass
_JVM_GetEnclosingMethodInfo

@ -1,5 +1,5 @@
#
# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -123,7 +123,6 @@
_JVM_GetClassSignature
_JVM_GetClassSigners
_JVM_GetClassTypeAnnotations
_JVM_GetComponentType
_JVM_GetDeclaredClasses
_JVM_GetDeclaringClass
_JVM_GetEnclosingMethodInfo

@ -1,5 +1,5 @@
#
# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -125,7 +125,6 @@ SUNWprivate_1.1 {
JVM_GetClassSignature;
JVM_GetClassSigners;
JVM_GetClassTypeAnnotations;
JVM_GetComponentType;
JVM_GetDeclaredClasses;
JVM_GetDeclaringClass;
JVM_GetEnclosingMethodInfo;

@ -1,5 +1,5 @@
#
# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -125,7 +125,6 @@ SUNWprivate_1.1 {
JVM_GetClassSignature;
JVM_GetClassSigners;
JVM_GetClassTypeAnnotations;
JVM_GetComponentType;
JVM_GetDeclaredClasses;
JVM_GetDeclaringClass;
JVM_GetEnclosingMethodInfo;

@ -1,5 +1,5 @@
#
# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -125,7 +125,6 @@ SUNWprivate_1.1 {
JVM_GetClassSignature;
JVM_GetClassSigners;
JVM_GetClassTypeAnnotations;
JVM_GetComponentType;
JVM_GetDeclaredClasses;
JVM_GetDeclaringClass;
JVM_GetEnclosingMethodInfo;

@ -1,5 +1,5 @@
#
# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -125,7 +125,6 @@ SUNWprivate_1.1 {
JVM_GetClassSignature;
JVM_GetClassSigners;
JVM_GetClassTypeAnnotations;
JVM_GetComponentType;
JVM_GetDeclaredClasses;
JVM_GetDeclaringClass;
JVM_GetEnclosingMethodInfo;

@ -1,5 +1,5 @@
#
# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -124,7 +124,6 @@ SUNWprivate_1.1 {
JVM_GetClassNameUTF;
JVM_GetClassSignature;
JVM_GetClassSigners;
JVM_GetComponentType;
JVM_GetClassTypeAnnotations;
JVM_GetDeclaredClasses;
JVM_GetDeclaringClass;

@ -1,5 +1,5 @@
#
# Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -53,9 +53,9 @@ ifeq ($(JRE_RELEASE_VER),1.6.0)
VALIDATED_COMPILER_REVS := 5.8
VALIDATED_CC_COMPILER_REVS := 5.8
else
# Validated compiler for JDK7 is SS12 update 1 + patches (5.10)
VALIDATED_COMPILER_REVS := 5.10
VALIDATED_CC_COMPILER_REVS := 5.10
# Validated compiler for JDK9 is SS12.3 (5.12)
VALIDATED_COMPILER_REVS := 5.12
VALIDATED_CC_COMPILER_REVS := 5.12
endif
# Warning messages about not using the above validated versions

@ -1678,14 +1678,9 @@ void os::print_dll_info(outputStream *st) {
dlclose(handle);
#elif defined(__APPLE__)
uint32_t count;
uint32_t i;
count = _dyld_image_count();
for (i = 1; i < count; i++) {
const char *name = _dyld_get_image_name(i);
intptr_t slide = _dyld_get_image_vmaddr_slide(i);
st->print_cr(PTR_FORMAT " \t%s", slide, name);
for (uint32_t i = 1; i < _dyld_image_count(); i++) {
st->print_cr(PTR_FORMAT " \t%s", _dyld_get_image_header(i),
_dyld_get_image_name(i));
}
#else
st->print_cr("Error: Cannot print dynamic libraries.");

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -52,11 +52,6 @@ public:
ciType* base_element_type(); // JLS calls this the "element type"
bool is_leaf_type(); // No subtypes of this array type.
ciInstance* component_mirror() {
// This is a real field in ArrayKlass, but we derive it from element_type.
return element_type()->java_mirror();
}
// What kind of vmObject is this?
bool is_array_klass() const { return true; }
bool is_java_klass() const { return true; }

@ -620,7 +620,6 @@ void java_lang_Class::create_mirror(KlassHandle k, Handle class_loader,
// Two-way link between the array klass and its component mirror:
// (array_klass) k -> mirror -> component_mirror -> array_klass -> k
set_component_mirror(mirror(), comp_mirror());
ArrayKlass::cast(k())->set_component_mirror(comp_mirror());
set_array_klass(comp_mirror(), k());
} else {
assert(k->oop_is_instance(), "Must be");
@ -682,10 +681,9 @@ 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) {
if (_component_mirror_offset != 0) {
assert(_component_mirror_offset != 0, "must be set");
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);
@ -875,22 +873,27 @@ void java_lang_Class::compute_offsets() {
assert(!offsets_computed, "offsets should be initialized only once");
offsets_computed = true;
Klass* klass_oop = SystemDictionary::Class_klass();
Klass* k = SystemDictionary::Class_klass();
// The classRedefinedCount field is only present starting in 1.5,
// so don't go fatal.
compute_optional_offset(classRedefinedCount_offset,
klass_oop, vmSymbols::classRedefinedCount_name(), vmSymbols::int_signature());
k, vmSymbols::classRedefinedCount_name(), vmSymbols::int_signature());
// Needs to be optional because the old build runs Queens during bootstrapping
// and jdk8-9 doesn't have coordinated pushes yet.
compute_optional_offset(_class_loader_offset,
klass_oop, vmSymbols::classLoader_name(),
k, vmSymbols::classLoader_name(),
vmSymbols::classloader_signature());
compute_optional_offset(_component_mirror_offset,
klass_oop, vmSymbols::componentType_name(),
compute_offset(_component_mirror_offset,
k, vmSymbols::componentType_name(),
vmSymbols::class_signature());
// Init lock is a C union with component_mirror. Only instanceKlass mirrors have
// init_lock and only ArrayKlass mirrors have component_mirror. Since both are oops
// GC treats them the same.
_init_lock_offset = _component_mirror_offset;
CLASS_INJECTED_FIELDS(INJECTED_FIELD_COMPUTE_OFFSET);
}

@ -222,7 +222,6 @@ class java_lang_String : AllStatic {
macro(java_lang_Class, oop_size, int_signature, false) \
macro(java_lang_Class, static_oop_field_count, int_signature, false) \
macro(java_lang_Class, protection_domain, object_signature, false) \
macro(java_lang_Class, init_lock, object_signature, false) \
macro(java_lang_Class, signers, object_signature, false)
class java_lang_Class : AllStatic {

@ -399,7 +399,6 @@
template(oop_size_name, "oop_size") \
template(static_oop_field_count_name, "static_oop_field_count") \
template(protection_domain_name, "protection_domain") \
template(init_lock_name, "init_lock") \
template(signers_name, "signers_name") \
template(loader_data_name, "loader_data") \
template(dependencies_name, "dependencies") \
@ -747,8 +746,6 @@
do_name( isPrimitive_name, "isPrimitive") \
do_intrinsic(_getSuperclass, java_lang_Class, getSuperclass_name, void_class_signature, F_RN) \
do_name( getSuperclass_name, "getSuperclass") \
do_intrinsic(_getComponentType, java_lang_Class, getComponentType_name, void_class_signature, F_RN) \
do_name( getComponentType_name, "getComponentType") \
\
do_intrinsic(_getClassAccessFlags, sun_reflect_Reflection, getClassAccessFlags_name, class_int_signature, F_SN) \
do_name( getClassAccessFlags_name, "getClassAccessFlags") \

@ -41,7 +41,7 @@
#define SET_ESTIMATED_SIZE(type, region) \
Shared ##region## Size = FLAG_IS_DEFAULT(Shared ##region## Size) ? \
(type ## SharedArchiveSize * region ## RegionPercentage) : Shared ## region ## Size
(uintx)(type ## SharedArchiveSize * region ## RegionPercentage) : Shared ## region ## Size
class FileMapInfo;

@ -78,7 +78,6 @@ ArrayKlass::ArrayKlass(Symbol* name) {
set_dimension(1);
set_higher_dimension(NULL);
set_lower_dimension(NULL);
set_component_mirror(NULL);
// Arrays don't add any new methods, so their vtable is the same size as
// the vtable of klass Object.
int vtable_size = Universe::base_vtable_size();
@ -160,14 +159,6 @@ void ArrayKlass::array_klasses_do(void f(Klass* k)) {
}
}
// GC support
void ArrayKlass::oops_do(OopClosure* cl) {
Klass::oops_do(cl);
cl->do_oop(adr_component_mirror());
}
// JVM support
jint ArrayKlass::compute_modifier_flags(TRAPS) const {
@ -182,8 +173,6 @@ jint ArrayKlass::jvmti_class_status() const {
void ArrayKlass::remove_unshareable_info() {
Klass::remove_unshareable_info();
// Clear the java mirror
set_component_mirror(NULL);
}
void ArrayKlass::restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain, TRAPS) {
@ -217,10 +206,6 @@ void ArrayKlass::oop_print_on(oop obj, outputStream* st) {
void ArrayKlass::verify_on(outputStream* st) {
Klass::verify_on(st);
if (component_mirror() != NULL) {
guarantee(component_mirror()->klass() != NULL, "should have a class");
}
}
void ArrayKlass::oop_verify_on(oop obj, outputStream* st) {

@ -39,7 +39,6 @@ class ArrayKlass: public Klass {
Klass* volatile _higher_dimension; // Refers the (n+1)'th-dimensional array (if present).
Klass* volatile _lower_dimension; // Refers the (n-1)'th-dimensional array (if present).
int _vtable_len; // size of vtable for this klass
oop _component_mirror; // component type, as a java/lang/Class
protected:
// Constructors
@ -70,13 +69,6 @@ class ArrayKlass: public Klass {
// type of elements (T_OBJECT for both oop arrays and array-arrays)
BasicType element_type() const { return layout_helper_element_type(layout_helper()); }
oop component_mirror() const { return _component_mirror; }
void set_component_mirror(oop m) { klass_oop_store(&_component_mirror, m); }
oop* adr_component_mirror() { return (oop*)&this->_component_mirror;}
// Compiler/Interpreter offset
static ByteSize component_mirror_offset() { return in_ByteSize(offset_of(ArrayKlass, _component_mirror)); }
virtual Klass* java_super() const;//{ return SystemDictionary::Object_klass(); }
// Allocation
@ -122,9 +114,6 @@ class ArrayKlass: public Klass {
void array_klasses_do(void f(Klass* k));
void array_klasses_do(void f(Klass* k, TRAPS), TRAPS);
// GC support
virtual void oops_do(OopClosure* cl);
// Return a handle.
static void complete_create_array_klass(ArrayKlass* k, KlassHandle super_klass, TRAPS);

@ -565,7 +565,7 @@ protected:
TRACE_DEFINE_KLASS_METHODS;
// garbage collection support
virtual void oops_do(OopClosure* cl);
void oops_do(OopClosure* cl);
// Iff the class loader (or mirror for anonymous classes) is alive the
// Klass is considered alive.

@ -836,7 +836,6 @@ bool LibraryCallKit::try_to_inline(int predicate) {
case vmIntrinsics::_isArray:
case vmIntrinsics::_isPrimitive:
case vmIntrinsics::_getSuperclass:
case vmIntrinsics::_getComponentType:
case vmIntrinsics::_getClassAccessFlags: return inline_native_Class_query(intrinsic_id());
case vmIntrinsics::_floatToRawIntBits:
@ -3400,10 +3399,6 @@ bool LibraryCallKit::inline_native_Class_query(vmIntrinsics::ID id) {
prim_return_value = null();
return_type = TypeInstPtr::MIRROR->cast_to_ptr_type(TypePtr::BotPTR);
break;
case vmIntrinsics::_getComponentType:
prim_return_value = null();
return_type = TypeInstPtr::MIRROR->cast_to_ptr_type(TypePtr::BotPTR);
break;
case vmIntrinsics::_getClassAccessFlags:
prim_return_value = intcon(JVM_ACC_ABSTRACT | JVM_ACC_FINAL | JVM_ACC_PUBLIC);
return_type = TypeInt::INT; // not bool! 6297094
@ -3520,17 +3515,6 @@ bool LibraryCallKit::inline_native_Class_query(vmIntrinsics::ID id) {
}
break;
case vmIntrinsics::_getComponentType:
if (generate_array_guard(kls, region) != NULL) {
// Be sure to pin the oop load to the guard edge just created:
Node* is_array_ctrl = region->in(region->req()-1);
Node* cma = basic_plus_adr(kls, in_bytes(ArrayKlass::component_mirror_offset()));
Node* cmo = make_load(is_array_ctrl, cma, TypeInstPtr::MIRROR, T_OBJECT, MemNode::unordered);
phi->add_req(cmo);
}
query_value = null(); // non-array case is null
break;
case vmIntrinsics::_getClassAccessFlags:
p = basic_plus_adr(kls, in_bytes(Klass::access_flags_offset()));
query_value = make_load(NULL, p, TypeInt::INT, T_INT, MemNode::unordered);

@ -1799,13 +1799,6 @@ const Type *LoadNode::Value( PhaseTransform *phase ) const {
}
const Type* aift = load_array_final_field(tkls, klass);
if (aift != NULL) return aift;
if (tkls->offset() == in_bytes(ArrayKlass::component_mirror_offset())
&& klass->is_array_klass()) {
// The field is ArrayKlass::_component_mirror. Return its (constant) value.
// (Folds up aClassConstant.getComponentType, common in Arrays.copyOf.)
assert(Opcode() == Op_LoadP, "must load an oop from _component_mirror");
return TypeInstPtr::make(klass->as_array_klass()->component_mirror());
}
if (tkls->offset() == in_bytes(Klass::java_mirror_offset())) {
// The field is Klass::_java_mirror. Return its (constant) value.
// (Folds up the 2nd indirection in anObjConstant.getClass().)
@ -2200,18 +2193,15 @@ Node* LoadNode::klass_identity_common(PhaseTransform *phase ) {
}
// Simplify k.java_mirror.as_klass to plain k, where k is a Klass*.
// Simplify ak.component_mirror.array_klass to plain ak, ak an ArrayKlass.
// See inline_native_Class_query for occurrences of these patterns.
// Java Example: x.getClass().isAssignableFrom(y)
// Java Example: Array.newInstance(x.getClass().getComponentType(), n)
//
// This improves reflective code, often making the Class
// mirror go completely dead. (Current exception: Class
// mirrors may appear in debug info, but we could clean them out by
// introducing a new debug info operator for Klass*.java_mirror).
if (toop->isa_instptr() && toop->klass() == phase->C->env()->Class_klass()
&& (offset == java_lang_Class::klass_offset_in_bytes() ||
offset == java_lang_Class::array_klass_offset_in_bytes())) {
&& offset == java_lang_Class::klass_offset_in_bytes()) {
// We are loading a special hidden field from a Class mirror,
// the field which points to its Klass or ArrayKlass metaobject.
if (base->is_Load()) {
@ -2223,9 +2213,6 @@ Node* LoadNode::klass_identity_common(PhaseTransform *phase ) {
&& adr2->is_AddP()
) {
int mirror_field = in_bytes(Klass::java_mirror_offset());
if (offset == java_lang_Class::array_klass_offset_in_bytes()) {
mirror_field = in_bytes(ArrayKlass::component_mirror_offset());
}
if (tkls->offset() == mirror_field) {
return adr2->in(AddPNode::Base);
}

@ -1403,14 +1403,6 @@ JVM_QUICK_ENTRY(jboolean, JVM_IsPrimitiveClass(JNIEnv *env, jclass cls))
JVM_END
JVM_ENTRY(jclass, JVM_GetComponentType(JNIEnv *env, jclass cls))
JVMWrapper("JVM_GetComponentType");
oop mirror = JNIHandles::resolve_non_null(cls);
oop result = Reflection::array_component_type(mirror, CHECK_NULL);
return (jclass) JNIHandles::make_local(env, result);
JVM_END
JVM_ENTRY(jint, JVM_GetClassModifiers(JNIEnv *env, jclass cls))
JVMWrapper("JVM_GetClassModifiers");
if (java_lang_Class::is_primitive(JNIHandles::resolve_non_null(cls))) {

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -483,9 +483,6 @@ JVM_IsArrayClass(JNIEnv *env, jclass cls);
JNIEXPORT jboolean JNICALL
JVM_IsPrimitiveClass(JNIEnv *env, jclass cls);
JNIEXPORT jclass JNICALL
JVM_GetComponentType(JNIEnv *env, jclass cls);
JNIEXPORT jint JNICALL
JVM_GetClassModifiers(JNIEnv *env, jclass cls);

@ -390,7 +390,7 @@ oop Reflection::array_component_type(oop mirror, TRAPS) {
return NULL;
}
oop result = ArrayKlass::cast(klass)->component_mirror();
oop result = java_lang_Class::component_mirror(mirror);
#ifdef ASSERT
oop result2 = NULL;
if (ArrayKlass::cast(klass)->dimension() == 1) {

@ -274,7 +274,6 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
volatile_nonstatic_field(ArrayKlass, _higher_dimension, Klass*) \
volatile_nonstatic_field(ArrayKlass, _lower_dimension, Klass*) \
nonstatic_field(ArrayKlass, _vtable_len, int) \
nonstatic_field(ArrayKlass, _component_mirror, oop) \
nonstatic_field(CompiledICHolder, _holder_method, Method*) \
nonstatic_field(CompiledICHolder, _holder_klass, Klass*) \
nonstatic_field(ConstantPool, _tags, Array<u1>*) \