mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-25 22:04:51 +02:00
8001471: Klass::cast() does nothing
Remove function Klass::cast() and calls to it. Reviewed-by: dholmes, coleenp
This commit is contained in:
parent
a988fc0968
commit
4aad9b74e7
54 changed files with 343 additions and 351 deletions
|
@ -374,7 +374,7 @@ JRT_END
|
||||||
|
|
||||||
JRT_ENTRY(void, Runtime1::throw_array_store_exception(JavaThread* thread, oopDesc* obj))
|
JRT_ENTRY(void, Runtime1::throw_array_store_exception(JavaThread* thread, oopDesc* obj))
|
||||||
ResourceMark rm(thread);
|
ResourceMark rm(thread);
|
||||||
const char* klass_name = Klass::cast(obj->klass())->external_name();
|
const char* klass_name = obj->klass()->external_name();
|
||||||
SharedRuntime::throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_ArrayStoreException(), klass_name);
|
SharedRuntime::throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_ArrayStoreException(), klass_name);
|
||||||
JRT_END
|
JRT_END
|
||||||
|
|
||||||
|
@ -631,7 +631,7 @@ JRT_ENTRY(void, Runtime1::throw_class_cast_exception(JavaThread* thread, oopDesc
|
||||||
NOT_PRODUCT(_throw_class_cast_exception_count++;)
|
NOT_PRODUCT(_throw_class_cast_exception_count++;)
|
||||||
ResourceMark rm(thread);
|
ResourceMark rm(thread);
|
||||||
char* message = SharedRuntime::generate_class_cast_message(
|
char* message = SharedRuntime::generate_class_cast_message(
|
||||||
thread, Klass::cast(object->klass())->external_name());
|
thread, object->klass()->external_name());
|
||||||
SharedRuntime::throw_and_post_jvmti_exception(
|
SharedRuntime::throw_and_post_jvmti_exception(
|
||||||
thread, vmSymbols::java_lang_ClassCastException(), message);
|
thread, vmSymbols::java_lang_ClassCastException(), message);
|
||||||
JRT_END
|
JRT_END
|
||||||
|
@ -876,7 +876,7 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i
|
||||||
case Bytecodes::_anewarray:
|
case Bytecodes::_anewarray:
|
||||||
{ Bytecode_anewarray anew(caller_method(), caller_method->bcp_from(bci));
|
{ Bytecode_anewarray anew(caller_method(), caller_method->bcp_from(bci));
|
||||||
Klass* ek = caller_method->constants()->klass_at(anew.index(), CHECK);
|
Klass* ek = caller_method->constants()->klass_at(anew.index(), CHECK);
|
||||||
k = Klass::cast(ek)->array_klass(CHECK);
|
k = ek->array_klass(CHECK);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Bytecodes::_ldc:
|
case Bytecodes::_ldc:
|
||||||
|
@ -1236,7 +1236,7 @@ template <class T> int obj_arraycopy_work(oopDesc* src, T* src_addr,
|
||||||
} else {
|
} else {
|
||||||
Klass* bound = ObjArrayKlass::cast(dst->klass())->element_klass();
|
Klass* bound = ObjArrayKlass::cast(dst->klass())->element_klass();
|
||||||
Klass* stype = ObjArrayKlass::cast(src->klass())->element_klass();
|
Klass* stype = ObjArrayKlass::cast(src->klass())->element_klass();
|
||||||
if (stype == bound || Klass::cast(stype)->is_subtype_of(bound)) {
|
if (stype == bound || stype->is_subtype_of(bound)) {
|
||||||
// Elements are guaranteed to be subtypes, so no check necessary
|
// Elements are guaranteed to be subtypes, so no check necessary
|
||||||
bs->write_ref_array_pre(dst_addr, length);
|
bs->write_ref_array_pre(dst_addr, length);
|
||||||
Copy::conjoint_oops_atomic(src_addr, dst_addr, length);
|
Copy::conjoint_oops_atomic(src_addr, dst_addr, length);
|
||||||
|
|
|
@ -426,7 +426,7 @@ ciKlass* ciEnv::get_klass_by_name_impl(ciKlass* accessing_klass,
|
||||||
for (int i = cpool->length() - 1; i >= 1; i--) {
|
for (int i = cpool->length() - 1; i >= 1; i--) {
|
||||||
if (cpool->tag_at(i).is_klass()) {
|
if (cpool->tag_at(i).is_klass()) {
|
||||||
Klass* kls = cpool->resolved_klass_at(i);
|
Klass* kls = cpool->resolved_klass_at(i);
|
||||||
if (Klass::cast(kls)->name() == sym) {
|
if (kls->name() == sym) {
|
||||||
found_klass = KlassHandle(THREAD, kls);
|
found_klass = KlassHandle(THREAD, kls);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ ciType::ciType(BasicType basic_type) : ciMetadata() {
|
||||||
}
|
}
|
||||||
|
|
||||||
ciType::ciType(KlassHandle k) : ciMetadata(k()) {
|
ciType::ciType(KlassHandle k) : ciMetadata(k()) {
|
||||||
_basic_type = Klass::cast(k())->oop_is_array() ? T_ARRAY : T_OBJECT;
|
_basic_type = k()->oop_is_array() ? T_ARRAY : T_OBJECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -824,7 +824,7 @@ Array<Klass*>* ClassFileParser::parse_interfaces(constantPoolHandle cp,
|
||||||
interf = KlassHandle(THREAD, k);
|
interf = KlassHandle(THREAD, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Klass::cast(interf())->is_interface()) {
|
if (!interf()->is_interface()) {
|
||||||
THROW_MSG_(vmSymbols::java_lang_IncompatibleClassChangeError(), "Implementing class", NULL);
|
THROW_MSG_(vmSymbols::java_lang_IncompatibleClassChangeError(), "Implementing class", NULL);
|
||||||
}
|
}
|
||||||
if (InstanceKlass::cast(interf())->has_default_methods()) {
|
if (InstanceKlass::cast(interf())->has_default_methods()) {
|
||||||
|
@ -3831,7 +3831,7 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name,
|
||||||
if (TraceClassResolution) {
|
if (TraceClassResolution) {
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
// print out the superclass.
|
// print out the superclass.
|
||||||
const char * from = Klass::cast(this_klass())->external_name();
|
const char * from = this_klass()->external_name();
|
||||||
if (this_klass->java_super() != NULL) {
|
if (this_klass->java_super() != NULL) {
|
||||||
tty->print("RESOLVE %s %s (super)\n", from, InstanceKlass::cast(this_klass->java_super())->external_name());
|
tty->print("RESOLVE %s %s (super)\n", from, InstanceKlass::cast(this_klass->java_super())->external_name());
|
||||||
}
|
}
|
||||||
|
@ -3982,13 +3982,13 @@ void ClassFileParser::set_precomputed_flags(instanceKlassHandle k) {
|
||||||
// java.lang.Object has empty default constructor
|
// java.lang.Object has empty default constructor
|
||||||
k->set_has_vanilla_constructor();
|
k->set_has_vanilla_constructor();
|
||||||
} else {
|
} else {
|
||||||
if (Klass::cast(super)->has_vanilla_constructor() &&
|
if (super->has_vanilla_constructor() &&
|
||||||
_has_vanilla_constructor) {
|
_has_vanilla_constructor) {
|
||||||
k->set_has_vanilla_constructor();
|
k->set_has_vanilla_constructor();
|
||||||
}
|
}
|
||||||
#ifdef ASSERT
|
#ifdef ASSERT
|
||||||
bool v = false;
|
bool v = false;
|
||||||
if (Klass::cast(super)->has_vanilla_constructor()) {
|
if (super->has_vanilla_constructor()) {
|
||||||
Method* constructor = k->find_method(vmSymbols::object_initializer_name(
|
Method* constructor = k->find_method(vmSymbols::object_initializer_name(
|
||||||
), vmSymbols::void_method_signature());
|
), vmSymbols::void_method_signature());
|
||||||
if (constructor != NULL && constructor->is_vanilla_constructor()) {
|
if (constructor != NULL && constructor->is_vanilla_constructor()) {
|
||||||
|
@ -4130,7 +4130,7 @@ void ClassFileParser::check_super_interface_access(instanceKlassHandle this_klas
|
||||||
int lng = local_interfaces->length();
|
int lng = local_interfaces->length();
|
||||||
for (int i = lng - 1; i >= 0; i--) {
|
for (int i = lng - 1; i >= 0; i--) {
|
||||||
Klass* k = local_interfaces->at(i);
|
Klass* k = local_interfaces->at(i);
|
||||||
assert (k != NULL && Klass::cast(k)->is_interface(), "invalid interface");
|
assert (k != NULL && k->is_interface(), "invalid interface");
|
||||||
if (!Reflection::verify_class_access(this_klass(), k, false)) {
|
if (!Reflection::verify_class_access(this_klass(), k, false)) {
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
Exceptions::fthrow(
|
Exceptions::fthrow(
|
||||||
|
|
|
@ -346,7 +346,7 @@ void Dictionary::add_klass(Symbol* class_name, ClassLoaderData* loader_data,
|
||||||
KlassHandle obj) {
|
KlassHandle obj) {
|
||||||
assert_locked_or_safepoint(SystemDictionary_lock);
|
assert_locked_or_safepoint(SystemDictionary_lock);
|
||||||
assert(obj() != NULL, "adding NULL obj");
|
assert(obj() != NULL, "adding NULL obj");
|
||||||
assert(Klass::cast(obj())->name() == class_name, "sanity check on name");
|
assert(obj()->name() == class_name, "sanity check on name");
|
||||||
|
|
||||||
unsigned int hash = compute_hash(class_name, loader_data);
|
unsigned int hash = compute_hash(class_name, loader_data);
|
||||||
int index = hash_to_index(hash);
|
int index = hash_to_index(hash);
|
||||||
|
@ -553,7 +553,7 @@ void Dictionary::print() {
|
||||||
bool is_defining_class =
|
bool is_defining_class =
|
||||||
(loader_data == InstanceKlass::cast(e)->class_loader_data());
|
(loader_data == InstanceKlass::cast(e)->class_loader_data());
|
||||||
tty->print("%s%s", is_defining_class ? " " : "^",
|
tty->print("%s%s", is_defining_class ? " " : "^",
|
||||||
Klass::cast(e)->external_name());
|
e->external_name());
|
||||||
|
|
||||||
tty->print(", loader ");
|
tty->print(", loader ");
|
||||||
loader_data->print_value();
|
loader_data->print_value();
|
||||||
|
@ -575,7 +575,7 @@ void Dictionary::verify() {
|
||||||
probe = probe->next()) {
|
probe = probe->next()) {
|
||||||
Klass* e = probe->klass();
|
Klass* e = probe->klass();
|
||||||
ClassLoaderData* loader_data = probe->loader_data();
|
ClassLoaderData* loader_data = probe->loader_data();
|
||||||
guarantee(Klass::cast(e)->oop_is_instance(),
|
guarantee(e->oop_is_instance(),
|
||||||
"Verify of system dictionary failed");
|
"Verify of system dictionary failed");
|
||||||
// class loader must be present; a null class loader is the
|
// class loader must be present; a null class loader is the
|
||||||
// boostrap loader
|
// boostrap loader
|
||||||
|
|
|
@ -545,7 +545,7 @@ oop java_lang_Class::create_mirror(KlassHandle k, TRAPS) {
|
||||||
assert(k->oop_is_objArray(), "Must be");
|
assert(k->oop_is_objArray(), "Must be");
|
||||||
Klass* element_klass = ObjArrayKlass::cast(k())->element_klass();
|
Klass* element_klass = ObjArrayKlass::cast(k())->element_klass();
|
||||||
assert(element_klass != NULL, "Must have an element klass");
|
assert(element_klass != NULL, "Must have an element klass");
|
||||||
comp_mirror = Klass::cast(element_klass)->java_mirror();
|
comp_mirror = element_klass->java_mirror();
|
||||||
}
|
}
|
||||||
assert(comp_mirror.not_null(), "must have a mirror");
|
assert(comp_mirror.not_null(), "must have a mirror");
|
||||||
|
|
||||||
|
@ -628,8 +628,8 @@ void java_lang_Class::print_signature(oop java_class, outputStream* st) {
|
||||||
name = vmSymbols::type_signature(primitive_type(java_class));
|
name = vmSymbols::type_signature(primitive_type(java_class));
|
||||||
} else {
|
} else {
|
||||||
Klass* k = as_Klass(java_class);
|
Klass* k = as_Klass(java_class);
|
||||||
is_instance = Klass::cast(k)->oop_is_instance();
|
is_instance = k->oop_is_instance();
|
||||||
name = Klass::cast(k)->name();
|
name = k->name();
|
||||||
}
|
}
|
||||||
if (name == NULL) {
|
if (name == NULL) {
|
||||||
st->print("<null>");
|
st->print("<null>");
|
||||||
|
@ -651,12 +651,12 @@ Symbol* java_lang_Class::as_signature(oop java_class, bool intern_if_not_found,
|
||||||
name->increment_refcount();
|
name->increment_refcount();
|
||||||
} else {
|
} else {
|
||||||
Klass* k = as_Klass(java_class);
|
Klass* k = as_Klass(java_class);
|
||||||
if (!Klass::cast(k)->oop_is_instance()) {
|
if (!k->oop_is_instance()) {
|
||||||
name = Klass::cast(k)->name();
|
name = k->name();
|
||||||
name->increment_refcount();
|
name->increment_refcount();
|
||||||
} else {
|
} else {
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
const char* sigstr = Klass::cast(k)->signature_name();
|
const char* sigstr = k->signature_name();
|
||||||
int siglen = (int) strlen(sigstr);
|
int siglen = (int) strlen(sigstr);
|
||||||
if (!intern_if_not_found) {
|
if (!intern_if_not_found) {
|
||||||
name = SymbolTable::probe(sigstr, siglen);
|
name = SymbolTable::probe(sigstr, siglen);
|
||||||
|
@ -671,13 +671,13 @@ Symbol* java_lang_Class::as_signature(oop java_class, bool intern_if_not_found,
|
||||||
|
|
||||||
Klass* java_lang_Class::array_klass(oop java_class) {
|
Klass* java_lang_Class::array_klass(oop java_class) {
|
||||||
Klass* k = ((Klass*)java_class->metadata_field(_array_klass_offset));
|
Klass* k = ((Klass*)java_class->metadata_field(_array_klass_offset));
|
||||||
assert(k == NULL || k->is_klass() && Klass::cast(k)->oop_is_array(), "should be array klass");
|
assert(k == NULL || k->is_klass() && k->oop_is_array(), "should be array klass");
|
||||||
return k;
|
return k;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void java_lang_Class::set_array_klass(oop java_class, Klass* klass) {
|
void java_lang_Class::set_array_klass(oop java_class, Klass* klass) {
|
||||||
assert(klass->is_klass() && Klass::cast(klass)->oop_is_array(), "should be array klass");
|
assert(klass->is_klass() && klass->oop_is_array(), "should be array klass");
|
||||||
java_class->metadata_field_put(_array_klass_offset, klass);
|
java_class->metadata_field_put(_array_klass_offset, klass);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -912,7 +912,7 @@ class java_lang_invoke_MethodHandle: AllStatic {
|
||||||
|
|
||||||
// Testers
|
// Testers
|
||||||
static bool is_subclass(Klass* klass) {
|
static bool is_subclass(Klass* klass) {
|
||||||
return Klass::cast(klass)->is_subclass_of(SystemDictionary::MethodHandle_klass());
|
return klass->is_subclass_of(SystemDictionary::MethodHandle_klass());
|
||||||
}
|
}
|
||||||
static bool is_instance(oop obj) {
|
static bool is_instance(oop obj) {
|
||||||
return obj != NULL && is_subclass(obj->klass());
|
return obj != NULL && is_subclass(obj->klass());
|
||||||
|
@ -942,7 +942,7 @@ class java_lang_invoke_LambdaForm: AllStatic {
|
||||||
// Testers
|
// Testers
|
||||||
static bool is_subclass(Klass* klass) {
|
static bool is_subclass(Klass* klass) {
|
||||||
return SystemDictionary::LambdaForm_klass() != NULL &&
|
return SystemDictionary::LambdaForm_klass() != NULL &&
|
||||||
Klass::cast(klass)->is_subclass_of(SystemDictionary::LambdaForm_klass());
|
klass->is_subclass_of(SystemDictionary::LambdaForm_klass());
|
||||||
}
|
}
|
||||||
static bool is_instance(oop obj) {
|
static bool is_instance(oop obj) {
|
||||||
return obj != NULL && is_subclass(obj->klass());
|
return obj != NULL && is_subclass(obj->klass());
|
||||||
|
@ -1004,7 +1004,7 @@ class java_lang_invoke_MemberName: AllStatic {
|
||||||
|
|
||||||
// Testers
|
// Testers
|
||||||
static bool is_subclass(Klass* klass) {
|
static bool is_subclass(Klass* klass) {
|
||||||
return Klass::cast(klass)->is_subclass_of(SystemDictionary::MemberName_klass());
|
return klass->is_subclass_of(SystemDictionary::MemberName_klass());
|
||||||
}
|
}
|
||||||
static bool is_instance(oop obj) {
|
static bool is_instance(oop obj) {
|
||||||
return obj != NULL && is_subclass(obj->klass());
|
return obj != NULL && is_subclass(obj->klass());
|
||||||
|
@ -1090,7 +1090,7 @@ public:
|
||||||
|
|
||||||
// Testers
|
// Testers
|
||||||
static bool is_subclass(Klass* klass) {
|
static bool is_subclass(Klass* klass) {
|
||||||
return Klass::cast(klass)->is_subclass_of(SystemDictionary::CallSite_klass());
|
return klass->is_subclass_of(SystemDictionary::CallSite_klass());
|
||||||
}
|
}
|
||||||
static bool is_instance(oop obj) {
|
static bool is_instance(oop obj) {
|
||||||
return obj != NULL && is_subclass(obj->klass());
|
return obj != NULL && is_subclass(obj->klass());
|
||||||
|
@ -1160,7 +1160,7 @@ class java_lang_ClassLoader : AllStatic {
|
||||||
|
|
||||||
// Testers
|
// Testers
|
||||||
static bool is_subclass(Klass* klass) {
|
static bool is_subclass(Klass* klass) {
|
||||||
return Klass::cast(klass)->is_subclass_of(SystemDictionary::ClassLoader_klass());
|
return klass->is_subclass_of(SystemDictionary::ClassLoader_klass());
|
||||||
}
|
}
|
||||||
static bool is_instance(oop obj) {
|
static bool is_instance(oop obj) {
|
||||||
return obj != NULL && is_subclass(obj->klass());
|
return obj != NULL && is_subclass(obj->klass());
|
||||||
|
|
|
@ -320,7 +320,7 @@ Klass* LoaderConstraintTable::find_constrained_klass(Symbol* name,
|
||||||
Handle loader) {
|
Handle loader) {
|
||||||
LoaderConstraintEntry *p = *(find_loader_constraint(name, loader));
|
LoaderConstraintEntry *p = *(find_loader_constraint(name, loader));
|
||||||
if (p != NULL && p->klass() != NULL) {
|
if (p != NULL && p->klass() != NULL) {
|
||||||
if (Klass::cast(p->klass())->oop_is_instance() && !InstanceKlass::cast(p->klass())->is_loaded()) {
|
if (p->klass()->oop_is_instance() && !InstanceKlass::cast(p->klass())->is_loaded()) {
|
||||||
// Only return fully loaded classes. Classes found through the
|
// Only return fully loaded classes. Classes found through the
|
||||||
// constraints might still be in the process of loading.
|
// constraints might still be in the process of loading.
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -45,7 +45,7 @@ PlaceholderEntry* PlaceholderTable::new_entry(int hash, Symbol* name,
|
||||||
entry->set_loadInstanceThreadQ(NULL);
|
entry->set_loadInstanceThreadQ(NULL);
|
||||||
entry->set_defineThreadQ(NULL);
|
entry->set_defineThreadQ(NULL);
|
||||||
entry->set_definer(NULL);
|
entry->set_definer(NULL);
|
||||||
entry->set_instanceKlass(NULL);
|
entry->set_instance_klass(NULL);
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ void PlaceholderTable::classes_do(KlassClosure* f) {
|
||||||
void PlaceholderEntry::classes_do(KlassClosure* closure) {
|
void PlaceholderEntry::classes_do(KlassClosure* closure) {
|
||||||
assert(klassname() != NULL, "should have a non-null klass");
|
assert(klassname() != NULL, "should have a non-null klass");
|
||||||
if (_instanceKlass != NULL) {
|
if (_instanceKlass != NULL) {
|
||||||
closure->do_klass(InstanceKlass());
|
closure->do_klass(instance_klass());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -220,9 +220,9 @@ void PlaceholderEntry::print() const {
|
||||||
tty->print(", definer ");
|
tty->print(", definer ");
|
||||||
definer()->print_value();
|
definer()->print_value();
|
||||||
}
|
}
|
||||||
if (InstanceKlass() != NULL) {
|
if (instance_klass() != NULL) {
|
||||||
tty->print(", InstanceKlass ");
|
tty->print(", InstanceKlass ");
|
||||||
InstanceKlass()->print_value();
|
instance_klass()->print_value();
|
||||||
}
|
}
|
||||||
tty->print("\n");
|
tty->print("\n");
|
||||||
tty->print("loadInstanceThreadQ threads:");
|
tty->print("loadInstanceThreadQ threads:");
|
||||||
|
@ -241,9 +241,9 @@ void PlaceholderEntry::verify() const {
|
||||||
guarantee(loader_data() != NULL, "Must have been setup.");
|
guarantee(loader_data() != NULL, "Must have been setup.");
|
||||||
guarantee(loader_data()->class_loader() == NULL || loader_data()->class_loader()->is_instance(),
|
guarantee(loader_data()->class_loader() == NULL || loader_data()->class_loader()->is_instance(),
|
||||||
"checking type of _loader");
|
"checking type of _loader");
|
||||||
guarantee(InstanceKlass() == NULL
|
guarantee(instance_klass() == NULL
|
||||||
|| Klass::cast(InstanceKlass())->oop_is_instance(),
|
|| instance_klass()->oop_is_instance(),
|
||||||
"checking type of InstanceKlass result");
|
"checking type of instance_klass result");
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlaceholderTable::verify() {
|
void PlaceholderTable::verify() {
|
||||||
|
|
|
@ -191,8 +191,8 @@ class PlaceholderEntry : public HashtableEntry<Symbol*, mtClass> {
|
||||||
Thread* definer() const {return _definer; }
|
Thread* definer() const {return _definer; }
|
||||||
void set_definer(Thread* definer) { _definer = definer; }
|
void set_definer(Thread* definer) { _definer = definer; }
|
||||||
|
|
||||||
Klass* InstanceKlass() const {return _instanceKlass; }
|
Klass* instance_klass() const {return _instanceKlass; }
|
||||||
void set_instanceKlass(Klass* InstanceKlass) { _instanceKlass = InstanceKlass; }
|
void set_instance_klass(Klass* ik) { _instanceKlass = ik; }
|
||||||
|
|
||||||
SeenThread* superThreadQ() const { return _superThreadQ; }
|
SeenThread* superThreadQ() const { return _superThreadQ; }
|
||||||
void set_superThreadQ(SeenThread* SeenThread) { _superThreadQ = SeenThread; }
|
void set_superThreadQ(SeenThread* SeenThread) { _superThreadQ = SeenThread; }
|
||||||
|
|
|
@ -240,7 +240,7 @@ Klass* SystemDictionary::resolve_array_class_or_null(Symbol* class_name,
|
||||||
protection_domain,
|
protection_domain,
|
||||||
CHECK_NULL);
|
CHECK_NULL);
|
||||||
if (k != NULL) {
|
if (k != NULL) {
|
||||||
k = Klass::cast(k)->array_klass(fd.dimension(), CHECK_NULL);
|
k = k->array_klass(fd.dimension(), CHECK_NULL);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
k = Universe::typeArrayKlassObj(t);
|
k = Universe::typeArrayKlassObj(t);
|
||||||
|
@ -328,8 +328,8 @@ Klass* SystemDictionary::resolve_super_or_fail(Symbol* child_name,
|
||||||
if ((childk != NULL ) && (is_superclass) &&
|
if ((childk != NULL ) && (is_superclass) &&
|
||||||
((quicksuperk = InstanceKlass::cast(childk)->super()) != NULL) &&
|
((quicksuperk = InstanceKlass::cast(childk)->super()) != NULL) &&
|
||||||
|
|
||||||
((Klass::cast(quicksuperk)->name() == class_name) &&
|
((quicksuperk->name() == class_name) &&
|
||||||
(Klass::cast(quicksuperk)->class_loader() == class_loader()))) {
|
(quicksuperk->class_loader() == class_loader()))) {
|
||||||
return quicksuperk;
|
return quicksuperk;
|
||||||
} else {
|
} else {
|
||||||
PlaceholderEntry* probe = placeholders()->get_entry(p_index, p_hash, child_name, loader_data);
|
PlaceholderEntry* probe = placeholders()->get_entry(p_index, p_hash, child_name, loader_data);
|
||||||
|
@ -928,7 +928,7 @@ Klass* SystemDictionary::find_instance_or_array_klass(Symbol* class_name,
|
||||||
k = SystemDictionary::find(fd.object_key(), class_loader, protection_domain, THREAD);
|
k = SystemDictionary::find(fd.object_key(), class_loader, protection_domain, THREAD);
|
||||||
}
|
}
|
||||||
if (k != NULL) {
|
if (k != NULL) {
|
||||||
k = Klass::cast(k)->array_klass_or_null(fd.dimension());
|
k = k->array_klass_or_null(fd.dimension());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
k = find(class_name, class_loader, protection_domain, THREAD);
|
k = find(class_name, class_loader, protection_domain, THREAD);
|
||||||
|
@ -1537,7 +1537,7 @@ instanceKlassHandle SystemDictionary::find_or_define_instance_class(Symbol* clas
|
||||||
// Only special cases allow parallel defines and can use other thread's results
|
// Only special cases allow parallel defines and can use other thread's results
|
||||||
// Other cases fall through, and may run into duplicate defines
|
// Other cases fall through, and may run into duplicate defines
|
||||||
// caught by finding an entry in the SystemDictionary
|
// caught by finding an entry in the SystemDictionary
|
||||||
if ((UnsyncloadClass || is_parallelDefine(class_loader)) && (probe->InstanceKlass() != NULL)) {
|
if ((UnsyncloadClass || is_parallelDefine(class_loader)) && (probe->instance_klass() != NULL)) {
|
||||||
probe->remove_seen_thread(THREAD, PlaceholderTable::DEFINE_CLASS);
|
probe->remove_seen_thread(THREAD, PlaceholderTable::DEFINE_CLASS);
|
||||||
placeholders()->find_and_remove(p_index, p_hash, name_h, loader_data, THREAD);
|
placeholders()->find_and_remove(p_index, p_hash, name_h, loader_data, THREAD);
|
||||||
SystemDictionary_lock->notify_all();
|
SystemDictionary_lock->notify_all();
|
||||||
|
@ -1545,7 +1545,7 @@ instanceKlassHandle SystemDictionary::find_or_define_instance_class(Symbol* clas
|
||||||
Klass* check = find_class(d_index, d_hash, name_h, loader_data);
|
Klass* check = find_class(d_index, d_hash, name_h, loader_data);
|
||||||
assert(check != NULL, "definer missed recording success");
|
assert(check != NULL, "definer missed recording success");
|
||||||
#endif
|
#endif
|
||||||
return(instanceKlassHandle(THREAD, probe->InstanceKlass()));
|
return(instanceKlassHandle(THREAD, probe->instance_klass()));
|
||||||
} else {
|
} else {
|
||||||
// This thread will define the class (even if earlier thread tried and had an error)
|
// This thread will define the class (even if earlier thread tried and had an error)
|
||||||
probe->set_definer(THREAD);
|
probe->set_definer(THREAD);
|
||||||
|
@ -1566,7 +1566,7 @@ instanceKlassHandle SystemDictionary::find_or_define_instance_class(Symbol* clas
|
||||||
linkage_exception = Handle(THREAD,PENDING_EXCEPTION);
|
linkage_exception = Handle(THREAD,PENDING_EXCEPTION);
|
||||||
CLEAR_PENDING_EXCEPTION;
|
CLEAR_PENDING_EXCEPTION;
|
||||||
} else {
|
} else {
|
||||||
probe->set_instanceKlass(k());
|
probe->set_instance_klass(k());
|
||||||
}
|
}
|
||||||
probe->set_definer(NULL);
|
probe->set_definer(NULL);
|
||||||
probe->remove_seen_thread(THREAD, PlaceholderTable::DEFINE_CLASS);
|
probe->remove_seen_thread(THREAD, PlaceholderTable::DEFINE_CLASS);
|
||||||
|
@ -2149,7 +2149,7 @@ Klass* SystemDictionary::find_constrained_instance_or_array_klass(
|
||||||
}
|
}
|
||||||
// If element class already loaded, allocate array klass
|
// If element class already loaded, allocate array klass
|
||||||
if (klass != NULL) {
|
if (klass != NULL) {
|
||||||
klass = Klass::cast(klass)->array_klass_or_null(fd.dimension());
|
klass = klass->array_klass_or_null(fd.dimension());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
MutexLocker mu(SystemDictionary_lock, THREAD);
|
MutexLocker mu(SystemDictionary_lock, THREAD);
|
||||||
|
@ -2466,9 +2466,9 @@ Handle SystemDictionary::find_method_handle_type(Symbol* signature,
|
||||||
Klass* sel_klass = java_lang_Class::as_Klass(mirror);
|
Klass* sel_klass = java_lang_Class::as_Klass(mirror);
|
||||||
mirror = NULL; // safety
|
mirror = NULL; // safety
|
||||||
// Emulate ConstantPool::verify_constant_pool_resolve.
|
// Emulate ConstantPool::verify_constant_pool_resolve.
|
||||||
if (Klass::cast(sel_klass)->oop_is_objArray())
|
if (sel_klass->oop_is_objArray())
|
||||||
sel_klass = ObjArrayKlass::cast(sel_klass)->bottom_klass();
|
sel_klass = ObjArrayKlass::cast(sel_klass)->bottom_klass();
|
||||||
if (Klass::cast(sel_klass)->oop_is_instance()) {
|
if (sel_klass->oop_is_instance()) {
|
||||||
KlassHandle sel_kh(THREAD, sel_klass);
|
KlassHandle sel_kh(THREAD, sel_klass);
|
||||||
LinkResolver::check_klass_accessability(accessing_klass, sel_kh, CHECK_(empty));
|
LinkResolver::check_klass_accessability(accessing_klass, sel_kh, CHECK_(empty));
|
||||||
}
|
}
|
||||||
|
|
|
@ -552,7 +552,7 @@ void Dependencies::print_dependency(DepType dept, int nargs, DepArgument args[],
|
||||||
}
|
}
|
||||||
tty->print(" %s = %s", what, (put_star? "*": ""));
|
tty->print(" %s = %s", what, (put_star? "*": ""));
|
||||||
if (arg.is_klass())
|
if (arg.is_klass())
|
||||||
tty->print("%s", Klass::cast((Klass*)arg.metadata_value())->external_name());
|
tty->print("%s", ((Klass*)arg.metadata_value())->external_name());
|
||||||
else if (arg.is_method())
|
else if (arg.is_method())
|
||||||
((Method*)arg.metadata_value())->print_value();
|
((Method*)arg.metadata_value())->print_value();
|
||||||
else
|
else
|
||||||
|
@ -563,7 +563,7 @@ void Dependencies::print_dependency(DepType dept, int nargs, DepArgument args[],
|
||||||
bool put_star = !Dependencies::is_concrete_klass(witness);
|
bool put_star = !Dependencies::is_concrete_klass(witness);
|
||||||
tty->print_cr(" witness = %s%s",
|
tty->print_cr(" witness = %s%s",
|
||||||
(put_star? "*": ""),
|
(put_star? "*": ""),
|
||||||
Klass::cast(witness)->external_name());
|
witness->external_name());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -808,7 +808,7 @@ class ClassHierarchyWalker {
|
||||||
if (!(m->is_public() || m->is_protected()))
|
if (!(m->is_public() || m->is_protected()))
|
||||||
// The override story is complex when packages get involved.
|
// The override story is complex when packages get involved.
|
||||||
return true; // Must punt the assertion to true.
|
return true; // Must punt the assertion to true.
|
||||||
Klass* k = Klass::cast(ctxk);
|
Klass* k = ctxk;
|
||||||
Method* lm = k->lookup_method(m->name(), m->signature());
|
Method* lm = k->lookup_method(m->name(), m->signature());
|
||||||
if (lm == NULL && k->oop_is_instance()) {
|
if (lm == NULL && k->oop_is_instance()) {
|
||||||
// It might be an abstract interface method, devoid of mirandas.
|
// It might be an abstract interface method, devoid of mirandas.
|
||||||
|
@ -835,7 +835,7 @@ class ClassHierarchyWalker {
|
||||||
}
|
}
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
tty->print_cr("Dependency method not found in the associated context:");
|
tty->print_cr("Dependency method not found in the associated context:");
|
||||||
tty->print_cr(" context = %s", Klass::cast(ctxk)->external_name());
|
tty->print_cr(" context = %s", ctxk->external_name());
|
||||||
tty->print( " method = "); m->print_short_name(tty); tty->cr();
|
tty->print( " method = "); m->print_short_name(tty); tty->cr();
|
||||||
if (lm != NULL) {
|
if (lm != NULL) {
|
||||||
tty->print( " found = "); lm->print_short_name(tty); tty->cr();
|
tty->print( " found = "); lm->print_short_name(tty); tty->cr();
|
||||||
|
@ -1010,7 +1010,7 @@ Klass* ClassHierarchyWalker::find_witness_in(KlassDepChange& changes,
|
||||||
for (int i = 0; i < num_participants(); i++) {
|
for (int i = 0; i < num_participants(); i++) {
|
||||||
Klass* part = participant(i);
|
Klass* part = participant(i);
|
||||||
if (part == NULL) continue;
|
if (part == NULL) continue;
|
||||||
assert(changes.involves_context(part) == Klass::cast(new_type)->is_subtype_of(part),
|
assert(changes.involves_context(part) == new_type->is_subtype_of(part),
|
||||||
"correct marking of participants, b/c new_type is unique");
|
"correct marking of participants, b/c new_type is unique");
|
||||||
if (changes.involves_context(part)) {
|
if (changes.involves_context(part)) {
|
||||||
// new guy is protected from this check by previous participant
|
// new guy is protected from this check by previous participant
|
||||||
|
@ -1146,7 +1146,7 @@ Klass* ClassHierarchyWalker::find_witness_anywhere(Klass* context_type,
|
||||||
|
|
||||||
|
|
||||||
bool Dependencies::is_concrete_klass(Klass* k) {
|
bool Dependencies::is_concrete_klass(Klass* k) {
|
||||||
if (Klass::cast(k)->is_abstract()) return false;
|
if (k->is_abstract()) return false;
|
||||||
// %%% We could treat classes which are concrete but
|
// %%% We could treat classes which are concrete but
|
||||||
// have not yet been instantiated as virtually abstract.
|
// have not yet been instantiated as virtually abstract.
|
||||||
// This would require a deoptimization barrier on first instantiation.
|
// This would require a deoptimization barrier on first instantiation.
|
||||||
|
@ -1705,12 +1705,12 @@ KlassDepChange::~KlassDepChange() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool KlassDepChange::involves_context(Klass* k) {
|
bool KlassDepChange::involves_context(Klass* k) {
|
||||||
if (k == NULL || !Klass::cast(k)->oop_is_instance()) {
|
if (k == NULL || !k->oop_is_instance()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
InstanceKlass* ik = InstanceKlass::cast(k);
|
InstanceKlass* ik = InstanceKlass::cast(k);
|
||||||
bool is_contained = ik->is_marked_dependent();
|
bool is_contained = ik->is_marked_dependent();
|
||||||
assert(is_contained == Klass::cast(new_type())->is_subtype_of(k),
|
assert(is_contained == new_type()->is_subtype_of(k),
|
||||||
"correct marking of potential context types");
|
"correct marking of potential context types");
|
||||||
return is_contained;
|
return is_contained;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2568,9 +2568,8 @@ void nmethod::print_dependencies() {
|
||||||
deps.print_dependency();
|
deps.print_dependency();
|
||||||
Klass* ctxk = deps.context_type();
|
Klass* ctxk = deps.context_type();
|
||||||
if (ctxk != NULL) {
|
if (ctxk != NULL) {
|
||||||
Klass* k = Klass::cast(ctxk);
|
if (ctxk->oop_is_instance() && ((InstanceKlass*)ctxk)->is_dependent_nmethod(this)) {
|
||||||
if (k->oop_is_instance() && ((InstanceKlass*)k)->is_dependent_nmethod(this)) {
|
tty->print_cr(" [nmethod<=klass]%s", ctxk->external_name());
|
||||||
tty->print_cr(" [nmethod<=klass]%s", k->external_name());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
deps.log_dependency(); // put it into the xml log also
|
deps.log_dependency(); // put it into the xml log also
|
||||||
|
|
|
@ -353,7 +353,7 @@ void decode_env::print_address(address adr) {
|
||||||
obj->print_value_on(st);
|
obj->print_value_on(st);
|
||||||
if (st->count() == c) {
|
if (st->count() == c) {
|
||||||
// No output. (Can happen in product builds.)
|
// No output. (Can happen in product builds.)
|
||||||
st->print("(a %s)", Klass::cast(obj->klass())->external_name());
|
st->print("(a %s)", obj->klass()->external_name());
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2043,8 +2043,8 @@ run:
|
||||||
if (objKlassOop != klassOf &&
|
if (objKlassOop != klassOf &&
|
||||||
!objKlassOop->is_subtype_of(klassOf)) {
|
!objKlassOop->is_subtype_of(klassOf)) {
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
const char* objName = Klass::cast(objKlassOop)->external_name();
|
const char* objName = objKlassOop->external_name();
|
||||||
const char* klassName = Klass::cast(klassOf)->external_name();
|
const char* klassName = klassOf->external_name();
|
||||||
char* message = SharedRuntime::generate_class_cast_message(
|
char* message = SharedRuntime::generate_class_cast_message(
|
||||||
objName, klassName);
|
objName, klassName);
|
||||||
VM_JAVA_ERROR(vmSymbols::java_lang_ClassCastException(), message);
|
VM_JAVA_ERROR(vmSymbols::java_lang_ClassCastException(), message);
|
||||||
|
|
|
@ -312,7 +312,7 @@ IRT_END
|
||||||
|
|
||||||
IRT_ENTRY(void, InterpreterRuntime::create_klass_exception(JavaThread* thread, char* name, oopDesc* obj))
|
IRT_ENTRY(void, InterpreterRuntime::create_klass_exception(JavaThread* thread, char* name, oopDesc* obj))
|
||||||
ResourceMark rm(thread);
|
ResourceMark rm(thread);
|
||||||
const char* klass_name = Klass::cast(obj->klass())->external_name();
|
const char* klass_name = obj->klass()->external_name();
|
||||||
// lookup exception klass
|
// lookup exception klass
|
||||||
TempNewSymbol s = SymbolTable::new_symbol(name, CHECK);
|
TempNewSymbol s = SymbolTable::new_symbol(name, CHECK);
|
||||||
if (ProfileTraps) {
|
if (ProfileTraps) {
|
||||||
|
@ -341,7 +341,7 @@ IRT_ENTRY(void, InterpreterRuntime::throw_ClassCastException(
|
||||||
|
|
||||||
ResourceMark rm(thread);
|
ResourceMark rm(thread);
|
||||||
char* message = SharedRuntime::generate_class_cast_message(
|
char* message = SharedRuntime::generate_class_cast_message(
|
||||||
thread, Klass::cast(obj->klass())->external_name());
|
thread, obj->klass()->external_name());
|
||||||
|
|
||||||
if (ProfileTraps) {
|
if (ProfileTraps) {
|
||||||
note_trap(thread, Deoptimization::Reason_class_check, CHECK);
|
note_trap(thread, Deoptimization::Reason_class_check, CHECK);
|
||||||
|
|
|
@ -203,7 +203,7 @@ void LinkResolver::lookup_instance_method_in_klasses(methodHandle& result, Klass
|
||||||
Method* result_oop = klass->uncached_lookup_method(name, signature);
|
Method* result_oop = klass->uncached_lookup_method(name, signature);
|
||||||
result = methodHandle(THREAD, result_oop);
|
result = methodHandle(THREAD, result_oop);
|
||||||
while (!result.is_null() && result->is_static()) {
|
while (!result.is_null() && result->is_static()) {
|
||||||
klass = KlassHandle(THREAD, Klass::cast(result->method_holder())->super());
|
klass = KlassHandle(THREAD, result->method_holder()->super());
|
||||||
result = methodHandle(THREAD, klass->uncached_lookup_method(name, signature));
|
result = methodHandle(THREAD, klass->uncached_lookup_method(name, signature));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -428,7 +428,7 @@ void LinkResolver::resolve_method(methodHandle& resolved_method, KlassHandle res
|
||||||
// 3. method lookup failed
|
// 3. method lookup failed
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
THROW_MSG_CAUSE(vmSymbols::java_lang_NoSuchMethodError(),
|
THROW_MSG_CAUSE(vmSymbols::java_lang_NoSuchMethodError(),
|
||||||
Method::name_and_sig_as_C_string(Klass::cast(resolved_klass()),
|
Method::name_and_sig_as_C_string(resolved_klass(),
|
||||||
method_name,
|
method_name,
|
||||||
method_signature),
|
method_signature),
|
||||||
nested_exception);
|
nested_exception);
|
||||||
|
@ -448,7 +448,7 @@ void LinkResolver::resolve_method(methodHandle& resolved_method, KlassHandle res
|
||||||
if (resolved_method->is_abstract() && !resolved_klass->is_abstract()) {
|
if (resolved_method->is_abstract() && !resolved_klass->is_abstract()) {
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
THROW_MSG(vmSymbols::java_lang_AbstractMethodError(),
|
THROW_MSG(vmSymbols::java_lang_AbstractMethodError(),
|
||||||
Method::name_and_sig_as_C_string(Klass::cast(resolved_klass()),
|
Method::name_and_sig_as_C_string(resolved_klass(),
|
||||||
method_name,
|
method_name,
|
||||||
method_signature));
|
method_signature));
|
||||||
}
|
}
|
||||||
|
@ -477,7 +477,7 @@ void LinkResolver::resolve_method(methodHandle& resolved_method, KlassHandle res
|
||||||
" \"%s\" the class loader (instance of %s) of the current class, %s,"
|
" \"%s\" the class loader (instance of %s) of the current class, %s,"
|
||||||
" and the class loader (instance of %s) for resolved class, %s, have"
|
" and the class loader (instance of %s) for resolved class, %s, have"
|
||||||
" different Class objects for the type %s used in the signature";
|
" different Class objects for the type %s used in the signature";
|
||||||
char* sig = Method::name_and_sig_as_C_string(Klass::cast(resolved_klass()),method_name,method_signature);
|
char* sig = Method::name_and_sig_as_C_string(resolved_klass(),method_name,method_signature);
|
||||||
const char* loader1 = SystemDictionary::loader_name(loader());
|
const char* loader1 = SystemDictionary::loader_name(loader());
|
||||||
char* current = InstanceKlass::cast(current_klass())->name()->as_C_string();
|
char* current = InstanceKlass::cast(current_klass())->name()->as_C_string();
|
||||||
const char* loader2 = SystemDictionary::loader_name(class_loader());
|
const char* loader2 = SystemDictionary::loader_name(class_loader());
|
||||||
|
@ -505,7 +505,7 @@ void LinkResolver::resolve_interface_method(methodHandle& resolved_method,
|
||||||
if (!resolved_klass->is_interface()) {
|
if (!resolved_klass->is_interface()) {
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
char buf[200];
|
char buf[200];
|
||||||
jio_snprintf(buf, sizeof(buf), "Found class %s, but interface was expected", Klass::cast(resolved_klass())->external_name());
|
jio_snprintf(buf, sizeof(buf), "Found class %s, but interface was expected", resolved_klass()->external_name());
|
||||||
THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
|
THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -519,7 +519,7 @@ void LinkResolver::resolve_interface_method(methodHandle& resolved_method,
|
||||||
// no method found
|
// no method found
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
THROW_MSG(vmSymbols::java_lang_NoSuchMethodError(),
|
THROW_MSG(vmSymbols::java_lang_NoSuchMethodError(),
|
||||||
Method::name_and_sig_as_C_string(Klass::cast(resolved_klass()),
|
Method::name_and_sig_as_C_string(resolved_klass(),
|
||||||
method_name,
|
method_name,
|
||||||
method_signature));
|
method_signature));
|
||||||
}
|
}
|
||||||
|
@ -540,7 +540,7 @@ void LinkResolver::resolve_interface_method(methodHandle& resolved_method,
|
||||||
"current class, %s, and the class loader (instance of %s) for "
|
"current class, %s, and the class loader (instance of %s) for "
|
||||||
"resolved class, %s, have different Class objects for the type %s "
|
"resolved class, %s, have different Class objects for the type %s "
|
||||||
"used in the signature";
|
"used in the signature";
|
||||||
char* sig = Method::name_and_sig_as_C_string(Klass::cast(resolved_klass()),method_name,method_signature);
|
char* sig = Method::name_and_sig_as_C_string(resolved_klass(),method_name,method_signature);
|
||||||
const char* loader1 = SystemDictionary::loader_name(loader());
|
const char* loader1 = SystemDictionary::loader_name(loader());
|
||||||
char* current = InstanceKlass::cast(current_klass())->name()->as_C_string();
|
char* current = InstanceKlass::cast(current_klass())->name()->as_C_string();
|
||||||
const char* loader2 = SystemDictionary::loader_name(class_loader());
|
const char* loader2 = SystemDictionary::loader_name(class_loader());
|
||||||
|
@ -627,7 +627,7 @@ void LinkResolver::resolve_field(FieldAccessInfo& result, constantPoolHandle poo
|
||||||
if (is_static != fd.is_static()) {
|
if (is_static != fd.is_static()) {
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
char msg[200];
|
char msg[200];
|
||||||
jio_snprintf(msg, sizeof(msg), "Expected %s field %s.%s", is_static ? "static" : "non-static", Klass::cast(resolved_klass())->external_name(), fd.name()->as_C_string());
|
jio_snprintf(msg, sizeof(msg), "Expected %s field %s.%s", is_static ? "static" : "non-static", resolved_klass()->external_name(), fd.name()->as_C_string());
|
||||||
THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), msg);
|
THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -701,7 +701,7 @@ void LinkResolver::resolve_static_call(CallInfo& result, KlassHandle& resolved_k
|
||||||
bool check_access, bool initialize_class, TRAPS) {
|
bool check_access, bool initialize_class, TRAPS) {
|
||||||
methodHandle resolved_method;
|
methodHandle resolved_method;
|
||||||
linktime_resolve_static_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, check_access, CHECK);
|
linktime_resolve_static_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, check_access, CHECK);
|
||||||
resolved_klass = KlassHandle(THREAD, Klass::cast(resolved_method->method_holder()));
|
resolved_klass = KlassHandle(THREAD, resolved_method->method_holder());
|
||||||
|
|
||||||
// Initialize klass (this should only happen if everything is ok)
|
// Initialize klass (this should only happen if everything is ok)
|
||||||
if (initialize_class && resolved_klass->should_be_initialized()) {
|
if (initialize_class && resolved_klass->should_be_initialized()) {
|
||||||
|
@ -725,7 +725,7 @@ void LinkResolver::linktime_resolve_static_method(methodHandle& resolved_method,
|
||||||
if (!resolved_method->is_static()) {
|
if (!resolved_method->is_static()) {
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
char buf[200];
|
char buf[200];
|
||||||
jio_snprintf(buf, sizeof(buf), "Expected static method %s", Method::name_and_sig_as_C_string(Klass::cast(resolved_klass()),
|
jio_snprintf(buf, sizeof(buf), "Expected static method %s", Method::name_and_sig_as_C_string(resolved_klass(),
|
||||||
resolved_method->name(),
|
resolved_method->name(),
|
||||||
resolved_method->signature()));
|
resolved_method->signature()));
|
||||||
THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
|
THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
|
||||||
|
@ -789,7 +789,7 @@ void LinkResolver::linktime_resolve_special_method(methodHandle& resolved_method
|
||||||
char buf[200];
|
char buf[200];
|
||||||
jio_snprintf(buf, sizeof(buf),
|
jio_snprintf(buf, sizeof(buf),
|
||||||
"Expecting non-static method %s",
|
"Expecting non-static method %s",
|
||||||
Method::name_and_sig_as_C_string(Klass::cast(resolved_klass()),
|
Method::name_and_sig_as_C_string(resolved_klass(),
|
||||||
resolved_method->name(),
|
resolved_method->name(),
|
||||||
resolved_method->signature()));
|
resolved_method->signature()));
|
||||||
THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
|
THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
|
||||||
|
@ -829,7 +829,7 @@ void LinkResolver::runtime_resolve_special_method(CallInfo& result, methodHandle
|
||||||
if (sel_method.is_null()) {
|
if (sel_method.is_null()) {
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
THROW_MSG(vmSymbols::java_lang_AbstractMethodError(),
|
THROW_MSG(vmSymbols::java_lang_AbstractMethodError(),
|
||||||
Method::name_and_sig_as_C_string(Klass::cast(resolved_klass()),
|
Method::name_and_sig_as_C_string(resolved_klass(),
|
||||||
resolved_method->name(),
|
resolved_method->name(),
|
||||||
resolved_method->signature()));
|
resolved_method->signature()));
|
||||||
}
|
}
|
||||||
|
@ -840,7 +840,7 @@ void LinkResolver::runtime_resolve_special_method(CallInfo& result, methodHandle
|
||||||
if (sel_method->is_static()) {
|
if (sel_method->is_static()) {
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
char buf[200];
|
char buf[200];
|
||||||
jio_snprintf(buf, sizeof(buf), "Expecting non-static method %s", Method::name_and_sig_as_C_string(Klass::cast(resolved_klass()),
|
jio_snprintf(buf, sizeof(buf), "Expecting non-static method %s", Method::name_and_sig_as_C_string(resolved_klass(),
|
||||||
resolved_method->name(),
|
resolved_method->name(),
|
||||||
resolved_method->signature()));
|
resolved_method->signature()));
|
||||||
THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
|
THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
|
||||||
|
@ -850,7 +850,7 @@ void LinkResolver::runtime_resolve_special_method(CallInfo& result, methodHandle
|
||||||
if (sel_method->is_abstract()) {
|
if (sel_method->is_abstract()) {
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
THROW_MSG(vmSymbols::java_lang_AbstractMethodError(),
|
THROW_MSG(vmSymbols::java_lang_AbstractMethodError(),
|
||||||
Method::name_and_sig_as_C_string(Klass::cast(resolved_klass()),
|
Method::name_and_sig_as_C_string(resolved_klass(),
|
||||||
sel_method->name(),
|
sel_method->name(),
|
||||||
sel_method->signature()));
|
sel_method->signature()));
|
||||||
}
|
}
|
||||||
|
@ -881,7 +881,7 @@ void LinkResolver::linktime_resolve_virtual_method(methodHandle &resolved_method
|
||||||
if (resolved_method->is_static()) {
|
if (resolved_method->is_static()) {
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
char buf[200];
|
char buf[200];
|
||||||
jio_snprintf(buf, sizeof(buf), "Expecting non-static method %s", Method::name_and_sig_as_C_string(Klass::cast(resolved_klass()),
|
jio_snprintf(buf, sizeof(buf), "Expecting non-static method %s", Method::name_and_sig_as_C_string(resolved_klass(),
|
||||||
resolved_method->name(),
|
resolved_method->name(),
|
||||||
resolved_method->signature()));
|
resolved_method->signature()));
|
||||||
THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
|
THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
|
||||||
|
@ -950,7 +950,7 @@ void LinkResolver::runtime_resolve_virtual_method(CallInfo& result,
|
||||||
if (selected_method.is_null()) {
|
if (selected_method.is_null()) {
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
THROW_MSG(vmSymbols::java_lang_AbstractMethodError(),
|
THROW_MSG(vmSymbols::java_lang_AbstractMethodError(),
|
||||||
Method::name_and_sig_as_C_string(Klass::cast(resolved_klass()),
|
Method::name_and_sig_as_C_string(resolved_klass(),
|
||||||
resolved_method->name(),
|
resolved_method->name(),
|
||||||
resolved_method->signature()));
|
resolved_method->signature()));
|
||||||
}
|
}
|
||||||
|
@ -959,7 +959,7 @@ void LinkResolver::runtime_resolve_virtual_method(CallInfo& result,
|
||||||
if (check_null_and_abstract && selected_method->is_abstract()) {
|
if (check_null_and_abstract && selected_method->is_abstract()) {
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
THROW_MSG(vmSymbols::java_lang_AbstractMethodError(),
|
THROW_MSG(vmSymbols::java_lang_AbstractMethodError(),
|
||||||
Method::name_and_sig_as_C_string(Klass::cast(resolved_klass()),
|
Method::name_and_sig_as_C_string(resolved_klass(),
|
||||||
selected_method->name(),
|
selected_method->name(),
|
||||||
selected_method->signature()));
|
selected_method->signature()));
|
||||||
}
|
}
|
||||||
|
@ -999,8 +999,8 @@ void LinkResolver::runtime_resolve_interface_method(CallInfo& result, methodHand
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
char buf[200];
|
char buf[200];
|
||||||
jio_snprintf(buf, sizeof(buf), "Class %s does not implement the requested interface %s",
|
jio_snprintf(buf, sizeof(buf), "Class %s does not implement the requested interface %s",
|
||||||
(Klass::cast(recv_klass()))->external_name(),
|
recv_klass()->external_name(),
|
||||||
(Klass::cast(resolved_klass()))->external_name());
|
resolved_klass()->external_name());
|
||||||
THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
|
THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
|
||||||
}
|
}
|
||||||
// do lookup based on receiver klass
|
// do lookup based on receiver klass
|
||||||
|
@ -1012,7 +1012,7 @@ void LinkResolver::runtime_resolve_interface_method(CallInfo& result, methodHand
|
||||||
if (sel_method.is_null()) {
|
if (sel_method.is_null()) {
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
THROW_MSG(vmSymbols::java_lang_AbstractMethodError(),
|
THROW_MSG(vmSymbols::java_lang_AbstractMethodError(),
|
||||||
Method::name_and_sig_as_C_string(Klass::cast(recv_klass()),
|
Method::name_and_sig_as_C_string(recv_klass(),
|
||||||
resolved_method->name(),
|
resolved_method->name(),
|
||||||
resolved_method->signature()));
|
resolved_method->signature()));
|
||||||
}
|
}
|
||||||
|
@ -1020,7 +1020,7 @@ void LinkResolver::runtime_resolve_interface_method(CallInfo& result, methodHand
|
||||||
if (!sel_method->is_public()) {
|
if (!sel_method->is_public()) {
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
THROW_MSG(vmSymbols::java_lang_IllegalAccessError(),
|
THROW_MSG(vmSymbols::java_lang_IllegalAccessError(),
|
||||||
Method::name_and_sig_as_C_string(Klass::cast(recv_klass()),
|
Method::name_and_sig_as_C_string(recv_klass(),
|
||||||
sel_method->name(),
|
sel_method->name(),
|
||||||
sel_method->signature()));
|
sel_method->signature()));
|
||||||
}
|
}
|
||||||
|
@ -1028,7 +1028,7 @@ void LinkResolver::runtime_resolve_interface_method(CallInfo& result, methodHand
|
||||||
if (check_null_and_abstract && sel_method->is_abstract()) {
|
if (check_null_and_abstract && sel_method->is_abstract()) {
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
THROW_MSG(vmSymbols::java_lang_AbstractMethodError(),
|
THROW_MSG(vmSymbols::java_lang_AbstractMethodError(),
|
||||||
Method::name_and_sig_as_C_string(Klass::cast(recv_klass()),
|
Method::name_and_sig_as_C_string(recv_klass(),
|
||||||
sel_method->name(),
|
sel_method->name(),
|
||||||
sel_method->signature()));
|
sel_method->signature()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -431,7 +431,7 @@ void VM_PopulateDumpSharedSpace::doit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void link_shared_classes(Klass* obj, TRAPS) {
|
static void link_shared_classes(Klass* obj, TRAPS) {
|
||||||
Klass* k = Klass::cast(obj);
|
Klass* k = obj;
|
||||||
if (k->oop_is_instance()) {
|
if (k->oop_is_instance()) {
|
||||||
InstanceKlass* ik = (InstanceKlass*) k;
|
InstanceKlass* ik = (InstanceKlass*) k;
|
||||||
// Link the class to cause the bytecodes to be rewritten and the
|
// Link the class to cause the bytecodes to be rewritten and the
|
||||||
|
|
|
@ -346,7 +346,7 @@ void Universe::genesis(TRAPS) {
|
||||||
// ---
|
// ---
|
||||||
// New
|
// New
|
||||||
// Have already been initialized.
|
// Have already been initialized.
|
||||||
Klass::cast(_objectArrayKlassObj)->append_to_sibling_list();
|
_objectArrayKlassObj->append_to_sibling_list();
|
||||||
|
|
||||||
// Compute is_jdk version flags.
|
// Compute is_jdk version flags.
|
||||||
// Only 1.3 or later has the java.lang.Shutdown class.
|
// Only 1.3 or later has the java.lang.Shutdown class.
|
||||||
|
|
|
@ -67,7 +67,7 @@ oop ArrayKlass::multi_allocate(int rank, jint* sizes, TRAPS) {
|
||||||
Method* ArrayKlass::uncached_lookup_method(Symbol* name, Symbol* signature) const {
|
Method* ArrayKlass::uncached_lookup_method(Symbol* name, Symbol* signature) const {
|
||||||
// There are no methods in an array klass but the super class (Object) has some
|
// There are no methods in an array klass but the super class (Object) has some
|
||||||
assert(super(), "super klass must be present");
|
assert(super(), "super klass must be present");
|
||||||
return Klass::cast(super())->uncached_lookup_method(name, signature);
|
return super()->uncached_lookup_method(name, signature);
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayKlass::ArrayKlass(Symbol* name) {
|
ArrayKlass::ArrayKlass(Symbol* name) {
|
||||||
|
|
|
@ -375,7 +375,7 @@ Method* ConstantPoolCacheEntry::method_if_resolved(constantPoolHandle cpool) {
|
||||||
int holder_index = cpool->uncached_klass_ref_index_at(constant_pool_index());
|
int holder_index = cpool->uncached_klass_ref_index_at(constant_pool_index());
|
||||||
if (cpool->tag_at(holder_index).is_klass()) {
|
if (cpool->tag_at(holder_index).is_klass()) {
|
||||||
Klass* klass = cpool->resolved_klass_at(holder_index);
|
Klass* klass = cpool->resolved_klass_at(holder_index);
|
||||||
if (!Klass::cast(klass)->oop_is_instance())
|
if (!klass->oop_is_instance())
|
||||||
klass = SystemDictionary::Object_klass();
|
klass = SystemDictionary::Object_klass();
|
||||||
return InstanceKlass::cast(klass)->method_at_vtable(f2_as_index());
|
return InstanceKlass::cast(klass)->method_at_vtable(f2_as_index());
|
||||||
}
|
}
|
||||||
|
|
|
@ -727,8 +727,8 @@ void InstanceKlass::initialize_impl(instanceKlassHandle this_oop, TRAPS) {
|
||||||
|
|
||||||
// Step 7
|
// Step 7
|
||||||
Klass* super_klass = this_oop->super();
|
Klass* super_klass = this_oop->super();
|
||||||
if (super_klass != NULL && !this_oop->is_interface() && Klass::cast(super_klass)->should_be_initialized()) {
|
if (super_klass != NULL && !this_oop->is_interface() && super_klass->should_be_initialized()) {
|
||||||
Klass::cast(super_klass)->initialize(THREAD);
|
super_klass->initialize(THREAD);
|
||||||
|
|
||||||
if (HAS_PENDING_EXCEPTION) {
|
if (HAS_PENDING_EXCEPTION) {
|
||||||
Handle e(THREAD, PENDING_EXCEPTION);
|
Handle e(THREAD, PENDING_EXCEPTION);
|
||||||
|
@ -924,7 +924,7 @@ GrowableArray<Klass*>* InstanceKlass::compute_secondary_supers(int num_extra_slo
|
||||||
}
|
}
|
||||||
|
|
||||||
bool InstanceKlass::compute_is_subtype_of(Klass* k) {
|
bool InstanceKlass::compute_is_subtype_of(Klass* k) {
|
||||||
if (Klass::cast(k)->is_interface()) {
|
if (k->is_interface()) {
|
||||||
return implements_interface(k);
|
return implements_interface(k);
|
||||||
} else {
|
} else {
|
||||||
return Klass::compute_is_subtype_of(k);
|
return Klass::compute_is_subtype_of(k);
|
||||||
|
@ -933,7 +933,7 @@ bool InstanceKlass::compute_is_subtype_of(Klass* k) {
|
||||||
|
|
||||||
bool InstanceKlass::implements_interface(Klass* k) const {
|
bool InstanceKlass::implements_interface(Klass* k) const {
|
||||||
if (this == k) return true;
|
if (this == k) return true;
|
||||||
assert(Klass::cast(k)->is_interface(), "should be an interface class");
|
assert(k->is_interface(), "should be an interface class");
|
||||||
for (int i = 0; i < transitive_interfaces()->length(); i++) {
|
for (int i = 0; i < transitive_interfaces()->length(); i++) {
|
||||||
if (transitive_interfaces()->at(i) == k) {
|
if (transitive_interfaces()->at(i) == k) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -1100,7 +1100,7 @@ Klass* InstanceKlass::find_interface_field(Symbol* name, Symbol* sig, fieldDescr
|
||||||
const int n = local_interfaces()->length();
|
const int n = local_interfaces()->length();
|
||||||
for (int i = 0; i < n; i++) {
|
for (int i = 0; i < n; i++) {
|
||||||
Klass* intf1 = local_interfaces()->at(i);
|
Klass* intf1 = local_interfaces()->at(i);
|
||||||
assert(Klass::cast(intf1)->is_interface(), "just checking type");
|
assert(intf1->is_interface(), "just checking type");
|
||||||
// search for field in current interface
|
// search for field in current interface
|
||||||
if (InstanceKlass::cast(intf1)->find_local_field(name, sig, fd)) {
|
if (InstanceKlass::cast(intf1)->find_local_field(name, sig, fd)) {
|
||||||
assert(fd->is_static(), "interface field must be static");
|
assert(fd->is_static(), "interface field must be static");
|
||||||
|
@ -1171,7 +1171,7 @@ bool InstanceKlass::find_field_from_offset(int offset, bool is_static, fieldDesc
|
||||||
if (InstanceKlass::cast(klass)->find_local_field_from_offset(offset, is_static, fd)) {
|
if (InstanceKlass::cast(klass)->find_local_field_from_offset(offset, is_static, fd)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
klass = Klass::cast(klass)->super();
|
klass = klass->super();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -2359,19 +2359,19 @@ const char* InstanceKlass::signature_name() const {
|
||||||
bool InstanceKlass::is_same_class_package(Klass* class2) {
|
bool InstanceKlass::is_same_class_package(Klass* class2) {
|
||||||
Klass* class1 = this;
|
Klass* class1 = this;
|
||||||
oop classloader1 = InstanceKlass::cast(class1)->class_loader();
|
oop classloader1 = InstanceKlass::cast(class1)->class_loader();
|
||||||
Symbol* classname1 = Klass::cast(class1)->name();
|
Symbol* classname1 = class1->name();
|
||||||
|
|
||||||
if (Klass::cast(class2)->oop_is_objArray()) {
|
if (class2->oop_is_objArray()) {
|
||||||
class2 = ObjArrayKlass::cast(class2)->bottom_klass();
|
class2 = ObjArrayKlass::cast(class2)->bottom_klass();
|
||||||
}
|
}
|
||||||
oop classloader2;
|
oop classloader2;
|
||||||
if (Klass::cast(class2)->oop_is_instance()) {
|
if (class2->oop_is_instance()) {
|
||||||
classloader2 = InstanceKlass::cast(class2)->class_loader();
|
classloader2 = InstanceKlass::cast(class2)->class_loader();
|
||||||
} else {
|
} else {
|
||||||
assert(Klass::cast(class2)->oop_is_typeArray(), "should be type array");
|
assert(class2->oop_is_typeArray(), "should be type array");
|
||||||
classloader2 = NULL;
|
classloader2 = NULL;
|
||||||
}
|
}
|
||||||
Symbol* classname2 = Klass::cast(class2)->name();
|
Symbol* classname2 = class2->name();
|
||||||
|
|
||||||
return InstanceKlass::is_same_class_package(classloader1, classname1,
|
return InstanceKlass::is_same_class_package(classloader1, classname1,
|
||||||
classloader2, classname2);
|
classloader2, classname2);
|
||||||
|
@ -2380,7 +2380,7 @@ bool InstanceKlass::is_same_class_package(Klass* class2) {
|
||||||
bool InstanceKlass::is_same_class_package(oop classloader2, Symbol* classname2) {
|
bool InstanceKlass::is_same_class_package(oop classloader2, Symbol* classname2) {
|
||||||
Klass* class1 = this;
|
Klass* class1 = this;
|
||||||
oop classloader1 = InstanceKlass::cast(class1)->class_loader();
|
oop classloader1 = InstanceKlass::cast(class1)->class_loader();
|
||||||
Symbol* classname1 = Klass::cast(class1)->name();
|
Symbol* classname1 = class1->name();
|
||||||
|
|
||||||
return InstanceKlass::is_same_class_package(classloader1, classname1,
|
return InstanceKlass::is_same_class_package(classloader1, classname1,
|
||||||
classloader2, classname2);
|
classloader2, classname2);
|
||||||
|
@ -2471,7 +2471,7 @@ Klass* InstanceKlass::compute_enclosing_class_impl(instanceKlassHandle self,
|
||||||
bool InstanceKlass::is_same_package_member_impl(instanceKlassHandle class1,
|
bool InstanceKlass::is_same_package_member_impl(instanceKlassHandle class1,
|
||||||
Klass* class2_oop, TRAPS) {
|
Klass* class2_oop, TRAPS) {
|
||||||
if (class2_oop == class1()) return true;
|
if (class2_oop == class1()) return true;
|
||||||
if (!Klass::cast(class2_oop)->oop_is_instance()) return false;
|
if (!class2_oop->oop_is_instance()) return false;
|
||||||
instanceKlassHandle class2(THREAD, class2_oop);
|
instanceKlassHandle class2(THREAD, class2_oop);
|
||||||
|
|
||||||
// must be in same package before we try anything else
|
// must be in same package before we try anything else
|
||||||
|
@ -3004,7 +3004,7 @@ void InstanceKlass::verify_on(outputStream* st) {
|
||||||
if (im != NULL) {
|
if (im != NULL) {
|
||||||
guarantee(is_interface(), "only interfaces should have implementor set");
|
guarantee(is_interface(), "only interfaces should have implementor set");
|
||||||
guarantee(im->is_klass(), "should be klass");
|
guarantee(im->is_klass(), "should be klass");
|
||||||
guarantee(!Klass::cast(im)->is_interface() || im == this,
|
guarantee(!im->is_interface() || im == this,
|
||||||
"implementors cannot be interfaces");
|
"implementors cannot be interfaces");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3013,7 +3013,7 @@ void InstanceKlass::verify_on(outputStream* st) {
|
||||||
Array<Klass*>* local_interfaces = this->local_interfaces();
|
Array<Klass*>* local_interfaces = this->local_interfaces();
|
||||||
for (int j = 0; j < local_interfaces->length(); j++) {
|
for (int j = 0; j < local_interfaces->length(); j++) {
|
||||||
Klass* e = local_interfaces->at(j);
|
Klass* e = local_interfaces->at(j);
|
||||||
guarantee(e->is_klass() && Klass::cast(e)->is_interface(), "invalid local interface");
|
guarantee(e->is_klass() && e->is_interface(), "invalid local interface");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3022,7 +3022,7 @@ void InstanceKlass::verify_on(outputStream* st) {
|
||||||
Array<Klass*>* transitive_interfaces = this->transitive_interfaces();
|
Array<Klass*>* transitive_interfaces = this->transitive_interfaces();
|
||||||
for (int j = 0; j < transitive_interfaces->length(); j++) {
|
for (int j = 0; j < transitive_interfaces->length(); j++) {
|
||||||
Klass* e = transitive_interfaces->at(j);
|
Klass* e = transitive_interfaces->at(j);
|
||||||
guarantee(e->is_klass() && Klass::cast(e)->is_interface(), "invalid transitive interface");
|
guarantee(e->is_klass() && e->is_interface(), "invalid transitive interface");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ bool Klass::is_subclass_of(Klass* k) const {
|
||||||
|
|
||||||
while (t != NULL) {
|
while (t != NULL) {
|
||||||
if (t == k) return true;
|
if (t == k) return true;
|
||||||
t = Klass::cast(t)->super();
|
t = t->super();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -243,16 +243,16 @@ void Klass::initialize_supers(Klass* k, TRAPS) {
|
||||||
juint j = super_depth();
|
juint j = super_depth();
|
||||||
assert(j == my_depth, "computed accessor gets right answer");
|
assert(j == my_depth, "computed accessor gets right answer");
|
||||||
Klass* t = this;
|
Klass* t = this;
|
||||||
while (!Klass::cast(t)->can_be_primary_super()) {
|
while (!t->can_be_primary_super()) {
|
||||||
t = Klass::cast(t)->super();
|
t = t->super();
|
||||||
j = Klass::cast(t)->super_depth();
|
j = t->super_depth();
|
||||||
}
|
}
|
||||||
for (juint j1 = j+1; j1 < primary_super_limit(); j1++) {
|
for (juint j1 = j+1; j1 < primary_super_limit(); j1++) {
|
||||||
assert(primary_super_of_depth(j1) == NULL, "super list padding");
|
assert(primary_super_of_depth(j1) == NULL, "super list padding");
|
||||||
}
|
}
|
||||||
while (t != NULL) {
|
while (t != NULL) {
|
||||||
assert(primary_super_of_depth(j) == t, "super list initialization");
|
assert(primary_super_of_depth(j) == t, "super list initialization");
|
||||||
t = Klass::cast(t)->super();
|
t = t->super();
|
||||||
--j;
|
--j;
|
||||||
}
|
}
|
||||||
assert(j == (juint)-1, "correct depth count");
|
assert(j == (juint)-1, "correct depth count");
|
||||||
|
@ -333,7 +333,7 @@ GrowableArray<Klass*>* Klass::compute_secondary_supers(int num_extra_slots) {
|
||||||
|
|
||||||
|
|
||||||
Klass* Klass::subklass() const {
|
Klass* Klass::subklass() const {
|
||||||
return _subklass == NULL ? NULL : Klass::cast(_subklass);
|
return _subklass == NULL ? NULL : _subklass;
|
||||||
}
|
}
|
||||||
|
|
||||||
InstanceKlass* Klass::superklass() const {
|
InstanceKlass* Klass::superklass() const {
|
||||||
|
@ -342,7 +342,7 @@ InstanceKlass* Klass::superklass() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
Klass* Klass::next_sibling() const {
|
Klass* Klass::next_sibling() const {
|
||||||
return _next_sibling == NULL ? NULL : Klass::cast(_next_sibling);
|
return _next_sibling == NULL ? NULL : _next_sibling;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Klass::set_subklass(Klass* s) {
|
void Klass::set_subklass(Klass* s) {
|
||||||
|
|
|
@ -422,12 +422,6 @@ class Klass : public Metadata {
|
||||||
// if not, throw either an Error or an Exception.
|
// if not, throw either an Error or an Exception.
|
||||||
virtual void check_valid_for_instantiation(bool throwError, TRAPS);
|
virtual void check_valid_for_instantiation(bool throwError, TRAPS);
|
||||||
|
|
||||||
// Casting
|
|
||||||
static Klass* cast(Klass* k) {
|
|
||||||
assert(k->is_klass(), "cast to Klass");
|
|
||||||
return k;
|
|
||||||
}
|
|
||||||
|
|
||||||
// array copying
|
// array copying
|
||||||
virtual void copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS);
|
virtual void copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS);
|
||||||
|
|
||||||
|
|
|
@ -746,7 +746,7 @@ void klassItable::initialize_itable_for_interface(int method_table_offset, Klass
|
||||||
while (target != NULL && target->is_static()) {
|
while (target != NULL && target->is_static()) {
|
||||||
// continue with recursive lookup through the superclass
|
// continue with recursive lookup through the superclass
|
||||||
Klass* super = target->method_holder()->super();
|
Klass* super = target->method_holder()->super();
|
||||||
target = (super == NULL) ? (Method*)NULL : Klass::cast(super)->uncached_lookup_method(method_name, method_signature);
|
target = (super == NULL) ? (Method*)NULL : super->uncached_lookup_method(method_name, method_signature);
|
||||||
}
|
}
|
||||||
if (target == NULL || !target->is_public() || target->is_abstract()) {
|
if (target == NULL || !target->is_public() || target->is_abstract()) {
|
||||||
// Entry do not resolve. Leave it empty
|
// Entry do not resolve. Leave it empty
|
||||||
|
@ -852,7 +852,7 @@ void visit_all_interfaces(Array<Klass*>* transitive_intf, InterfaceVisiterClosur
|
||||||
// Handle array argument
|
// Handle array argument
|
||||||
for(int i = 0; i < transitive_intf->length(); i++) {
|
for(int i = 0; i < transitive_intf->length(); i++) {
|
||||||
Klass* intf = transitive_intf->at(i);
|
Klass* intf = transitive_intf->at(i);
|
||||||
assert(Klass::cast(intf)->is_interface(), "sanity check");
|
assert(intf->is_interface(), "sanity check");
|
||||||
|
|
||||||
// Find no. of methods excluding a <clinit>
|
// Find no. of methods excluding a <clinit>
|
||||||
int method_count = InstanceKlass::cast(intf)->methods()->length();
|
int method_count = InstanceKlass::cast(intf)->methods()->length();
|
||||||
|
|
|
@ -152,11 +152,11 @@ address Method::get_c2i_unverified_entry() {
|
||||||
}
|
}
|
||||||
|
|
||||||
char* Method::name_and_sig_as_C_string() const {
|
char* Method::name_and_sig_as_C_string() const {
|
||||||
return name_and_sig_as_C_string(Klass::cast(constants()->pool_holder()), name(), signature());
|
return name_and_sig_as_C_string(constants()->pool_holder(), name(), signature());
|
||||||
}
|
}
|
||||||
|
|
||||||
char* Method::name_and_sig_as_C_string(char* buf, int size) const {
|
char* Method::name_and_sig_as_C_string(char* buf, int size) const {
|
||||||
return name_and_sig_as_C_string(Klass::cast(constants()->pool_holder()), name(), signature(), buf, size);
|
return name_and_sig_as_C_string(constants()->pool_holder(), name(), signature(), buf, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
char* Method::name_and_sig_as_C_string(Klass* klass, Symbol* method_name, Symbol* signature) {
|
char* Method::name_and_sig_as_C_string(Klass* klass, Symbol* method_name, Symbol* signature) {
|
||||||
|
@ -578,8 +578,8 @@ objArrayHandle Method::resolved_checked_exceptions_impl(Method* this_oop, TRAPS)
|
||||||
for (int i = 0; i < length; i++) {
|
for (int i = 0; i < length; i++) {
|
||||||
CheckedExceptionElement* table = h_this->checked_exceptions_start(); // recompute on each iteration, not gc safe
|
CheckedExceptionElement* table = h_this->checked_exceptions_start(); // recompute on each iteration, not gc safe
|
||||||
Klass* k = h_this->constants()->klass_at(table[i].class_cp_index, CHECK_(objArrayHandle()));
|
Klass* k = h_this->constants()->klass_at(table[i].class_cp_index, CHECK_(objArrayHandle()));
|
||||||
assert(Klass::cast(k)->is_subclass_of(SystemDictionary::Throwable_klass()), "invalid exception class");
|
assert(k->is_subclass_of(SystemDictionary::Throwable_klass()), "invalid exception class");
|
||||||
mirrors->obj_at_put(i, Klass::cast(k)->java_mirror());
|
mirrors->obj_at_put(i, k->java_mirror());
|
||||||
}
|
}
|
||||||
return mirrors;
|
return mirrors;
|
||||||
}
|
}
|
||||||
|
@ -618,7 +618,7 @@ bool Method::is_klass_loaded_by_klass_index(int klass_index) const {
|
||||||
Thread *thread = Thread::current();
|
Thread *thread = Thread::current();
|
||||||
Symbol* klass_name = constants()->klass_name_at(klass_index);
|
Symbol* klass_name = constants()->klass_name_at(klass_index);
|
||||||
Handle loader(thread, method_holder()->class_loader());
|
Handle loader(thread, method_holder()->class_loader());
|
||||||
Handle prot (thread, Klass::cast(method_holder())->protection_domain());
|
Handle prot (thread, method_holder()->protection_domain());
|
||||||
return SystemDictionary::find(klass_name, loader, prot, thread) != NULL;
|
return SystemDictionary::find(klass_name, loader, prot, thread) != NULL;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
|
@ -1067,8 +1067,8 @@ methodHandle Method::make_method_handle_intrinsic(vmIntrinsics::ID iid,
|
||||||
}
|
}
|
||||||
|
|
||||||
Klass* Method::check_non_bcp_klass(Klass* klass) {
|
Klass* Method::check_non_bcp_klass(Klass* klass) {
|
||||||
if (klass != NULL && Klass::cast(klass)->class_loader() != NULL) {
|
if (klass != NULL && klass->class_loader() != NULL) {
|
||||||
if (Klass::cast(klass)->oop_is_objArray())
|
if (klass->oop_is_objArray())
|
||||||
klass = ObjArrayKlass::cast(klass)->bottom_klass();
|
klass = ObjArrayKlass::cast(klass)->bottom_klass();
|
||||||
return klass;
|
return klass;
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,7 @@ Klass* ObjArrayKlass::allocate_objArray_klass(ClassLoaderData* loader_data,
|
||||||
Array<Klass*>* element_supers = element_klass->secondary_supers();
|
Array<Klass*>* element_supers = element_klass->secondary_supers();
|
||||||
for( int i = element_supers->length()-1; i >= 0; i-- ) {
|
for( int i = element_supers->length()-1; i >= 0; i-- ) {
|
||||||
Klass* elem_super = element_supers->at(i);
|
Klass* elem_super = element_supers->at(i);
|
||||||
if (Klass::cast(elem_super)->array_klass_or_null() == NULL) {
|
if (elem_super->array_klass_or_null() == NULL) {
|
||||||
supers_exist = false;
|
supers_exist = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -172,7 +172,7 @@ ObjArrayKlass::ObjArrayKlass(int n, KlassHandle element_klass, Symbol* name) : A
|
||||||
} else {
|
} else {
|
||||||
bk = element_klass();
|
bk = element_klass();
|
||||||
}
|
}
|
||||||
assert(bk != NULL && (Klass::cast(bk)->oop_is_instance() || Klass::cast(bk)->oop_is_typeArray()), "invalid bottom klass");
|
assert(bk != NULL && (bk->oop_is_instance() || bk->oop_is_typeArray()), "invalid bottom klass");
|
||||||
this->set_bottom_klass(bk);
|
this->set_bottom_klass(bk);
|
||||||
this->set_class_loader_data(bk->class_loader_data());
|
this->set_class_loader_data(bk->class_loader_data());
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ template <class T> void ObjArrayKlass::do_copy(arrayOop s, T* src,
|
||||||
// We have to make sure all elements conform to the destination array
|
// We have to make sure all elements conform to the destination array
|
||||||
Klass* bound = ObjArrayKlass::cast(d->klass())->element_klass();
|
Klass* bound = ObjArrayKlass::cast(d->klass())->element_klass();
|
||||||
Klass* stype = ObjArrayKlass::cast(s->klass())->element_klass();
|
Klass* stype = ObjArrayKlass::cast(s->klass())->element_klass();
|
||||||
if (stype == bound || Klass::cast(stype)->is_subtype_of(bound)) {
|
if (stype == bound || stype->is_subtype_of(bound)) {
|
||||||
// elements are guaranteed to be subtypes, so no check necessary
|
// elements are guaranteed to be subtypes, so no check necessary
|
||||||
bs->write_ref_array_pre(dst, length);
|
bs->write_ref_array_pre(dst, length);
|
||||||
Copy::conjoint_oops_atomic(src, dst, length);
|
Copy::conjoint_oops_atomic(src, dst, length);
|
||||||
|
@ -271,7 +271,7 @@ template <class T> void ObjArrayKlass::do_copy(arrayOop s, T* src,
|
||||||
oop new_val = element_is_null ? oop(NULL)
|
oop new_val = element_is_null ? oop(NULL)
|
||||||
: oopDesc::decode_heap_oop_not_null(element);
|
: oopDesc::decode_heap_oop_not_null(element);
|
||||||
if (element_is_null ||
|
if (element_is_null ||
|
||||||
Klass::cast((new_val->klass()))->is_subtype_of(bound)) {
|
(new_val->klass())->is_subtype_of(bound)) {
|
||||||
bs->write_ref_field_pre(p, new_val);
|
bs->write_ref_field_pre(p, new_val);
|
||||||
*p = *from;
|
*p = *from;
|
||||||
} else {
|
} else {
|
||||||
|
@ -381,7 +381,7 @@ bool ObjArrayKlass::can_be_primary_super_slow() const {
|
||||||
|
|
||||||
GrowableArray<Klass*>* ObjArrayKlass::compute_secondary_supers(int num_extra_slots) {
|
GrowableArray<Klass*>* ObjArrayKlass::compute_secondary_supers(int num_extra_slots) {
|
||||||
// interfaces = { cloneable_klass, serializable_klass, elemSuper[], ... };
|
// interfaces = { cloneable_klass, serializable_klass, elemSuper[], ... };
|
||||||
Array<Klass*>* elem_supers = Klass::cast(element_klass())->secondary_supers();
|
Array<Klass*>* elem_supers = element_klass()->secondary_supers();
|
||||||
int num_elem_supers = elem_supers == NULL ? 0 : elem_supers->length();
|
int num_elem_supers = elem_supers == NULL ? 0 : elem_supers->length();
|
||||||
int num_secondaries = num_extra_slots + 2 + num_elem_supers;
|
int num_secondaries = num_extra_slots + 2 + num_elem_supers;
|
||||||
if (num_secondaries == 2) {
|
if (num_secondaries == 2) {
|
||||||
|
@ -411,7 +411,7 @@ bool ObjArrayKlass::compute_is_subtype_of(Klass* k) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjArrayKlass::initialize(TRAPS) {
|
void ObjArrayKlass::initialize(TRAPS) {
|
||||||
Klass::cast(bottom_klass())->initialize(THREAD); // dispatches to either InstanceKlass or TypeArrayKlass
|
bottom_klass()->initialize(THREAD); // dispatches to either InstanceKlass or TypeArrayKlass
|
||||||
}
|
}
|
||||||
|
|
||||||
#define ObjArrayKlass_SPECIALIZED_OOP_ITERATE(T, a, p, do_oop) \
|
#define ObjArrayKlass_SPECIALIZED_OOP_ITERATE(T, a, p, do_oop) \
|
||||||
|
@ -607,7 +607,7 @@ jint ObjArrayKlass::compute_modifier_flags(TRAPS) const {
|
||||||
return JVM_ACC_ABSTRACT | JVM_ACC_FINAL | JVM_ACC_PUBLIC;
|
return JVM_ACC_ABSTRACT | JVM_ACC_FINAL | JVM_ACC_PUBLIC;
|
||||||
}
|
}
|
||||||
// Return the flags of the bottom element type.
|
// Return the flags of the bottom element type.
|
||||||
jint element_flags = Klass::cast(bottom_klass())->compute_modifier_flags(CHECK_0);
|
jint element_flags = bottom_klass()->compute_modifier_flags(CHECK_0);
|
||||||
|
|
||||||
return (element_flags & (JVM_ACC_PUBLIC | JVM_ACC_PRIVATE | JVM_ACC_PROTECTED))
|
return (element_flags & (JVM_ACC_PUBLIC | JVM_ACC_PRIVATE | JVM_ACC_PROTECTED))
|
||||||
| (JVM_ACC_ABSTRACT | JVM_ACC_FINAL);
|
| (JVM_ACC_ABSTRACT | JVM_ACC_FINAL);
|
||||||
|
@ -686,7 +686,7 @@ void ObjArrayKlass::verify_on(outputStream* st) {
|
||||||
guarantee(element_klass()->is_klass(), "should be klass");
|
guarantee(element_klass()->is_klass(), "should be klass");
|
||||||
guarantee(bottom_klass()->is_metadata(), "should be in metaspace");
|
guarantee(bottom_klass()->is_metadata(), "should be in metaspace");
|
||||||
guarantee(bottom_klass()->is_klass(), "should be klass");
|
guarantee(bottom_klass()->is_klass(), "should be klass");
|
||||||
Klass* bk = Klass::cast(bottom_klass());
|
Klass* bk = bottom_klass();
|
||||||
guarantee(bk->oop_is_instance() || bk->oop_is_typeArray(), "invalid bottom klass");
|
guarantee(bk->oop_is_instance() || bk->oop_is_typeArray(), "invalid bottom klass");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ class ObjArrayKlass : public ArrayKlass {
|
||||||
void copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS);
|
void copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS);
|
||||||
|
|
||||||
// Compute protection domain
|
// Compute protection domain
|
||||||
oop protection_domain() { return Klass::cast(bottom_klass())->protection_domain(); }
|
oop protection_domain() { return bottom_klass()->protection_domain(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Either oop or narrowOop depending on UseCompressedOops.
|
// Either oop or narrowOop depending on UseCompressedOops.
|
||||||
|
|
|
@ -236,7 +236,7 @@ JRT_BLOCK_ENTRY(void, OptoRuntime::new_instance_C(Klass* klass, JavaThread* thre
|
||||||
assert(check_compiled_frame(thread), "incorrect caller");
|
assert(check_compiled_frame(thread), "incorrect caller");
|
||||||
|
|
||||||
// These checks are cheap to make and support reflective allocation.
|
// These checks are cheap to make and support reflective allocation.
|
||||||
int lh = Klass::cast(klass)->layout_helper();
|
int lh = klass->layout_helper();
|
||||||
if (Klass::layout_helper_needs_slow_path(lh)
|
if (Klass::layout_helper_needs_slow_path(lh)
|
||||||
|| !InstanceKlass::cast(klass)->is_initialized()) {
|
|| !InstanceKlass::cast(klass)->is_initialized()) {
|
||||||
KlassHandle kh(THREAD, klass);
|
KlassHandle kh(THREAD, klass);
|
||||||
|
@ -283,7 +283,7 @@ JRT_BLOCK_ENTRY(void, OptoRuntime::new_array_C(Klass* array_type, int len, JavaT
|
||||||
// Scavenge and allocate an instance.
|
// Scavenge and allocate an instance.
|
||||||
oop result;
|
oop result;
|
||||||
|
|
||||||
if (Klass::cast(array_type)->oop_is_typeArray()) {
|
if (array_type->oop_is_typeArray()) {
|
||||||
// The oopFactory likes to work with the element type.
|
// The oopFactory likes to work with the element type.
|
||||||
// (We could bypass the oopFactory, since it doesn't add much value.)
|
// (We could bypass the oopFactory, since it doesn't add much value.)
|
||||||
BasicType elem_type = TypeArrayKlass::cast(array_type)->element_type();
|
BasicType elem_type = TypeArrayKlass::cast(array_type)->element_type();
|
||||||
|
@ -321,7 +321,7 @@ JRT_BLOCK_ENTRY(void, OptoRuntime::new_array_nozero_C(Klass* array_type, int len
|
||||||
// Scavenge and allocate an instance.
|
// Scavenge and allocate an instance.
|
||||||
oop result;
|
oop result;
|
||||||
|
|
||||||
assert(Klass::cast(array_type)->oop_is_typeArray(), "should be called only for type array");
|
assert(array_type->oop_is_typeArray(), "should be called only for type array");
|
||||||
// The oopFactory likes to work with the element type.
|
// The oopFactory likes to work with the element type.
|
||||||
BasicType elem_type = TypeArrayKlass::cast(array_type)->element_type();
|
BasicType elem_type = TypeArrayKlass::cast(array_type)->element_type();
|
||||||
result = oopFactory::new_typeArray_nozero(elem_type, len, THREAD);
|
result = oopFactory::new_typeArray_nozero(elem_type, len, THREAD);
|
||||||
|
|
|
@ -233,13 +233,13 @@ bool jfieldIDWorkaround::is_valid_jfieldID(Klass* k, jfieldID id) {
|
||||||
intptr_t jfieldIDWorkaround::encode_klass_hash(Klass* k, intptr_t offset) {
|
intptr_t jfieldIDWorkaround::encode_klass_hash(Klass* k, intptr_t offset) {
|
||||||
if (offset <= small_offset_mask) {
|
if (offset <= small_offset_mask) {
|
||||||
Klass* field_klass = k;
|
Klass* field_klass = k;
|
||||||
Klass* super_klass = Klass::cast(field_klass)->super();
|
Klass* super_klass = field_klass->super();
|
||||||
// With compressed oops the most super class with nonstatic fields would
|
// With compressed oops the most super class with nonstatic fields would
|
||||||
// be the owner of fields embedded in the header.
|
// be the owner of fields embedded in the header.
|
||||||
while (InstanceKlass::cast(super_klass)->has_nonstatic_fields() &&
|
while (InstanceKlass::cast(super_klass)->has_nonstatic_fields() &&
|
||||||
InstanceKlass::cast(super_klass)->contains_field_offset(offset)) {
|
InstanceKlass::cast(super_klass)->contains_field_offset(offset)) {
|
||||||
field_klass = super_klass; // super contains the field also
|
field_klass = super_klass; // super contains the field also
|
||||||
super_klass = Klass::cast(field_klass)->super();
|
super_klass = field_klass->super();
|
||||||
}
|
}
|
||||||
debug_only(No_Safepoint_Verifier nosafepoint;)
|
debug_only(No_Safepoint_Verifier nosafepoint;)
|
||||||
uintptr_t klass_hash = field_klass->identity_hash();
|
uintptr_t klass_hash = field_klass->identity_hash();
|
||||||
|
@ -249,7 +249,7 @@ intptr_t jfieldIDWorkaround::encode_klass_hash(Klass* k, intptr_t offset) {
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
{
|
{
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
warning("VerifyJNIFields: long offset %d in %s", offset, Klass::cast(k)->external_name());
|
warning("VerifyJNIFields: long offset %d in %s", offset, k->external_name());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -265,7 +265,7 @@ bool jfieldIDWorkaround::klass_hash_ok(Klass* k, jfieldID id) {
|
||||||
// Could use a non-blocking query for identity_hash here...
|
// Could use a non-blocking query for identity_hash here...
|
||||||
if ((k->identity_hash() & klass_mask) == klass_hash)
|
if ((k->identity_hash() & klass_mask) == klass_hash)
|
||||||
return true;
|
return true;
|
||||||
k = Klass::cast(k)->super();
|
k = k->super();
|
||||||
} while (k != NULL);
|
} while (k != NULL);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -283,7 +283,7 @@ void jfieldIDWorkaround::verify_instance_jfieldID(Klass* k, jfieldID id) {
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
if (Verbose) {
|
if (Verbose) {
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
warning("VerifyJNIFields: unverified offset %d for %s", offset, Klass::cast(k)->external_name());
|
warning("VerifyJNIFields: unverified offset %d for %s", offset, k->external_name());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -415,7 +415,7 @@ JNI_ENTRY(jclass, jni_DefineClass(JNIEnv *env, const char *name, jobject loaderR
|
||||||
}
|
}
|
||||||
|
|
||||||
cls = (jclass)JNIHandles::make_local(
|
cls = (jclass)JNIHandles::make_local(
|
||||||
env, Klass::cast(k)->java_mirror());
|
env, k->java_mirror());
|
||||||
return cls;
|
return cls;
|
||||||
JNI_END
|
JNI_END
|
||||||
|
|
||||||
|
@ -536,7 +536,7 @@ JNI_ENTRY(jmethodID, jni_FromReflectedMethod(JNIEnv *env, jobject method))
|
||||||
|
|
||||||
KlassHandle k1(THREAD, k);
|
KlassHandle k1(THREAD, k);
|
||||||
// Make sure class is initialized before handing id's out to methods
|
// Make sure class is initialized before handing id's out to methods
|
||||||
Klass::cast(k1())->initialize(CHECK_NULL);
|
k1()->initialize(CHECK_NULL);
|
||||||
Method* m = InstanceKlass::cast(k1())->method_with_idnum(slot);
|
Method* m = InstanceKlass::cast(k1())->method_with_idnum(slot);
|
||||||
ret = m==NULL? NULL : m->jmethod_id(); // return NULL if reflected method deleted
|
ret = m==NULL? NULL : m->jmethod_id(); // return NULL if reflected method deleted
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -569,7 +569,7 @@ JNI_ENTRY(jfieldID, jni_FromReflectedField(JNIEnv *env, jobject field))
|
||||||
|
|
||||||
KlassHandle k1(THREAD, k);
|
KlassHandle k1(THREAD, k);
|
||||||
// Make sure class is initialized before handing id's out to fields
|
// Make sure class is initialized before handing id's out to fields
|
||||||
Klass::cast(k1())->initialize(CHECK_NULL);
|
k1()->initialize(CHECK_NULL);
|
||||||
|
|
||||||
// First check if this is a static field
|
// First check if this is a static field
|
||||||
if (modifiers & JVM_ACC_STATIC) {
|
if (modifiers & JVM_ACC_STATIC) {
|
||||||
|
@ -648,17 +648,17 @@ JNI_ENTRY(jclass, jni_GetSuperclass(JNIEnv *env, jclass sub))
|
||||||
// interfaces return NULL
|
// interfaces return NULL
|
||||||
// proper classes return Klass::super()
|
// proper classes return Klass::super()
|
||||||
Klass* k = java_lang_Class::as_Klass(mirror);
|
Klass* k = java_lang_Class::as_Klass(mirror);
|
||||||
if (Klass::cast(k)->is_interface()) return NULL;
|
if (k->is_interface()) return NULL;
|
||||||
|
|
||||||
// return mirror for superclass
|
// return mirror for superclass
|
||||||
Klass* super = Klass::cast(k)->java_super();
|
Klass* super = k->java_super();
|
||||||
// super2 is the value computed by the compiler's getSuperClass intrinsic:
|
// super2 is the value computed by the compiler's getSuperClass intrinsic:
|
||||||
debug_only(Klass* super2 = ( Klass::cast(k)->oop_is_array()
|
debug_only(Klass* super2 = ( k->oop_is_array()
|
||||||
? SystemDictionary::Object_klass()
|
? SystemDictionary::Object_klass()
|
||||||
: Klass::cast(k)->super() ) );
|
: k->super() ) );
|
||||||
assert(super == super2,
|
assert(super == super2,
|
||||||
"java_super computation depends on interface, array, other super");
|
"java_super computation depends on interface, array, other super");
|
||||||
obj = (super == NULL) ? NULL : (jclass) JNIHandles::make_local(Klass::cast(super)->java_mirror());
|
obj = (super == NULL) ? NULL : (jclass) JNIHandles::make_local(super->java_mirror());
|
||||||
return obj;
|
return obj;
|
||||||
JNI_END
|
JNI_END
|
||||||
|
|
||||||
|
@ -686,7 +686,7 @@ JNI_QUICK_ENTRY(jboolean, jni_IsAssignableFrom(JNIEnv *env, jclass sub, jclass s
|
||||||
Klass* sub_klass = java_lang_Class::as_Klass(sub_mirror);
|
Klass* sub_klass = java_lang_Class::as_Klass(sub_mirror);
|
||||||
Klass* super_klass = java_lang_Class::as_Klass(super_mirror);
|
Klass* super_klass = java_lang_Class::as_Klass(super_mirror);
|
||||||
assert(sub_klass != NULL && super_klass != NULL, "invalid arguments to jni_IsAssignableFrom");
|
assert(sub_klass != NULL && super_klass != NULL, "invalid arguments to jni_IsAssignableFrom");
|
||||||
jboolean ret = Klass::cast(sub_klass)->is_subtype_of(super_klass) ?
|
jboolean ret = sub_klass->is_subtype_of(super_klass) ?
|
||||||
JNI_TRUE : JNI_FALSE;
|
JNI_TRUE : JNI_FALSE;
|
||||||
#ifndef USDT2
|
#ifndef USDT2
|
||||||
DTRACE_PROBE1(hotspot_jni, IsAssignableFrom__return, ret);
|
DTRACE_PROBE1(hotspot_jni, IsAssignableFrom__return, ret);
|
||||||
|
@ -820,7 +820,7 @@ JNI_ENTRY_NO_PRESERVE(void, jni_ExceptionDescribe(JNIEnv *env))
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
jio_fprintf(defaultStream::error_stream(),
|
jio_fprintf(defaultStream::error_stream(),
|
||||||
". Uncaught exception of type %s.",
|
". Uncaught exception of type %s.",
|
||||||
Klass::cast(ex->klass())->external_name());
|
ex->klass()->external_name());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1358,7 +1358,7 @@ static void jni_invoke_nonstatic(JNIEnv *env, JavaValue* result, jobject receive
|
||||||
Method* m = Method::resolve_jmethod_id(method_id);
|
Method* m = Method::resolve_jmethod_id(method_id);
|
||||||
number_of_parameters = m->size_of_parameters();
|
number_of_parameters = m->size_of_parameters();
|
||||||
Klass* holder = m->method_holder();
|
Klass* holder = m->method_holder();
|
||||||
if (!(Klass::cast(holder))->is_interface()) {
|
if (!(holder)->is_interface()) {
|
||||||
// non-interface call -- for that little speed boost, don't handlize
|
// non-interface call -- for that little speed boost, don't handlize
|
||||||
debug_only(No_Safepoint_Verifier nosafepoint;)
|
debug_only(No_Safepoint_Verifier nosafepoint;)
|
||||||
if (call_type == JNI_VIRTUAL) {
|
if (call_type == JNI_VIRTUAL) {
|
||||||
|
@ -1423,7 +1423,7 @@ static void jni_invoke_nonstatic(JNIEnv *env, JavaValue* result, jobject receive
|
||||||
|
|
||||||
static instanceOop alloc_object(jclass clazz, TRAPS) {
|
static instanceOop alloc_object(jclass clazz, TRAPS) {
|
||||||
KlassHandle k(THREAD, java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz)));
|
KlassHandle k(THREAD, java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz)));
|
||||||
Klass::cast(k())->check_valid_for_instantiation(false, CHECK_NULL);
|
k()->check_valid_for_instantiation(false, CHECK_NULL);
|
||||||
InstanceKlass::cast(k())->initialize(CHECK_NULL);
|
InstanceKlass::cast(k())->initialize(CHECK_NULL);
|
||||||
instanceOop ih = InstanceKlass::cast(k())->allocate_instance(THREAD);
|
instanceOop ih = InstanceKlass::cast(k())->allocate_instance(THREAD);
|
||||||
return ih;
|
return ih;
|
||||||
|
@ -1545,7 +1545,7 @@ JNI_ENTRY(jclass, jni_GetObjectClass(JNIEnv *env, jobject obj))
|
||||||
#endif /* USDT2 */
|
#endif /* USDT2 */
|
||||||
Klass* k = JNIHandles::resolve_non_null(obj)->klass();
|
Klass* k = JNIHandles::resolve_non_null(obj)->klass();
|
||||||
jclass ret =
|
jclass ret =
|
||||||
(jclass) JNIHandles::make_local(env, Klass::cast(k)->java_mirror());
|
(jclass) JNIHandles::make_local(env, k->java_mirror());
|
||||||
#ifndef USDT2
|
#ifndef USDT2
|
||||||
DTRACE_PROBE1(hotspot_jni, GetObjectClass__return, ret);
|
DTRACE_PROBE1(hotspot_jni, GetObjectClass__return, ret);
|
||||||
#else /* USDT2 */
|
#else /* USDT2 */
|
||||||
|
@ -1610,7 +1610,7 @@ static jmethodID get_method_id(JNIEnv *env, jclass clazz, const char *name_str,
|
||||||
|
|
||||||
// Make sure class is linked and initialized before handing id's out to
|
// Make sure class is linked and initialized before handing id's out to
|
||||||
// Method*s.
|
// Method*s.
|
||||||
Klass::cast(klass())->initialize(CHECK_NULL);
|
klass()->initialize(CHECK_NULL);
|
||||||
|
|
||||||
Method* m;
|
Method* m;
|
||||||
if (name == vmSymbols::object_initializer_name() ||
|
if (name == vmSymbols::object_initializer_name() ||
|
||||||
|
@ -2426,7 +2426,7 @@ JNI_ENTRY(ResultType, \
|
||||||
JNI_ArgumentPusherVaArg ap(methodID, args); \
|
JNI_ArgumentPusherVaArg ap(methodID, args); \
|
||||||
/* Make sure class is initialized before trying to invoke its method */ \
|
/* Make sure class is initialized before trying to invoke its method */ \
|
||||||
KlassHandle k(THREAD, java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls))); \
|
KlassHandle k(THREAD, java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls))); \
|
||||||
Klass::cast(k())->initialize(CHECK_0); \
|
k()->initialize(CHECK_0); \
|
||||||
jni_invoke_static(env, &jvalue, NULL, JNI_STATIC, methodID, &ap, CHECK_0); \
|
jni_invoke_static(env, &jvalue, NULL, JNI_STATIC, methodID, &ap, CHECK_0); \
|
||||||
va_end(args); \
|
va_end(args); \
|
||||||
ret = jvalue.get_##ResultType(); \
|
ret = jvalue.get_##ResultType(); \
|
||||||
|
@ -2611,10 +2611,10 @@ JNI_ENTRY(jfieldID, jni_GetFieldID(JNIEnv *env, jclass clazz,
|
||||||
KlassHandle k(THREAD,
|
KlassHandle k(THREAD,
|
||||||
java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz)));
|
java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz)));
|
||||||
// Make sure class is initialized before handing id's out to fields
|
// Make sure class is initialized before handing id's out to fields
|
||||||
Klass::cast(k())->initialize(CHECK_NULL);
|
k()->initialize(CHECK_NULL);
|
||||||
|
|
||||||
fieldDescriptor fd;
|
fieldDescriptor fd;
|
||||||
if (!Klass::cast(k())->oop_is_instance() ||
|
if (!k()->oop_is_instance() ||
|
||||||
!InstanceKlass::cast(k())->find_field(fieldname, signame, false, &fd)) {
|
!InstanceKlass::cast(k())->find_field(fieldname, signame, false, &fd)) {
|
||||||
THROW_MSG_0(vmSymbols::java_lang_NoSuchFieldError(), (char*) name);
|
THROW_MSG_0(vmSymbols::java_lang_NoSuchFieldError(), (char*) name);
|
||||||
}
|
}
|
||||||
|
@ -2976,10 +2976,10 @@ JNI_ENTRY(jfieldID, jni_GetStaticFieldID(JNIEnv *env, jclass clazz,
|
||||||
KlassHandle k(THREAD,
|
KlassHandle k(THREAD,
|
||||||
java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz)));
|
java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz)));
|
||||||
// Make sure class is initialized before handing id's out to static fields
|
// Make sure class is initialized before handing id's out to static fields
|
||||||
Klass::cast(k())->initialize(CHECK_NULL);
|
k()->initialize(CHECK_NULL);
|
||||||
|
|
||||||
fieldDescriptor fd;
|
fieldDescriptor fd;
|
||||||
if (!Klass::cast(k())->oop_is_instance() ||
|
if (!k()->oop_is_instance() ||
|
||||||
!InstanceKlass::cast(k())->find_field(fieldname, signame, true, &fd)) {
|
!InstanceKlass::cast(k())->find_field(fieldname, signame, true, &fd)) {
|
||||||
THROW_MSG_0(vmSymbols::java_lang_NoSuchFieldError(), (char*) name);
|
THROW_MSG_0(vmSymbols::java_lang_NoSuchFieldError(), (char*) name);
|
||||||
}
|
}
|
||||||
|
@ -3439,7 +3439,7 @@ JNI_ENTRY(jobjectArray, jni_NewObjectArray(JNIEnv *env, jsize length, jclass ele
|
||||||
jobjectArray ret = NULL;
|
jobjectArray ret = NULL;
|
||||||
DT_RETURN_MARK(NewObjectArray, jobjectArray, (const jobjectArray&)ret);
|
DT_RETURN_MARK(NewObjectArray, jobjectArray, (const jobjectArray&)ret);
|
||||||
KlassHandle ek(THREAD, java_lang_Class::as_Klass(JNIHandles::resolve_non_null(elementClass)));
|
KlassHandle ek(THREAD, java_lang_Class::as_Klass(JNIHandles::resolve_non_null(elementClass)));
|
||||||
Klass* ako = Klass::cast(ek())->array_klass(CHECK_NULL);
|
Klass* ako = ek()->array_klass(CHECK_NULL);
|
||||||
KlassHandle ak = KlassHandle(THREAD, ako);
|
KlassHandle ak = KlassHandle(THREAD, ako);
|
||||||
ObjArrayKlass::cast(ak())->initialize(CHECK_NULL);
|
ObjArrayKlass::cast(ak())->initialize(CHECK_NULL);
|
||||||
objArrayOop result = ObjArrayKlass::cast(ak())->allocate(length, CHECK_NULL);
|
objArrayOop result = ObjArrayKlass::cast(ak())->allocate(length, CHECK_NULL);
|
||||||
|
@ -3970,7 +3970,7 @@ static Method* find_prefixed_native(KlassHandle k,
|
||||||
if (trial_name == NULL) {
|
if (trial_name == NULL) {
|
||||||
continue; // no such symbol, so this prefix wasn't used, try the next prefix
|
continue; // no such symbol, so this prefix wasn't used, try the next prefix
|
||||||
}
|
}
|
||||||
method = Klass::cast(k())->lookup_method(trial_name, signature);
|
method = k()->lookup_method(trial_name, signature);
|
||||||
if (method == NULL) {
|
if (method == NULL) {
|
||||||
continue; // signature doesn't match, try the next prefix
|
continue; // signature doesn't match, try the next prefix
|
||||||
}
|
}
|
||||||
|
@ -3987,12 +3987,12 @@ static Method* find_prefixed_native(KlassHandle k,
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool register_native(KlassHandle k, Symbol* name, Symbol* signature, address entry, TRAPS) {
|
static bool register_native(KlassHandle k, Symbol* name, Symbol* signature, address entry, TRAPS) {
|
||||||
Method* method = Klass::cast(k())->lookup_method(name, signature);
|
Method* method = k()->lookup_method(name, signature);
|
||||||
if (method == NULL) {
|
if (method == NULL) {
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
stringStream st;
|
stringStream st;
|
||||||
st.print("Method %s name or signature does not match",
|
st.print("Method %s name or signature does not match",
|
||||||
Method::name_and_sig_as_C_string(Klass::cast(k()), name, signature));
|
Method::name_and_sig_as_C_string(k(), name, signature));
|
||||||
THROW_MSG_(vmSymbols::java_lang_NoSuchMethodError(), st.as_string(), false);
|
THROW_MSG_(vmSymbols::java_lang_NoSuchMethodError(), st.as_string(), false);
|
||||||
}
|
}
|
||||||
if (!method->is_native()) {
|
if (!method->is_native()) {
|
||||||
|
@ -4002,7 +4002,7 @@ static bool register_native(KlassHandle k, Symbol* name, Symbol* signature, addr
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
stringStream st;
|
stringStream st;
|
||||||
st.print("Method %s is not declared as native",
|
st.print("Method %s is not declared as native",
|
||||||
Method::name_and_sig_as_C_string(Klass::cast(k()), name, signature));
|
Method::name_and_sig_as_C_string(k(), name, signature));
|
||||||
THROW_MSG_(vmSymbols::java_lang_NoSuchMethodError(), st.as_string(), false);
|
THROW_MSG_(vmSymbols::java_lang_NoSuchMethodError(), st.as_string(), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4058,7 +4058,7 @@ JNI_ENTRY(jint, jni_RegisterNatives(JNIEnv *env, jclass clazz,
|
||||||
if (name == NULL || signature == NULL) {
|
if (name == NULL || signature == NULL) {
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
stringStream st;
|
stringStream st;
|
||||||
st.print("Method %s.%s%s not found", Klass::cast(h_k())->external_name(), meth_name, meth_sig);
|
st.print("Method %s.%s%s not found", h_k()->external_name(), meth_name, meth_sig);
|
||||||
// Must return negative value on failure
|
// Must return negative value on failure
|
||||||
THROW_MSG_(vmSymbols::java_lang_NoSuchMethodError(), st.as_string(), -1);
|
THROW_MSG_(vmSymbols::java_lang_NoSuchMethodError(), st.as_string(), -1);
|
||||||
}
|
}
|
||||||
|
@ -4084,7 +4084,7 @@ JNI_ENTRY(jint, jni_UnregisterNatives(JNIEnv *env, jclass clazz))
|
||||||
#endif /* USDT2 */
|
#endif /* USDT2 */
|
||||||
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz));
|
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz));
|
||||||
//%note jni_2
|
//%note jni_2
|
||||||
if (Klass::cast(k)->oop_is_instance()) {
|
if (k->oop_is_instance()) {
|
||||||
for (int index = 0; index < InstanceKlass::cast(k)->methods()->length(); index++) {
|
for (int index = 0; index < InstanceKlass::cast(k)->methods()->length(); index++) {
|
||||||
Method* m = InstanceKlass::cast(k)->methods()->at(index);
|
Method* m = InstanceKlass::cast(k)->methods()->at(index);
|
||||||
if (m->is_native()) {
|
if (m->is_native()) {
|
||||||
|
|
|
@ -383,7 +383,7 @@ void jniCheck::validate_throwable_klass(JavaThread* thr, Klass* klass) {
|
||||||
ASSERT_OOPS_ALLOWED;
|
ASSERT_OOPS_ALLOWED;
|
||||||
assert(klass != NULL, "klass argument must have a value");
|
assert(klass != NULL, "klass argument must have a value");
|
||||||
|
|
||||||
if (!Klass::cast(klass)->oop_is_instance() ||
|
if (!klass->oop_is_instance() ||
|
||||||
!InstanceKlass::cast(klass)->is_subclass_of(SystemDictionary::Throwable_klass())) {
|
!InstanceKlass::cast(klass)->is_subclass_of(SystemDictionary::Throwable_klass())) {
|
||||||
ReportJNIFatalError(thr, fatal_class_not_a_throwable_class);
|
ReportJNIFatalError(thr, fatal_class_not_a_throwable_class);
|
||||||
}
|
}
|
||||||
|
|
|
@ -305,7 +305,7 @@ JVM_ENTRY(void, JVM_ArrayCopy(JNIEnv *env, jclass ignored, jobject src, jint src
|
||||||
assert(s->is_oop(), "JVM_ArrayCopy: src not an oop");
|
assert(s->is_oop(), "JVM_ArrayCopy: src not an oop");
|
||||||
assert(d->is_oop(), "JVM_ArrayCopy: dst not an oop");
|
assert(d->is_oop(), "JVM_ArrayCopy: dst not an oop");
|
||||||
// Do copy
|
// Do copy
|
||||||
Klass::cast(s->klass())->copy_array(s, src_pos, d, dst_pos, length, thread);
|
s->klass()->copy_array(s, src_pos, d, dst_pos, length, thread);
|
||||||
JVM_END
|
JVM_END
|
||||||
|
|
||||||
|
|
||||||
|
@ -675,7 +675,7 @@ JVM_END
|
||||||
JVM_ENTRY(jclass, JVM_GetCallerClass(JNIEnv* env, int depth))
|
JVM_ENTRY(jclass, JVM_GetCallerClass(JNIEnv* env, int depth))
|
||||||
JVMWrapper("JVM_GetCallerClass");
|
JVMWrapper("JVM_GetCallerClass");
|
||||||
Klass* k = thread->security_get_caller_class(depth);
|
Klass* k = thread->security_get_caller_class(depth);
|
||||||
return (k == NULL) ? NULL : (jclass) JNIHandles::make_local(env, Klass::cast(k)->java_mirror());
|
return (k == NULL) ? NULL : (jclass) JNIHandles::make_local(env, k->java_mirror());
|
||||||
JVM_END
|
JVM_END
|
||||||
|
|
||||||
|
|
||||||
|
@ -739,7 +739,7 @@ JVM_ENTRY(jclass, JVM_FindClassFromBootLoader(JNIEnv* env,
|
||||||
if (TraceClassResolution) {
|
if (TraceClassResolution) {
|
||||||
trace_class_resolution(k);
|
trace_class_resolution(k);
|
||||||
}
|
}
|
||||||
return (jclass) JNIHandles::make_local(env, Klass::cast(k)->java_mirror());
|
return (jclass) JNIHandles::make_local(env, k->java_mirror());
|
||||||
JVM_END
|
JVM_END
|
||||||
|
|
||||||
JVM_ENTRY(jclass, JVM_FindClassFromClassLoader(JNIEnv* env, const char* name,
|
JVM_ENTRY(jclass, JVM_FindClassFromClassLoader(JNIEnv* env, const char* name,
|
||||||
|
@ -785,8 +785,8 @@ JVM_ENTRY(jclass, JVM_FindClassFromClass(JNIEnv *env, const char *name,
|
||||||
oop class_loader = NULL;
|
oop class_loader = NULL;
|
||||||
oop protection_domain = NULL;
|
oop protection_domain = NULL;
|
||||||
if (from_class != NULL) {
|
if (from_class != NULL) {
|
||||||
class_loader = Klass::cast(from_class)->class_loader();
|
class_loader = from_class->class_loader();
|
||||||
protection_domain = Klass::cast(from_class)->protection_domain();
|
protection_domain = from_class->protection_domain();
|
||||||
}
|
}
|
||||||
Handle h_loader(THREAD, class_loader);
|
Handle h_loader(THREAD, class_loader);
|
||||||
Handle h_prot (THREAD, protection_domain);
|
Handle h_prot (THREAD, protection_domain);
|
||||||
|
@ -798,11 +798,11 @@ JVM_ENTRY(jclass, JVM_FindClassFromClass(JNIEnv *env, const char *name,
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
oop from_mirror = JNIHandles::resolve_non_null(from);
|
oop from_mirror = JNIHandles::resolve_non_null(from);
|
||||||
Klass* from_class = java_lang_Class::as_Klass(from_mirror);
|
Klass* from_class = java_lang_Class::as_Klass(from_mirror);
|
||||||
const char * from_name = Klass::cast(from_class)->external_name();
|
const char * from_name = from_class->external_name();
|
||||||
|
|
||||||
oop mirror = JNIHandles::resolve_non_null(result);
|
oop mirror = JNIHandles::resolve_non_null(result);
|
||||||
Klass* to_class = java_lang_Class::as_Klass(mirror);
|
Klass* to_class = java_lang_Class::as_Klass(mirror);
|
||||||
const char * to = Klass::cast(to_class)->external_name();
|
const char * to = to_class->external_name();
|
||||||
tty->print("RESOLVE %s %s (verification)\n", from_name, to);
|
tty->print("RESOLVE %s %s (verification)\n", from_name, to);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -875,7 +875,7 @@ static jclass jvm_define_class_common(JNIEnv *env, const char *name,
|
||||||
trace_class_resolution(k);
|
trace_class_resolution(k);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (jclass) JNIHandles::make_local(env, Klass::cast(k)->java_mirror());
|
return (jclass) JNIHandles::make_local(env, k->java_mirror());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -936,7 +936,7 @@ JVM_ENTRY(jclass, JVM_FindLoadedClass(JNIEnv *env, jobject loader, jstring name)
|
||||||
CHECK_NULL);
|
CHECK_NULL);
|
||||||
|
|
||||||
return (k == NULL) ? NULL :
|
return (k == NULL) ? NULL :
|
||||||
(jclass) JNIHandles::make_local(env, Klass::cast(k)->java_mirror());
|
(jclass) JNIHandles::make_local(env, k->java_mirror());
|
||||||
JVM_END
|
JVM_END
|
||||||
|
|
||||||
|
|
||||||
|
@ -954,7 +954,7 @@ JVM_ENTRY(jstring, JVM_GetClassName(JNIEnv *env, jclass cls))
|
||||||
// Consider caching interned string in Klass
|
// Consider caching interned string in Klass
|
||||||
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve(cls));
|
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve(cls));
|
||||||
assert(k->is_klass(), "just checking");
|
assert(k->is_klass(), "just checking");
|
||||||
name = Klass::cast(k)->external_name();
|
name = k->external_name();
|
||||||
}
|
}
|
||||||
oop result = StringTable::intern((char*) name, CHECK_NULL);
|
oop result = StringTable::intern((char*) name, CHECK_NULL);
|
||||||
return (jstring) JNIHandles::make_local(env, result);
|
return (jstring) JNIHandles::make_local(env, result);
|
||||||
|
@ -991,12 +991,12 @@ JVM_ENTRY(jobjectArray, JVM_GetClassInterfaces(JNIEnv *env, jclass cls))
|
||||||
// Regular instance klass, fill in all local interfaces
|
// Regular instance klass, fill in all local interfaces
|
||||||
for (int index = 0; index < size; index++) {
|
for (int index = 0; index < size; index++) {
|
||||||
Klass* k = InstanceKlass::cast(klass())->local_interfaces()->at(index);
|
Klass* k = InstanceKlass::cast(klass())->local_interfaces()->at(index);
|
||||||
result->obj_at_put(index, Klass::cast(k)->java_mirror());
|
result->obj_at_put(index, k->java_mirror());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// All arrays implement java.lang.Cloneable and java.io.Serializable
|
// All arrays implement java.lang.Cloneable and java.io.Serializable
|
||||||
result->obj_at_put(0, Klass::cast(SystemDictionary::Cloneable_klass())->java_mirror());
|
result->obj_at_put(0, SystemDictionary::Cloneable_klass()->java_mirror());
|
||||||
result->obj_at_put(1, Klass::cast(SystemDictionary::Serializable_klass())->java_mirror());
|
result->obj_at_put(1, SystemDictionary::Serializable_klass()->java_mirror());
|
||||||
}
|
}
|
||||||
return (jobjectArray) JNIHandles::make_local(env, result());
|
return (jobjectArray) JNIHandles::make_local(env, result());
|
||||||
JVM_END
|
JVM_END
|
||||||
|
@ -1008,7 +1008,7 @@ JVM_ENTRY(jobject, JVM_GetClassLoader(JNIEnv *env, jclass cls))
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
|
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
|
||||||
oop loader = Klass::cast(k)->class_loader();
|
oop loader = k->class_loader();
|
||||||
return JNIHandles::make_local(env, loader);
|
return JNIHandles::make_local(env, loader);
|
||||||
JVM_END
|
JVM_END
|
||||||
|
|
||||||
|
@ -1020,8 +1020,8 @@ JVM_QUICK_ENTRY(jboolean, JVM_IsInterface(JNIEnv *env, jclass cls))
|
||||||
return JNI_FALSE;
|
return JNI_FALSE;
|
||||||
}
|
}
|
||||||
Klass* k = java_lang_Class::as_Klass(mirror);
|
Klass* k = java_lang_Class::as_Klass(mirror);
|
||||||
jboolean result = Klass::cast(k)->is_interface();
|
jboolean result = k->is_interface();
|
||||||
assert(!result || Klass::cast(k)->oop_is_instance(),
|
assert(!result || k->oop_is_instance(),
|
||||||
"all interfaces are instance types");
|
"all interfaces are instance types");
|
||||||
// The compiler intrinsic for isInterface tests the
|
// The compiler intrinsic for isInterface tests the
|
||||||
// Klass::_access_flags bits in the same way.
|
// Klass::_access_flags bits in the same way.
|
||||||
|
@ -1039,7 +1039,7 @@ JVM_ENTRY(jobjectArray, JVM_GetClassSigners(JNIEnv *env, jclass cls))
|
||||||
|
|
||||||
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
|
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
|
||||||
objArrayOop signers = NULL;
|
objArrayOop signers = NULL;
|
||||||
if (Klass::cast(k)->oop_is_instance()) {
|
if (k->oop_is_instance()) {
|
||||||
signers = InstanceKlass::cast(k)->signers();
|
signers = InstanceKlass::cast(k)->signers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1066,7 +1066,7 @@ JVM_ENTRY(void, JVM_SetClassSigners(JNIEnv *env, jclass cls, jobjectArray signer
|
||||||
// Signers are only set once, ClassLoader.java, and thus shouldn't
|
// Signers are only set once, ClassLoader.java, and thus shouldn't
|
||||||
// be called with an array. Only the bootstrap loader creates arrays.
|
// be called with an array. Only the bootstrap loader creates arrays.
|
||||||
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
|
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
|
||||||
if (Klass::cast(k)->oop_is_instance()) {
|
if (k->oop_is_instance()) {
|
||||||
InstanceKlass::cast(k)->set_signers(objArrayOop(JNIHandles::resolve(signers)));
|
InstanceKlass::cast(k)->set_signers(objArrayOop(JNIHandles::resolve(signers)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1085,7 +1085,7 @@ JVM_ENTRY(jobject, JVM_GetProtectionDomain(JNIEnv *env, jclass cls))
|
||||||
}
|
}
|
||||||
|
|
||||||
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve(cls));
|
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve(cls));
|
||||||
return (jobject) JNIHandles::make_local(env, Klass::cast(k)->protection_domain());
|
return (jobject) JNIHandles::make_local(env, k->protection_domain());
|
||||||
JVM_END
|
JVM_END
|
||||||
|
|
||||||
|
|
||||||
|
@ -1101,7 +1101,7 @@ JVM_ENTRY(void, JVM_SetProtectionDomain(JNIEnv *env, jclass cls, jobject protect
|
||||||
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve(cls));
|
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve(cls));
|
||||||
|
|
||||||
// cls won't be an array, as this called only from ClassLoader.defineClass
|
// cls won't be an array, as this called only from ClassLoader.defineClass
|
||||||
if (Klass::cast(k)->oop_is_instance()) {
|
if (k->oop_is_instance()) {
|
||||||
oop pd = JNIHandles::resolve(protection_domain);
|
oop pd = JNIHandles::resolve(protection_domain);
|
||||||
assert(pd == NULL || pd->is_oop(), "just checking");
|
assert(pd == NULL || pd->is_oop(), "just checking");
|
||||||
InstanceKlass::cast(k)->set_protection_domain(pd);
|
InstanceKlass::cast(k)->set_protection_domain(pd);
|
||||||
|
@ -1124,7 +1124,7 @@ JVM_ENTRY(jobject, JVM_DoPrivileged(JNIEnv *env, jclass cls, jobject action, job
|
||||||
Handle object (THREAD, JNIHandles::resolve(action));
|
Handle object (THREAD, JNIHandles::resolve(action));
|
||||||
|
|
||||||
// get run() method
|
// get run() method
|
||||||
Method* m_oop = Klass::cast(object->klass())->uncached_lookup_method(
|
Method* m_oop = object->klass()->uncached_lookup_method(
|
||||||
vmSymbols::run_method_name(),
|
vmSymbols::run_method_name(),
|
||||||
vmSymbols::void_object_signature());
|
vmSymbols::void_object_signature());
|
||||||
methodHandle m (THREAD, m_oop);
|
methodHandle m (THREAD, m_oop);
|
||||||
|
@ -1267,7 +1267,7 @@ JVM_END
|
||||||
JVM_QUICK_ENTRY(jboolean, JVM_IsArrayClass(JNIEnv *env, jclass cls))
|
JVM_QUICK_ENTRY(jboolean, JVM_IsArrayClass(JNIEnv *env, jclass cls))
|
||||||
JVMWrapper("JVM_IsArrayClass");
|
JVMWrapper("JVM_IsArrayClass");
|
||||||
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
|
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
|
||||||
return (k != NULL) && Klass::cast(k)->oop_is_array() ? true : false;
|
return (k != NULL) && k->oop_is_array() ? true : false;
|
||||||
JVM_END
|
JVM_END
|
||||||
|
|
||||||
|
|
||||||
|
@ -1293,7 +1293,7 @@ JVM_ENTRY(jint, JVM_GetClassModifiers(JNIEnv *env, jclass cls))
|
||||||
return JVM_ACC_ABSTRACT | JVM_ACC_FINAL | JVM_ACC_PUBLIC;
|
return JVM_ACC_ABSTRACT | JVM_ACC_FINAL | JVM_ACC_PUBLIC;
|
||||||
}
|
}
|
||||||
|
|
||||||
Klass* k = Klass::cast(java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls)));
|
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
|
||||||
debug_only(int computed_modifiers = k->compute_modifier_flags(CHECK_0));
|
debug_only(int computed_modifiers = k->compute_modifier_flags(CHECK_0));
|
||||||
assert(k->modifier_flags() == computed_modifiers, "modifiers cache is OK");
|
assert(k->modifier_flags() == computed_modifiers, "modifiers cache is OK");
|
||||||
return k->modifier_flags();
|
return k->modifier_flags();
|
||||||
|
@ -1308,7 +1308,7 @@ JVM_ENTRY(jobjectArray, JVM_GetDeclaredClasses(JNIEnv *env, jclass ofClass))
|
||||||
// of an InstanceKlass
|
// of an InstanceKlass
|
||||||
|
|
||||||
if (java_lang_Class::is_primitive(JNIHandles::resolve_non_null(ofClass)) ||
|
if (java_lang_Class::is_primitive(JNIHandles::resolve_non_null(ofClass)) ||
|
||||||
! Klass::cast(java_lang_Class::as_Klass(JNIHandles::resolve_non_null(ofClass)))->oop_is_instance()) {
|
! java_lang_Class::as_Klass(JNIHandles::resolve_non_null(ofClass))->oop_is_instance()) {
|
||||||
oop result = oopFactory::new_objArray(SystemDictionary::Class_klass(), 0, CHECK_NULL);
|
oop result = oopFactory::new_objArray(SystemDictionary::Class_klass(), 0, CHECK_NULL);
|
||||||
return (jobjectArray)JNIHandles::make_local(env, result);
|
return (jobjectArray)JNIHandles::make_local(env, result);
|
||||||
}
|
}
|
||||||
|
@ -1372,7 +1372,7 @@ JVM_ENTRY(jclass, JVM_GetDeclaringClass(JNIEnv *env, jclass ofClass))
|
||||||
{
|
{
|
||||||
// ofClass is a reference to a java_lang_Class object.
|
// ofClass is a reference to a java_lang_Class object.
|
||||||
if (java_lang_Class::is_primitive(JNIHandles::resolve_non_null(ofClass)) ||
|
if (java_lang_Class::is_primitive(JNIHandles::resolve_non_null(ofClass)) ||
|
||||||
! Klass::cast(java_lang_Class::as_Klass(JNIHandles::resolve_non_null(ofClass)))->oop_is_instance()) {
|
! java_lang_Class::as_Klass(JNIHandles::resolve_non_null(ofClass))->oop_is_instance()) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1382,7 +1382,7 @@ JVM_ENTRY(jclass, JVM_GetDeclaringClass(JNIEnv *env, jclass ofClass))
|
||||||
)->compute_enclosing_class(&inner_is_member, CHECK_NULL);
|
)->compute_enclosing_class(&inner_is_member, CHECK_NULL);
|
||||||
if (outer_klass == NULL) return NULL; // already a top-level class
|
if (outer_klass == NULL) return NULL; // already a top-level class
|
||||||
if (!inner_is_member) return NULL; // an anonymous class (inside a method)
|
if (!inner_is_member) return NULL; // an anonymous class (inside a method)
|
||||||
return (jclass) JNIHandles::make_local(env, Klass::cast(outer_klass)->java_mirror());
|
return (jclass) JNIHandles::make_local(env, outer_klass->java_mirror());
|
||||||
}
|
}
|
||||||
JVM_END
|
JVM_END
|
||||||
|
|
||||||
|
@ -1452,7 +1452,7 @@ JVM_ENTRY(jstring, JVM_GetClassSignature(JNIEnv *env, jclass cls))
|
||||||
// Return null for arrays and primatives
|
// Return null for arrays and primatives
|
||||||
if (!java_lang_Class::is_primitive(JNIHandles::resolve(cls))) {
|
if (!java_lang_Class::is_primitive(JNIHandles::resolve(cls))) {
|
||||||
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve(cls));
|
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve(cls));
|
||||||
if (Klass::cast(k)->oop_is_instance()) {
|
if (k->oop_is_instance()) {
|
||||||
Symbol* sym = InstanceKlass::cast(k)->generic_signature();
|
Symbol* sym = InstanceKlass::cast(k)->generic_signature();
|
||||||
if (sym == NULL) return NULL;
|
if (sym == NULL) return NULL;
|
||||||
Handle str = java_lang_String::create_from_symbol(sym, CHECK_NULL);
|
Handle str = java_lang_String::create_from_symbol(sym, CHECK_NULL);
|
||||||
|
@ -1470,7 +1470,7 @@ JVM_ENTRY(jbyteArray, JVM_GetClassAnnotations(JNIEnv *env, jclass cls))
|
||||||
// Return null for arrays and primitives
|
// Return null for arrays and primitives
|
||||||
if (!java_lang_Class::is_primitive(JNIHandles::resolve(cls))) {
|
if (!java_lang_Class::is_primitive(JNIHandles::resolve(cls))) {
|
||||||
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve(cls));
|
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve(cls));
|
||||||
if (Klass::cast(k)->oop_is_instance()) {
|
if (k->oop_is_instance()) {
|
||||||
typeArrayOop a = Annotations::make_java_array(InstanceKlass::cast(k)->class_annotations(), CHECK_NULL);
|
typeArrayOop a = Annotations::make_java_array(InstanceKlass::cast(k)->class_annotations(), CHECK_NULL);
|
||||||
return (jbyteArray) JNIHandles::make_local(env, a);
|
return (jbyteArray) JNIHandles::make_local(env, a);
|
||||||
}
|
}
|
||||||
|
@ -1583,7 +1583,7 @@ JVM_ENTRY(jobjectArray, JVM_GetClassDeclaredFields(JNIEnv *env, jclass ofClass,
|
||||||
|
|
||||||
// Exclude primitive types and array types
|
// Exclude primitive types and array types
|
||||||
if (java_lang_Class::is_primitive(JNIHandles::resolve_non_null(ofClass)) ||
|
if (java_lang_Class::is_primitive(JNIHandles::resolve_non_null(ofClass)) ||
|
||||||
Klass::cast(java_lang_Class::as_Klass(JNIHandles::resolve_non_null(ofClass)))->oop_is_array()) {
|
java_lang_Class::as_Klass(JNIHandles::resolve_non_null(ofClass))->oop_is_array()) {
|
||||||
// Return empty array
|
// Return empty array
|
||||||
oop res = oopFactory::new_objArray(SystemDictionary::reflect_Field_klass(), 0, CHECK_NULL);
|
oop res = oopFactory::new_objArray(SystemDictionary::reflect_Field_klass(), 0, CHECK_NULL);
|
||||||
return (jobjectArray) JNIHandles::make_local(env, res);
|
return (jobjectArray) JNIHandles::make_local(env, res);
|
||||||
|
@ -1646,7 +1646,7 @@ JVM_ENTRY(jobjectArray, JVM_GetClassDeclaredMethods(JNIEnv *env, jclass ofClass,
|
||||||
|
|
||||||
// Exclude primitive types and array types
|
// Exclude primitive types and array types
|
||||||
if (java_lang_Class::is_primitive(JNIHandles::resolve_non_null(ofClass))
|
if (java_lang_Class::is_primitive(JNIHandles::resolve_non_null(ofClass))
|
||||||
|| Klass::cast(java_lang_Class::as_Klass(JNIHandles::resolve_non_null(ofClass)))->oop_is_array()) {
|
|| java_lang_Class::as_Klass(JNIHandles::resolve_non_null(ofClass))->oop_is_array()) {
|
||||||
// Return empty array
|
// Return empty array
|
||||||
oop res = oopFactory::new_objArray(SystemDictionary::reflect_Method_klass(), 0, CHECK_NULL);
|
oop res = oopFactory::new_objArray(SystemDictionary::reflect_Method_klass(), 0, CHECK_NULL);
|
||||||
return (jobjectArray) JNIHandles::make_local(env, res);
|
return (jobjectArray) JNIHandles::make_local(env, res);
|
||||||
|
@ -1698,7 +1698,7 @@ JVM_ENTRY(jobjectArray, JVM_GetClassDeclaredConstructors(JNIEnv *env, jclass ofC
|
||||||
|
|
||||||
// Exclude primitive types and array types
|
// Exclude primitive types and array types
|
||||||
if (java_lang_Class::is_primitive(JNIHandles::resolve_non_null(ofClass))
|
if (java_lang_Class::is_primitive(JNIHandles::resolve_non_null(ofClass))
|
||||||
|| Klass::cast(java_lang_Class::as_Klass(JNIHandles::resolve_non_null(ofClass)))->oop_is_array()) {
|
|| java_lang_Class::as_Klass(JNIHandles::resolve_non_null(ofClass))->oop_is_array()) {
|
||||||
// Return empty array
|
// Return empty array
|
||||||
oop res = oopFactory::new_objArray(SystemDictionary::reflect_Constructor_klass(), 0 , CHECK_NULL);
|
oop res = oopFactory::new_objArray(SystemDictionary::reflect_Constructor_klass(), 0 , CHECK_NULL);
|
||||||
return (jobjectArray) JNIHandles::make_local(env, res);
|
return (jobjectArray) JNIHandles::make_local(env, res);
|
||||||
|
@ -1751,7 +1751,7 @@ JVM_ENTRY(jint, JVM_GetClassAccessFlags(JNIEnv *env, jclass cls))
|
||||||
return JVM_ACC_ABSTRACT | JVM_ACC_FINAL | JVM_ACC_PUBLIC;
|
return JVM_ACC_ABSTRACT | JVM_ACC_FINAL | JVM_ACC_PUBLIC;
|
||||||
}
|
}
|
||||||
|
|
||||||
Klass* k = Klass::cast(java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls)));
|
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
|
||||||
return k->access_flags().as_int() & JVM_ACC_WRITTEN_FLAGS;
|
return k->access_flags().as_int() & JVM_ACC_WRITTEN_FLAGS;
|
||||||
}
|
}
|
||||||
JVM_END
|
JVM_END
|
||||||
|
@ -1767,7 +1767,7 @@ JVM_ENTRY(jobject, JVM_GetClassConstantPool(JNIEnv *env, jclass cls))
|
||||||
// Return null for primitives and arrays
|
// Return null for primitives and arrays
|
||||||
if (!java_lang_Class::is_primitive(JNIHandles::resolve_non_null(cls))) {
|
if (!java_lang_Class::is_primitive(JNIHandles::resolve_non_null(cls))) {
|
||||||
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
|
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
|
||||||
if (Klass::cast(k)->oop_is_instance()) {
|
if (k->oop_is_instance()) {
|
||||||
instanceKlassHandle k_h(THREAD, k);
|
instanceKlassHandle k_h(THREAD, k);
|
||||||
Handle jcp = sun_reflect_ConstantPool::create(CHECK_NULL);
|
Handle jcp = sun_reflect_ConstantPool::create(CHECK_NULL);
|
||||||
sun_reflect_ConstantPool::set_cp(jcp(), k_h->constants());
|
sun_reflect_ConstantPool::set_cp(jcp(), k_h->constants());
|
||||||
|
@ -2043,12 +2043,12 @@ JVM_ENTRY(jboolean, JVM_DesiredAssertionStatus(JNIEnv *env, jclass unused, jclas
|
||||||
if (java_lang_Class::is_primitive(r)) return false;
|
if (java_lang_Class::is_primitive(r)) return false;
|
||||||
|
|
||||||
Klass* k = java_lang_Class::as_Klass(r);
|
Klass* k = java_lang_Class::as_Klass(r);
|
||||||
assert(Klass::cast(k)->oop_is_instance(), "must be an instance klass");
|
assert(k->oop_is_instance(), "must be an instance klass");
|
||||||
if (! Klass::cast(k)->oop_is_instance()) return false;
|
if (! k->oop_is_instance()) return false;
|
||||||
|
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
const char* name = Klass::cast(k)->name()->as_C_string();
|
const char* name = k->name()->as_C_string();
|
||||||
bool system_class = Klass::cast(k)->class_loader() == NULL;
|
bool system_class = k->class_loader() == NULL;
|
||||||
return JavaAssertions::enabled(name, system_class);
|
return JavaAssertions::enabled(name, system_class);
|
||||||
|
|
||||||
JVM_END
|
JVM_END
|
||||||
|
@ -2079,7 +2079,7 @@ JVM_ENTRY(const char*, JVM_GetClassNameUTF(JNIEnv *env, jclass cls))
|
||||||
JVMWrapper("JVM_GetClassNameUTF");
|
JVMWrapper("JVM_GetClassNameUTF");
|
||||||
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
|
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
|
||||||
k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
|
k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
|
||||||
return Klass::cast(k)->name()->as_utf8();
|
return k->name()->as_utf8();
|
||||||
JVM_END
|
JVM_END
|
||||||
|
|
||||||
|
|
||||||
|
@ -2089,7 +2089,7 @@ JVM_QUICK_ENTRY(void, JVM_GetClassCPTypes(JNIEnv *env, jclass cls, unsigned char
|
||||||
k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
|
k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
|
||||||
// types will have length zero if this is not an InstanceKlass
|
// types will have length zero if this is not an InstanceKlass
|
||||||
// (length is determined by call to JVM_GetClassCPEntriesCount)
|
// (length is determined by call to JVM_GetClassCPEntriesCount)
|
||||||
if (Klass::cast(k)->oop_is_instance()) {
|
if (k->oop_is_instance()) {
|
||||||
ConstantPool* cp = InstanceKlass::cast(k)->constants();
|
ConstantPool* cp = InstanceKlass::cast(k)->constants();
|
||||||
for (int index = cp->length() - 1; index >= 0; index--) {
|
for (int index = cp->length() - 1; index >= 0; index--) {
|
||||||
constantTag tag = cp->tag_at(index);
|
constantTag tag = cp->tag_at(index);
|
||||||
|
@ -2103,7 +2103,7 @@ JVM_QUICK_ENTRY(jint, JVM_GetClassCPEntriesCount(JNIEnv *env, jclass cls))
|
||||||
JVMWrapper("JVM_GetClassCPEntriesCount");
|
JVMWrapper("JVM_GetClassCPEntriesCount");
|
||||||
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
|
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
|
||||||
k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
|
k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
|
||||||
if (!Klass::cast(k)->oop_is_instance())
|
if (!k->oop_is_instance())
|
||||||
return 0;
|
return 0;
|
||||||
return InstanceKlass::cast(k)->constants()->length();
|
return InstanceKlass::cast(k)->constants()->length();
|
||||||
JVM_END
|
JVM_END
|
||||||
|
@ -2113,7 +2113,7 @@ JVM_QUICK_ENTRY(jint, JVM_GetClassFieldsCount(JNIEnv *env, jclass cls))
|
||||||
JVMWrapper("JVM_GetClassFieldsCount");
|
JVMWrapper("JVM_GetClassFieldsCount");
|
||||||
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
|
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
|
||||||
k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
|
k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
|
||||||
if (!Klass::cast(k)->oop_is_instance())
|
if (!k->oop_is_instance())
|
||||||
return 0;
|
return 0;
|
||||||
return InstanceKlass::cast(k)->java_fields_count();
|
return InstanceKlass::cast(k)->java_fields_count();
|
||||||
JVM_END
|
JVM_END
|
||||||
|
@ -2123,7 +2123,7 @@ JVM_QUICK_ENTRY(jint, JVM_GetClassMethodsCount(JNIEnv *env, jclass cls))
|
||||||
JVMWrapper("JVM_GetClassMethodsCount");
|
JVMWrapper("JVM_GetClassMethodsCount");
|
||||||
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
|
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
|
||||||
k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
|
k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
|
||||||
if (!Klass::cast(k)->oop_is_instance())
|
if (!k->oop_is_instance())
|
||||||
return 0;
|
return 0;
|
||||||
return InstanceKlass::cast(k)->methods()->length();
|
return InstanceKlass::cast(k)->methods()->length();
|
||||||
JVM_END
|
JVM_END
|
||||||
|
@ -3123,7 +3123,7 @@ JVM_ENTRY(jobjectArray, JVM_GetClassContext(JNIEnv *env))
|
||||||
// Fill in mirrors corresponding to method holders
|
// Fill in mirrors corresponding to method holders
|
||||||
int index = 0;
|
int index = 0;
|
||||||
while (first != NULL) {
|
while (first != NULL) {
|
||||||
result->obj_at_put(index++, Klass::cast(first->klass())->java_mirror());
|
result->obj_at_put(index++, first->klass()->java_mirror());
|
||||||
first = first->next;
|
first = first->next;
|
||||||
}
|
}
|
||||||
assert(index == depth, "just checking");
|
assert(index == depth, "just checking");
|
||||||
|
@ -3217,7 +3217,7 @@ bool force_verify_field_access(Klass* current_class, Klass* field_class, AccessF
|
||||||
|
|
||||||
if (access.is_protected()) {
|
if (access.is_protected()) {
|
||||||
// See if current_class is a subclass of field_class
|
// See if current_class is a subclass of field_class
|
||||||
if (Klass::cast(current_class)->is_subclass_of(field_class)) {
|
if (current_class->is_subclass_of(field_class)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3241,8 +3241,8 @@ JVM_ENTRY(jobject, JVM_AllocateNewObject(JNIEnv *env, jobject receiver, jclass c
|
||||||
}
|
}
|
||||||
|
|
||||||
// Arrays not allowed here, must use JVM_AllocateNewArray
|
// Arrays not allowed here, must use JVM_AllocateNewArray
|
||||||
if (Klass::cast(java_lang_Class::as_Klass(curr_mirror))->oop_is_array() ||
|
if (java_lang_Class::as_Klass(curr_mirror)->oop_is_array() ||
|
||||||
Klass::cast(java_lang_Class::as_Klass(init_mirror))->oop_is_array()) {
|
java_lang_Class::as_Klass(init_mirror)->oop_is_array()) {
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
THROW_0(vmSymbols::java_lang_InvalidClassException());
|
THROW_0(vmSymbols::java_lang_InvalidClassException());
|
||||||
}
|
}
|
||||||
|
@ -3264,7 +3264,7 @@ JVM_ENTRY(jobject, JVM_AllocateNewObject(JNIEnv *env, jobject receiver, jclass c
|
||||||
if (m.is_null()) {
|
if (m.is_null()) {
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
THROW_MSG_0(vmSymbols::java_lang_NoSuchMethodError(),
|
THROW_MSG_0(vmSymbols::java_lang_NoSuchMethodError(),
|
||||||
Method::name_and_sig_as_C_string(Klass::cast(init_klass()),
|
Method::name_and_sig_as_C_string(init_klass(),
|
||||||
vmSymbols::object_initializer_name(),
|
vmSymbols::object_initializer_name(),
|
||||||
vmSymbols::void_method_signature()));
|
vmSymbols::void_method_signature()));
|
||||||
}
|
}
|
||||||
|
@ -4245,7 +4245,7 @@ JVM_ENTRY(jobjectArray, JVM_GetEnclosingMethodInfo(JNIEnv *env, jclass ofClass))
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
Klass* k = java_lang_Class::as_Klass(mirror());
|
Klass* k = java_lang_Class::as_Klass(mirror());
|
||||||
if (!Klass::cast(k)->oop_is_instance()) {
|
if (!k->oop_is_instance()) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
instanceKlassHandle ik_h(THREAD, k);
|
instanceKlassHandle ik_h(THREAD, k);
|
||||||
|
@ -4256,7 +4256,7 @@ JVM_ENTRY(jobjectArray, JVM_GetEnclosingMethodInfo(JNIEnv *env, jclass ofClass))
|
||||||
objArrayOop dest_o = oopFactory::new_objArray(SystemDictionary::Object_klass(), 3, CHECK_NULL);
|
objArrayOop dest_o = oopFactory::new_objArray(SystemDictionary::Object_klass(), 3, CHECK_NULL);
|
||||||
objArrayHandle dest(THREAD, dest_o);
|
objArrayHandle dest(THREAD, dest_o);
|
||||||
Klass* enc_k = ik_h->constants()->klass_at(encl_method_class_idx, CHECK_NULL);
|
Klass* enc_k = ik_h->constants()->klass_at(encl_method_class_idx, CHECK_NULL);
|
||||||
dest->obj_at_put(0, Klass::cast(enc_k)->java_mirror());
|
dest->obj_at_put(0, enc_k->java_mirror());
|
||||||
int encl_method_method_idx = ik_h->enclosing_method_method_index();
|
int encl_method_method_idx = ik_h->enclosing_method_method_index();
|
||||||
if (encl_method_method_idx != 0) {
|
if (encl_method_method_idx != 0) {
|
||||||
Symbol* sym = ik_h->constants()->symbol_at(
|
Symbol* sym = ik_h->constants()->symbol_at(
|
||||||
|
|
|
@ -2116,7 +2116,7 @@ JvmtiEnv::GetClassSignature(oop k_mirror, char** signature_ptr, char** generic_p
|
||||||
result[0] = tchar;
|
result[0] = tchar;
|
||||||
result[1] = '\0';
|
result[1] = '\0';
|
||||||
} else {
|
} else {
|
||||||
const char* class_sig = Klass::cast(k)->signature_name();
|
const char* class_sig = k->signature_name();
|
||||||
result = (char *) jvmtiMalloc(strlen(class_sig)+1);
|
result = (char *) jvmtiMalloc(strlen(class_sig)+1);
|
||||||
strcpy(result, class_sig);
|
strcpy(result, class_sig);
|
||||||
}
|
}
|
||||||
|
@ -2124,7 +2124,7 @@ JvmtiEnv::GetClassSignature(oop k_mirror, char** signature_ptr, char** generic_p
|
||||||
}
|
}
|
||||||
if (generic_ptr != NULL) {
|
if (generic_ptr != NULL) {
|
||||||
*generic_ptr = NULL;
|
*generic_ptr = NULL;
|
||||||
if (!isPrimitive && Klass::cast(k)->oop_is_instance()) {
|
if (!isPrimitive && k->oop_is_instance()) {
|
||||||
Symbol* soo = InstanceKlass::cast(k)->generic_signature();
|
Symbol* soo = InstanceKlass::cast(k)->generic_signature();
|
||||||
if (soo != NULL) {
|
if (soo != NULL) {
|
||||||
const char *gen_sig = soo->as_C_string();
|
const char *gen_sig = soo->as_C_string();
|
||||||
|
@ -2155,7 +2155,7 @@ JvmtiEnv::GetClassStatus(oop k_mirror, jint* status_ptr) {
|
||||||
} else {
|
} else {
|
||||||
Klass* k = java_lang_Class::as_Klass(k_mirror);
|
Klass* k = java_lang_Class::as_Klass(k_mirror);
|
||||||
NULL_CHECK(k, JVMTI_ERROR_INVALID_CLASS);
|
NULL_CHECK(k, JVMTI_ERROR_INVALID_CLASS);
|
||||||
result = Klass::cast(k)->jvmti_class_status();
|
result = k->jvmti_class_status();
|
||||||
}
|
}
|
||||||
*status_ptr = result;
|
*status_ptr = result;
|
||||||
|
|
||||||
|
@ -2173,7 +2173,7 @@ JvmtiEnv::GetSourceFileName(oop k_mirror, char** source_name_ptr) {
|
||||||
Klass* k_klass = java_lang_Class::as_Klass(k_mirror);
|
Klass* k_klass = java_lang_Class::as_Klass(k_mirror);
|
||||||
NULL_CHECK(k_klass, JVMTI_ERROR_INVALID_CLASS);
|
NULL_CHECK(k_klass, JVMTI_ERROR_INVALID_CLASS);
|
||||||
|
|
||||||
if (!Klass::cast(k_klass)->oop_is_instance()) {
|
if (!k_klass->oop_is_instance()) {
|
||||||
return JVMTI_ERROR_ABSENT_INFORMATION;
|
return JVMTI_ERROR_ABSENT_INFORMATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2200,7 +2200,7 @@ JvmtiEnv::GetClassModifiers(oop k_mirror, jint* modifiers_ptr) {
|
||||||
if (!java_lang_Class::is_primitive(k_mirror)) {
|
if (!java_lang_Class::is_primitive(k_mirror)) {
|
||||||
Klass* k = java_lang_Class::as_Klass(k_mirror);
|
Klass* k = java_lang_Class::as_Klass(k_mirror);
|
||||||
NULL_CHECK(k, JVMTI_ERROR_INVALID_CLASS);
|
NULL_CHECK(k, JVMTI_ERROR_INVALID_CLASS);
|
||||||
result = Klass::cast(k)->compute_modifier_flags(current_thread);
|
result = k->compute_modifier_flags(current_thread);
|
||||||
JavaThread* THREAD = current_thread; // pass to macros
|
JavaThread* THREAD = current_thread; // pass to macros
|
||||||
if (HAS_PENDING_EXCEPTION) {
|
if (HAS_PENDING_EXCEPTION) {
|
||||||
CLEAR_PENDING_EXCEPTION;
|
CLEAR_PENDING_EXCEPTION;
|
||||||
|
@ -2208,7 +2208,7 @@ JvmtiEnv::GetClassModifiers(oop k_mirror, jint* modifiers_ptr) {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Reset the deleted ACC_SUPER bit ( deleted in compute_modifier_flags()).
|
// Reset the deleted ACC_SUPER bit ( deleted in compute_modifier_flags()).
|
||||||
if(Klass::cast(k)->is_super()) {
|
if(k->is_super()) {
|
||||||
result |= JVM_ACC_SUPER;
|
result |= JVM_ACC_SUPER;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -2237,11 +2237,11 @@ JvmtiEnv::GetClassMethods(oop k_mirror, jint* method_count_ptr, jmethodID** meth
|
||||||
NULL_CHECK(k, JVMTI_ERROR_INVALID_CLASS);
|
NULL_CHECK(k, JVMTI_ERROR_INVALID_CLASS);
|
||||||
|
|
||||||
// Return CLASS_NOT_PREPARED error as per JVMTI spec.
|
// Return CLASS_NOT_PREPARED error as per JVMTI spec.
|
||||||
if (!(Klass::cast(k)->jvmti_class_status() & (JVMTI_CLASS_STATUS_PREPARED|JVMTI_CLASS_STATUS_ARRAY) )) {
|
if (!(k->jvmti_class_status() & (JVMTI_CLASS_STATUS_PREPARED|JVMTI_CLASS_STATUS_ARRAY) )) {
|
||||||
return JVMTI_ERROR_CLASS_NOT_PREPARED;
|
return JVMTI_ERROR_CLASS_NOT_PREPARED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Klass::cast(k)->oop_is_instance()) {
|
if (!k->oop_is_instance()) {
|
||||||
*method_count_ptr = 0;
|
*method_count_ptr = 0;
|
||||||
*methods_ptr = (jmethodID*) jvmtiMalloc(0 * sizeof(jmethodID));
|
*methods_ptr = (jmethodID*) jvmtiMalloc(0 * sizeof(jmethodID));
|
||||||
return JVMTI_ERROR_NONE;
|
return JVMTI_ERROR_NONE;
|
||||||
|
@ -2293,11 +2293,11 @@ JvmtiEnv::GetClassFields(oop k_mirror, jint* field_count_ptr, jfieldID** fields_
|
||||||
NULL_CHECK(k, JVMTI_ERROR_INVALID_CLASS);
|
NULL_CHECK(k, JVMTI_ERROR_INVALID_CLASS);
|
||||||
|
|
||||||
// Return CLASS_NOT_PREPARED error as per JVMTI spec.
|
// Return CLASS_NOT_PREPARED error as per JVMTI spec.
|
||||||
if (!(Klass::cast(k)->jvmti_class_status() & (JVMTI_CLASS_STATUS_PREPARED|JVMTI_CLASS_STATUS_ARRAY) )) {
|
if (!(k->jvmti_class_status() & (JVMTI_CLASS_STATUS_PREPARED|JVMTI_CLASS_STATUS_ARRAY) )) {
|
||||||
return JVMTI_ERROR_CLASS_NOT_PREPARED;
|
return JVMTI_ERROR_CLASS_NOT_PREPARED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Klass::cast(k)->oop_is_instance()) {
|
if (!k->oop_is_instance()) {
|
||||||
*field_count_ptr = 0;
|
*field_count_ptr = 0;
|
||||||
*fields_ptr = (jfieldID*) jvmtiMalloc(0 * sizeof(jfieldID));
|
*fields_ptr = (jfieldID*) jvmtiMalloc(0 * sizeof(jfieldID));
|
||||||
return JVMTI_ERROR_NONE;
|
return JVMTI_ERROR_NONE;
|
||||||
|
@ -2348,10 +2348,10 @@ JvmtiEnv::GetImplementedInterfaces(oop k_mirror, jint* interface_count_ptr, jcla
|
||||||
NULL_CHECK(k, JVMTI_ERROR_INVALID_CLASS);
|
NULL_CHECK(k, JVMTI_ERROR_INVALID_CLASS);
|
||||||
|
|
||||||
// Return CLASS_NOT_PREPARED error as per JVMTI spec.
|
// Return CLASS_NOT_PREPARED error as per JVMTI spec.
|
||||||
if (!(Klass::cast(k)->jvmti_class_status() & (JVMTI_CLASS_STATUS_PREPARED|JVMTI_CLASS_STATUS_ARRAY) ))
|
if (!(k->jvmti_class_status() & (JVMTI_CLASS_STATUS_PREPARED|JVMTI_CLASS_STATUS_ARRAY) ))
|
||||||
return JVMTI_ERROR_CLASS_NOT_PREPARED;
|
return JVMTI_ERROR_CLASS_NOT_PREPARED;
|
||||||
|
|
||||||
if (!Klass::cast(k)->oop_is_instance()) {
|
if (!k->oop_is_instance()) {
|
||||||
*interface_count_ptr = 0;
|
*interface_count_ptr = 0;
|
||||||
*interfaces_ptr = (jclass*) jvmtiMalloc(0 * sizeof(jclass));
|
*interfaces_ptr = (jclass*) jvmtiMalloc(0 * sizeof(jclass));
|
||||||
return JVMTI_ERROR_NONE;
|
return JVMTI_ERROR_NONE;
|
||||||
|
@ -2363,8 +2363,8 @@ JvmtiEnv::GetImplementedInterfaces(oop k_mirror, jint* interface_count_ptr, jcla
|
||||||
for (int i_index = 0; i_index < result_length; i_index += 1) {
|
for (int i_index = 0; i_index < result_length; i_index += 1) {
|
||||||
Klass* klass_at = interface_list->at(i_index);
|
Klass* klass_at = interface_list->at(i_index);
|
||||||
assert(klass_at->is_klass(), "interfaces must be Klass*s");
|
assert(klass_at->is_klass(), "interfaces must be Klass*s");
|
||||||
assert(Klass::cast(klass_at)->is_interface(), "interfaces must be interfaces");
|
assert(klass_at->is_interface(), "interfaces must be interfaces");
|
||||||
oop mirror_at = Klass::cast(klass_at)->java_mirror();
|
oop mirror_at = klass_at->java_mirror();
|
||||||
Handle handle_at = Handle(current_thread, mirror_at);
|
Handle handle_at = Handle(current_thread, mirror_at);
|
||||||
result_list[i_index] = (jclass) jni_reference(handle_at);
|
result_list[i_index] = (jclass) jni_reference(handle_at);
|
||||||
}
|
}
|
||||||
|
@ -2468,7 +2468,7 @@ JvmtiEnv::IsInterface(oop k_mirror, jboolean* is_interface_ptr) {
|
||||||
bool result = false;
|
bool result = false;
|
||||||
if (!java_lang_Class::is_primitive(k_mirror)) {
|
if (!java_lang_Class::is_primitive(k_mirror)) {
|
||||||
Klass* k = java_lang_Class::as_Klass(k_mirror);
|
Klass* k = java_lang_Class::as_Klass(k_mirror);
|
||||||
if (k != NULL && Klass::cast(k)->is_interface()) {
|
if (k != NULL && k->is_interface()) {
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2487,7 +2487,7 @@ JvmtiEnv::IsArrayClass(oop k_mirror, jboolean* is_array_class_ptr) {
|
||||||
bool result = false;
|
bool result = false;
|
||||||
if (!java_lang_Class::is_primitive(k_mirror)) {
|
if (!java_lang_Class::is_primitive(k_mirror)) {
|
||||||
Klass* k = java_lang_Class::as_Klass(k_mirror);
|
Klass* k = java_lang_Class::as_Klass(k_mirror);
|
||||||
if (k != NULL && Klass::cast(k)->oop_is_array()) {
|
if (k != NULL && k->oop_is_array()) {
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2512,7 +2512,7 @@ JvmtiEnv::GetClassLoader(oop k_mirror, jobject* classloader_ptr) {
|
||||||
Klass* k = java_lang_Class::as_Klass(k_mirror);
|
Klass* k = java_lang_Class::as_Klass(k_mirror);
|
||||||
NULL_CHECK(k, JVMTI_ERROR_INVALID_CLASS);
|
NULL_CHECK(k, JVMTI_ERROR_INVALID_CLASS);
|
||||||
|
|
||||||
oop result_oop = Klass::cast(k)->class_loader();
|
oop result_oop = k->class_loader();
|
||||||
if (result_oop == NULL) {
|
if (result_oop == NULL) {
|
||||||
*classloader_ptr = (jclass) jni_reference(Handle());
|
*classloader_ptr = (jclass) jni_reference(Handle());
|
||||||
return JVMTI_ERROR_NONE;
|
return JVMTI_ERROR_NONE;
|
||||||
|
@ -2535,7 +2535,7 @@ JvmtiEnv::GetSourceDebugExtension(oop k_mirror, char** source_debug_extension_pt
|
||||||
}
|
}
|
||||||
Klass* k = java_lang_Class::as_Klass(k_mirror);
|
Klass* k = java_lang_Class::as_Klass(k_mirror);
|
||||||
NULL_CHECK(k, JVMTI_ERROR_INVALID_CLASS);
|
NULL_CHECK(k, JVMTI_ERROR_INVALID_CLASS);
|
||||||
if (!Klass::cast(k)->oop_is_instance()) {
|
if (!k->oop_is_instance()) {
|
||||||
return JVMTI_ERROR_ABSENT_INFORMATION;
|
return JVMTI_ERROR_ABSENT_INFORMATION;
|
||||||
}
|
}
|
||||||
char* sde = InstanceKlass::cast(k)->source_debug_extension();
|
char* sde = InstanceKlass::cast(k)->source_debug_extension();
|
||||||
|
|
|
@ -590,7 +590,7 @@ JvmtiEnvBase::vframeFor(JavaThread* java_thread, jint depth) {
|
||||||
jclass
|
jclass
|
||||||
JvmtiEnvBase::get_jni_class_non_null(Klass* k) {
|
JvmtiEnvBase::get_jni_class_non_null(Klass* k) {
|
||||||
assert(k != NULL, "k != NULL");
|
assert(k != NULL, "k != NULL");
|
||||||
return (jclass)jni_reference(Klass::cast(k)->java_mirror());
|
return (jclass)jni_reference(k->java_mirror());
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef JVMTI_KERNEL
|
#ifndef JVMTI_KERNEL
|
||||||
|
@ -1365,7 +1365,7 @@ JvmtiEnvBase::check_top_frame(JavaThread* current_thread, JavaThread* java_threa
|
||||||
// Method return type signature.
|
// Method return type signature.
|
||||||
char* ty_sign = 1 + strchr(signature->as_C_string(), ')');
|
char* ty_sign = 1 + strchr(signature->as_C_string(), ')');
|
||||||
|
|
||||||
if (!VM_GetOrSetLocal::is_assignable(ty_sign, Klass::cast(ob_kh()), current_thread)) {
|
if (!VM_GetOrSetLocal::is_assignable(ty_sign, ob_kh(), current_thread)) {
|
||||||
return JVMTI_ERROR_TYPE_MISMATCH;
|
return JVMTI_ERROR_TYPE_MISMATCH;
|
||||||
}
|
}
|
||||||
*ret_ob_h = ob_h;
|
*ret_ob_h = ob_h;
|
||||||
|
|
|
@ -196,7 +196,7 @@ public:
|
||||||
jobject to_jobject(oop obj) { return JNIHandles::make_local(_thread,obj); }
|
jobject to_jobject(oop obj) { return JNIHandles::make_local(_thread,obj); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
jclass to_jclass(Klass* klass) { return (klass == NULL ? NULL : (jclass)to_jobject(Klass::cast(klass)->java_mirror())); }
|
jclass to_jclass(Klass* klass) { return (klass == NULL ? NULL : (jclass)to_jobject(klass->java_mirror())); }
|
||||||
|
|
||||||
jmethodID to_jmethodID(methodHandle method) { return method->jmethod_id(); }
|
jmethodID to_jmethodID(methodHandle method) { return method->jmethod_id(); }
|
||||||
|
|
||||||
|
@ -920,7 +920,7 @@ void JvmtiExport::post_class_load(JavaThread *thread, Klass* klass) {
|
||||||
if (ets->is_enabled(JVMTI_EVENT_CLASS_LOAD)) {
|
if (ets->is_enabled(JVMTI_EVENT_CLASS_LOAD)) {
|
||||||
EVT_TRACE(JVMTI_EVENT_CLASS_LOAD, ("JVMTI [%s] Evt Class Load sent %s",
|
EVT_TRACE(JVMTI_EVENT_CLASS_LOAD, ("JVMTI [%s] Evt Class Load sent %s",
|
||||||
JvmtiTrace::safe_get_thread_name(thread),
|
JvmtiTrace::safe_get_thread_name(thread),
|
||||||
kh()==NULL? "NULL" : Klass::cast(kh())->external_name() ));
|
kh()==NULL? "NULL" : kh()->external_name() ));
|
||||||
|
|
||||||
JvmtiEnv *env = ets->get_env();
|
JvmtiEnv *env = ets->get_env();
|
||||||
JvmtiClassEventMark jem(thread, kh());
|
JvmtiClassEventMark jem(thread, kh());
|
||||||
|
@ -949,7 +949,7 @@ void JvmtiExport::post_class_prepare(JavaThread *thread, Klass* klass) {
|
||||||
if (ets->is_enabled(JVMTI_EVENT_CLASS_PREPARE)) {
|
if (ets->is_enabled(JVMTI_EVENT_CLASS_PREPARE)) {
|
||||||
EVT_TRACE(JVMTI_EVENT_CLASS_PREPARE, ("JVMTI [%s] Evt Class Prepare sent %s",
|
EVT_TRACE(JVMTI_EVENT_CLASS_PREPARE, ("JVMTI [%s] Evt Class Prepare sent %s",
|
||||||
JvmtiTrace::safe_get_thread_name(thread),
|
JvmtiTrace::safe_get_thread_name(thread),
|
||||||
kh()==NULL? "NULL" : Klass::cast(kh())->external_name() ));
|
kh()==NULL? "NULL" : kh()->external_name() ));
|
||||||
|
|
||||||
JvmtiEnv *env = ets->get_env();
|
JvmtiEnv *env = ets->get_env();
|
||||||
JvmtiClassEventMark jem(thread, kh());
|
JvmtiClassEventMark jem(thread, kh());
|
||||||
|
@ -979,12 +979,12 @@ void JvmtiExport::post_class_unload(Klass* klass) {
|
||||||
for (JvmtiEnv* env = it.first(); env != NULL; env = it.next(env)) {
|
for (JvmtiEnv* env = it.first(); env != NULL; env = it.next(env)) {
|
||||||
if (env->is_enabled((jvmtiEvent)EXT_EVENT_CLASS_UNLOAD)) {
|
if (env->is_enabled((jvmtiEvent)EXT_EVENT_CLASS_UNLOAD)) {
|
||||||
EVT_TRACE(EXT_EVENT_CLASS_UNLOAD, ("JVMTI [?] Evt Class Unload sent %s",
|
EVT_TRACE(EXT_EVENT_CLASS_UNLOAD, ("JVMTI [?] Evt Class Unload sent %s",
|
||||||
kh()==NULL? "NULL" : Klass::cast(kh())->external_name() ));
|
kh()==NULL? "NULL" : kh()->external_name() ));
|
||||||
|
|
||||||
// do everything manually, since this is a proxy - needs special care
|
// do everything manually, since this is a proxy - needs special care
|
||||||
JNIEnv* jni_env = real_thread->jni_environment();
|
JNIEnv* jni_env = real_thread->jni_environment();
|
||||||
jthread jt = (jthread)JNIHandles::make_local(real_thread, real_thread->threadObj());
|
jthread jt = (jthread)JNIHandles::make_local(real_thread, real_thread->threadObj());
|
||||||
jclass jk = (jclass)JNIHandles::make_local(real_thread, Klass::cast(kh())->java_mirror());
|
jclass jk = (jclass)JNIHandles::make_local(real_thread, kh()->java_mirror());
|
||||||
|
|
||||||
// Before we call the JVMTI agent, we have to set the state in the
|
// Before we call the JVMTI agent, we have to set the state in the
|
||||||
// thread for which we are proxying.
|
// thread for which we are proxying.
|
||||||
|
@ -2121,7 +2121,7 @@ void JvmtiExport::post_vm_object_alloc(JavaThread *thread, oop object) {
|
||||||
if (env->is_enabled(JVMTI_EVENT_VM_OBJECT_ALLOC)) {
|
if (env->is_enabled(JVMTI_EVENT_VM_OBJECT_ALLOC)) {
|
||||||
EVT_TRACE(JVMTI_EVENT_VM_OBJECT_ALLOC, ("JVMTI [%s] Evt vmobject alloc sent %s",
|
EVT_TRACE(JVMTI_EVENT_VM_OBJECT_ALLOC, ("JVMTI [%s] Evt vmobject alloc sent %s",
|
||||||
JvmtiTrace::safe_get_thread_name(thread),
|
JvmtiTrace::safe_get_thread_name(thread),
|
||||||
object==NULL? "NULL" : Klass::cast(java_lang_Class::as_Klass(object))->external_name()));
|
object==NULL? "NULL" : java_lang_Class::as_Klass(object)->external_name()));
|
||||||
|
|
||||||
JvmtiVMObjectAllocEventMark jem(thread, h());
|
JvmtiVMObjectAllocEventMark jem(thread, h());
|
||||||
JvmtiJavaThreadEventTransition jet(thread);
|
JvmtiJavaThreadEventTransition jet(thread);
|
||||||
|
|
|
@ -169,7 +169,7 @@ class JvmtiGetLoadedClassesClosure : public StackObj {
|
||||||
static void increment(Klass* k) {
|
static void increment(Klass* k) {
|
||||||
JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this();
|
JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this();
|
||||||
if (that->get_initiatingLoader() == NULL) {
|
if (that->get_initiatingLoader() == NULL) {
|
||||||
for (Klass* l = k; l != NULL; l = Klass::cast(l)->array_klass_or_null()) {
|
for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) {
|
||||||
that->set_count(that->get_count() + 1);
|
that->set_count(that->get_count() + 1);
|
||||||
}
|
}
|
||||||
} else if (k != NULL) {
|
} else if (k != NULL) {
|
||||||
|
@ -182,7 +182,7 @@ class JvmtiGetLoadedClassesClosure : public StackObj {
|
||||||
JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this();
|
JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this();
|
||||||
oop class_loader = loader_data->class_loader();
|
oop class_loader = loader_data->class_loader();
|
||||||
if (class_loader == JNIHandles::resolve(that->get_initiatingLoader())) {
|
if (class_loader == JNIHandles::resolve(that->get_initiatingLoader())) {
|
||||||
for (Klass* l = k; l != NULL; l = Klass::cast(l)->array_klass_or_null()) {
|
for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) {
|
||||||
that->set_count(that->get_count() + 1);
|
that->set_count(that->get_count() + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -200,14 +200,14 @@ class JvmtiGetLoadedClassesClosure : public StackObj {
|
||||||
JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this();
|
JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this();
|
||||||
if (that->available()) {
|
if (that->available()) {
|
||||||
if (that->get_initiatingLoader() == NULL) {
|
if (that->get_initiatingLoader() == NULL) {
|
||||||
for (Klass* l = k; l != NULL; l = Klass::cast(l)->array_klass_or_null()) {
|
for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) {
|
||||||
oop mirror = Klass::cast(l)->java_mirror();
|
oop mirror = l->java_mirror();
|
||||||
that->set_element(that->get_index(), mirror);
|
that->set_element(that->get_index(), mirror);
|
||||||
that->set_index(that->get_index() + 1);
|
that->set_index(that->get_index() + 1);
|
||||||
}
|
}
|
||||||
} else if (k != NULL) {
|
} else if (k != NULL) {
|
||||||
// if initiating loader not null, just include the instance with 1 dimension
|
// if initiating loader not null, just include the instance with 1 dimension
|
||||||
oop mirror = Klass::cast(k)->java_mirror();
|
oop mirror = k->java_mirror();
|
||||||
that->set_element(that->get_index(), mirror);
|
that->set_element(that->get_index(), mirror);
|
||||||
that->set_index(that->get_index() + 1);
|
that->set_index(that->get_index() + 1);
|
||||||
}
|
}
|
||||||
|
@ -219,8 +219,8 @@ class JvmtiGetLoadedClassesClosure : public StackObj {
|
||||||
if (that->available()) {
|
if (that->available()) {
|
||||||
oop class_loader = loader_data->class_loader();
|
oop class_loader = loader_data->class_loader();
|
||||||
if (class_loader == JNIHandles::resolve(that->get_initiatingLoader())) {
|
if (class_loader == JNIHandles::resolve(that->get_initiatingLoader())) {
|
||||||
for (Klass* l = k; l != NULL; l = Klass::cast(l)->array_klass_or_null()) {
|
for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) {
|
||||||
oop mirror = Klass::cast(l)->java_mirror();
|
oop mirror = l->java_mirror();
|
||||||
that->set_element(that->get_index(), mirror);
|
that->set_element(that->get_index(), mirror);
|
||||||
that->set_index(that->get_index() + 1);
|
that->set_index(that->get_index() + 1);
|
||||||
}
|
}
|
||||||
|
@ -234,7 +234,7 @@ class JvmtiGetLoadedClassesClosure : public StackObj {
|
||||||
static void increment_for_basic_type_arrays(Klass* k) {
|
static void increment_for_basic_type_arrays(Klass* k) {
|
||||||
JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this();
|
JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this();
|
||||||
assert(that != NULL, "no JvmtiGetLoadedClassesClosure");
|
assert(that != NULL, "no JvmtiGetLoadedClassesClosure");
|
||||||
for (Klass* l = k; l != NULL; l = Klass::cast(l)->array_klass_or_null()) {
|
for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) {
|
||||||
that->set_count(that->get_count() + 1);
|
that->set_count(that->get_count() + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -244,8 +244,8 @@ class JvmtiGetLoadedClassesClosure : public StackObj {
|
||||||
JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this();
|
JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this();
|
||||||
assert(that != NULL, "no JvmtiGetLoadedClassesClosure");
|
assert(that != NULL, "no JvmtiGetLoadedClassesClosure");
|
||||||
assert(that->available(), "no list");
|
assert(that->available(), "no list");
|
||||||
for (Klass* l = k; l != NULL; l = Klass::cast(l)->array_klass_or_null()) {
|
for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) {
|
||||||
oop mirror = Klass::cast(l)->java_mirror();
|
oop mirror = l->java_mirror();
|
||||||
that->set_element(that->get_index(), mirror);
|
that->set_element(that->get_index(), mirror);
|
||||||
that->set_index(that->get_index() + 1);
|
that->set_index(that->get_index() + 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -641,14 +641,14 @@ bool VM_GetOrSetLocal::is_assignable(const char* ty_sign, Klass* klass, Thread*
|
||||||
int super_depth = klass->super_depth();
|
int super_depth = klass->super_depth();
|
||||||
int idx;
|
int idx;
|
||||||
for (idx = 0; idx < super_depth; idx++) {
|
for (idx = 0; idx < super_depth; idx++) {
|
||||||
if (Klass::cast(klass->primary_super_of_depth(idx))->name() == ty_sym) {
|
if (klass->primary_super_of_depth(idx)->name() == ty_sym) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Compare secondary supers
|
// Compare secondary supers
|
||||||
Array<Klass*>* sec_supers = klass->secondary_supers();
|
Array<Klass*>* sec_supers = klass->secondary_supers();
|
||||||
for (idx = 0; idx < sec_supers->length(); idx++) {
|
for (idx = 0; idx < sec_supers->length(); idx++) {
|
||||||
if (Klass::cast((Klass*) sec_supers->at(idx))->name() == ty_sym) {
|
if (((Klass*) sec_supers->at(idx))->name() == ty_sym) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -726,7 +726,7 @@ bool VM_GetOrSetLocal::check_slot_type(javaVFrame* jvf) {
|
||||||
KlassHandle ob_kh = KlassHandle(cur_thread, obj->klass());
|
KlassHandle ob_kh = KlassHandle(cur_thread, obj->klass());
|
||||||
NULL_CHECK(ob_kh, (_result = JVMTI_ERROR_INVALID_OBJECT, false));
|
NULL_CHECK(ob_kh, (_result = JVMTI_ERROR_INVALID_OBJECT, false));
|
||||||
|
|
||||||
if (!is_assignable(signature, Klass::cast(ob_kh()), cur_thread)) {
|
if (!is_assignable(signature, ob_kh(), cur_thread)) {
|
||||||
_result = JVMTI_ERROR_TYPE_MISMATCH;
|
_result = JVMTI_ERROR_TYPE_MISMATCH;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -222,7 +222,7 @@ bool VM_RedefineClasses::is_modifiable_class(oop klass_mirror) {
|
||||||
}
|
}
|
||||||
Klass* the_class_oop = java_lang_Class::as_Klass(klass_mirror);
|
Klass* the_class_oop = java_lang_Class::as_Klass(klass_mirror);
|
||||||
// classes for arrays cannot be redefined
|
// classes for arrays cannot be redefined
|
||||||
if (the_class_oop == NULL || !Klass::cast(the_class_oop)->oop_is_instance()) {
|
if (the_class_oop == NULL || !the_class_oop->oop_is_instance()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -573,8 +573,8 @@ jvmtiError VM_RedefineClasses::compare_and_normalize_class_versions(
|
||||||
// Check for NULL superclass first since this might be java.lang.Object
|
// Check for NULL superclass first since this might be java.lang.Object
|
||||||
if (the_class->super() != scratch_class->super() &&
|
if (the_class->super() != scratch_class->super() &&
|
||||||
(the_class->super() == NULL || scratch_class->super() == NULL ||
|
(the_class->super() == NULL || scratch_class->super() == NULL ||
|
||||||
Klass::cast(the_class->super())->name() !=
|
the_class->super()->name() !=
|
||||||
Klass::cast(scratch_class->super())->name())) {
|
scratch_class->super()->name())) {
|
||||||
return JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED;
|
return JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -592,8 +592,8 @@ jvmtiError VM_RedefineClasses::compare_and_normalize_class_versions(
|
||||||
return JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED;
|
return JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED;
|
||||||
}
|
}
|
||||||
for (i = 0; i < n_intfs; i++) {
|
for (i = 0; i < n_intfs; i++) {
|
||||||
if (Klass::cast(k_interfaces->at(i))->name() !=
|
if (k_interfaces->at(i)->name() !=
|
||||||
Klass::cast(k_new_interfaces->at(i))->name()) {
|
k_new_interfaces->at(i)->name()) {
|
||||||
return JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED;
|
return JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2684,7 +2684,7 @@ void VM_RedefineClasses::adjust_cpool_cache_and_vtable(Klass* k_oop,
|
||||||
// interface, then we have to call adjust_method_entries() for
|
// interface, then we have to call adjust_method_entries() for
|
||||||
// every InstanceKlass that has an itable since there isn't a
|
// every InstanceKlass that has an itable since there isn't a
|
||||||
// subclass relationship between an interface and an InstanceKlass.
|
// subclass relationship between an interface and an InstanceKlass.
|
||||||
if (ik->itable_length() > 0 && (Klass::cast(_the_class_oop)->is_interface()
|
if (ik->itable_length() > 0 && (_the_class_oop->is_interface()
|
||||||
|| ik->is_subclass_of(_the_class_oop))) {
|
|| ik->is_subclass_of(_the_class_oop))) {
|
||||||
// ik->itable() creates a wrapper object; rm cleans it up
|
// ik->itable() creates a wrapper object; rm cleans it up
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
|
@ -2929,7 +2929,7 @@ class TransferNativeFunctionRegistration {
|
||||||
Symbol* signature) {
|
Symbol* signature) {
|
||||||
TempNewSymbol name_symbol = SymbolTable::probe(name_str, (int)name_len);
|
TempNewSymbol name_symbol = SymbolTable::probe(name_str, (int)name_len);
|
||||||
if (name_symbol != NULL) {
|
if (name_symbol != NULL) {
|
||||||
Method* method = Klass::cast(the_class())->lookup_method(name_symbol, signature);
|
Method* method = the_class()->lookup_method(name_symbol, signature);
|
||||||
if (method != NULL) {
|
if (method != NULL) {
|
||||||
// Even if prefixed, intermediate methods must exist.
|
// Even if prefixed, intermediate methods must exist.
|
||||||
if (method->is_native()) {
|
if (method->is_native()) {
|
||||||
|
|
|
@ -2774,7 +2774,7 @@ inline bool VM_HeapWalkOperation::iterate_over_array(oop o) {
|
||||||
// a type array references its class
|
// a type array references its class
|
||||||
inline bool VM_HeapWalkOperation::iterate_over_type_array(oop o) {
|
inline bool VM_HeapWalkOperation::iterate_over_type_array(oop o) {
|
||||||
Klass* k = o->klass();
|
Klass* k = o->klass();
|
||||||
oop mirror = Klass::cast(k)->java_mirror();
|
oop mirror = k->java_mirror();
|
||||||
if (!CallbackInvoker::report_class_reference(o, mirror)) {
|
if (!CallbackInvoker::report_class_reference(o, mirror)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -2823,7 +2823,7 @@ inline bool VM_HeapWalkOperation::iterate_over_class(oop java_class) {
|
||||||
// super (only if something more interesting than java.lang.Object)
|
// super (only if something more interesting than java.lang.Object)
|
||||||
Klass* java_super = ik->java_super();
|
Klass* java_super = ik->java_super();
|
||||||
if (java_super != NULL && java_super != SystemDictionary::Object_klass()) {
|
if (java_super != NULL && java_super != SystemDictionary::Object_klass()) {
|
||||||
oop super = Klass::cast(java_super)->java_mirror();
|
oop super = java_super->java_mirror();
|
||||||
if (!CallbackInvoker::report_superclass_reference(mirror, super)) {
|
if (!CallbackInvoker::report_superclass_reference(mirror, super)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -2865,7 +2865,7 @@ inline bool VM_HeapWalkOperation::iterate_over_class(oop java_class) {
|
||||||
// If the entry is non-null it is resolved.
|
// If the entry is non-null it is resolved.
|
||||||
if (entry == NULL) continue;
|
if (entry == NULL) continue;
|
||||||
} else {
|
} else {
|
||||||
entry = Klass::cast(pool->resolved_klass_at(i))->java_mirror();
|
entry = pool->resolved_klass_at(i)->java_mirror();
|
||||||
}
|
}
|
||||||
if (!CallbackInvoker::report_constant_pool_reference(mirror, entry, (jint)i)) {
|
if (!CallbackInvoker::report_constant_pool_reference(mirror, entry, (jint)i)) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -2879,7 +2879,7 @@ inline bool VM_HeapWalkOperation::iterate_over_class(oop java_class) {
|
||||||
// but are specified by IterateOverReachableObjects and must be reported).
|
// but are specified by IterateOverReachableObjects and must be reported).
|
||||||
Array<Klass*>* interfaces = ik->local_interfaces();
|
Array<Klass*>* interfaces = ik->local_interfaces();
|
||||||
for (i = 0; i < interfaces->length(); i++) {
|
for (i = 0; i < interfaces->length(); i++) {
|
||||||
oop interf = Klass::cast((Klass*)interfaces->at(i))->java_mirror();
|
oop interf = ((Klass*)interfaces->at(i))->java_mirror();
|
||||||
if (interf == NULL) {
|
if (interf == NULL) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -2928,7 +2928,7 @@ inline bool VM_HeapWalkOperation::iterate_over_class(oop java_class) {
|
||||||
// references from the class).
|
// references from the class).
|
||||||
inline bool VM_HeapWalkOperation::iterate_over_object(oop o) {
|
inline bool VM_HeapWalkOperation::iterate_over_object(oop o) {
|
||||||
// reference to the class
|
// reference to the class
|
||||||
if (!CallbackInvoker::report_class_reference(o, Klass::cast(o->klass())->java_mirror())) {
|
if (!CallbackInvoker::report_class_reference(o, o->klass()->java_mirror())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -292,7 +292,7 @@ const char * JvmtiTrace::get_class_name(oop k_mirror) {
|
||||||
if (k_oop == NULL) {
|
if (k_oop == NULL) {
|
||||||
return "INVALID";
|
return "INVALID";
|
||||||
}
|
}
|
||||||
return Klass::cast(k_oop)->external_name();
|
return k_oop->external_name();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /*JVMTI_TRACE */
|
#endif /*JVMTI_TRACE */
|
||||||
|
|
|
@ -138,7 +138,7 @@ oop MethodHandles::init_MemberName(oop mname_oop, oop target_oop) {
|
||||||
oop clazz = java_lang_reflect_Method::clazz(target_oop);
|
oop clazz = java_lang_reflect_Method::clazz(target_oop);
|
||||||
int slot = java_lang_reflect_Method::slot(target_oop);
|
int slot = java_lang_reflect_Method::slot(target_oop);
|
||||||
Klass* k = java_lang_Class::as_Klass(clazz);
|
Klass* k = java_lang_Class::as_Klass(clazz);
|
||||||
if (k != NULL && Klass::cast(k)->oop_is_instance()) {
|
if (k != NULL && k->oop_is_instance()) {
|
||||||
Method* m = InstanceKlass::cast(k)->method_with_idnum(slot);
|
Method* m = InstanceKlass::cast(k)->method_with_idnum(slot);
|
||||||
return init_method_MemberName(mname_oop, m, true, k);
|
return init_method_MemberName(mname_oop, m, true, k);
|
||||||
}
|
}
|
||||||
|
@ -146,7 +146,7 @@ oop MethodHandles::init_MemberName(oop mname_oop, oop target_oop) {
|
||||||
oop clazz = java_lang_reflect_Constructor::clazz(target_oop);
|
oop clazz = java_lang_reflect_Constructor::clazz(target_oop);
|
||||||
int slot = java_lang_reflect_Constructor::slot(target_oop);
|
int slot = java_lang_reflect_Constructor::slot(target_oop);
|
||||||
Klass* k = java_lang_Class::as_Klass(clazz);
|
Klass* k = java_lang_Class::as_Klass(clazz);
|
||||||
if (k != NULL && Klass::cast(k)->oop_is_instance()) {
|
if (k != NULL && k->oop_is_instance()) {
|
||||||
Method* m = InstanceKlass::cast(k)->method_with_idnum(slot);
|
Method* m = InstanceKlass::cast(k)->method_with_idnum(slot);
|
||||||
return init_method_MemberName(mname_oop, m, false, k);
|
return init_method_MemberName(mname_oop, m, false, k);
|
||||||
}
|
}
|
||||||
|
@ -187,14 +187,14 @@ oop MethodHandles::init_method_MemberName(oop mname_oop, Method* m, bool do_disp
|
||||||
} else if (mods.is_static()) {
|
} else if (mods.is_static()) {
|
||||||
flags |= IS_METHOD | (JVM_REF_invokeStatic << REFERENCE_KIND_SHIFT);
|
flags |= IS_METHOD | (JVM_REF_invokeStatic << REFERENCE_KIND_SHIFT);
|
||||||
} else if (receiver_limit != mklass &&
|
} else if (receiver_limit != mklass &&
|
||||||
!Klass::cast(receiver_limit)->is_subtype_of(mklass)) {
|
!receiver_limit->is_subtype_of(mklass)) {
|
||||||
return NULL; // bad receiver limit
|
return NULL; // bad receiver limit
|
||||||
} else if (Klass::cast(receiver_limit)->is_interface() &&
|
} else if (receiver_limit->is_interface() &&
|
||||||
Klass::cast(mklass)->is_interface()) {
|
mklass->is_interface()) {
|
||||||
flags |= IS_METHOD | (JVM_REF_invokeInterface << REFERENCE_KIND_SHIFT);
|
flags |= IS_METHOD | (JVM_REF_invokeInterface << REFERENCE_KIND_SHIFT);
|
||||||
receiver_limit = mklass; // ignore passed-in limit; interfaces are interconvertible
|
receiver_limit = mklass; // ignore passed-in limit; interfaces are interconvertible
|
||||||
vmindex = klassItable::compute_itable_index(m);
|
vmindex = klassItable::compute_itable_index(m);
|
||||||
} else if (mklass != receiver_limit && Klass::cast(mklass)->is_interface()) {
|
} else if (mklass != receiver_limit && mklass->is_interface()) {
|
||||||
flags |= IS_METHOD | (JVM_REF_invokeVirtual << REFERENCE_KIND_SHIFT);
|
flags |= IS_METHOD | (JVM_REF_invokeVirtual << REFERENCE_KIND_SHIFT);
|
||||||
// it is a miranda method, so m->vtable_index is not what we want
|
// it is a miranda method, so m->vtable_index is not what we want
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
|
@ -210,7 +210,7 @@ oop MethodHandles::init_method_MemberName(oop mname_oop, Method* m, bool do_disp
|
||||||
java_lang_invoke_MemberName::set_flags(mname_oop, flags);
|
java_lang_invoke_MemberName::set_flags(mname_oop, flags);
|
||||||
java_lang_invoke_MemberName::set_vmtarget(mname_oop, m);
|
java_lang_invoke_MemberName::set_vmtarget(mname_oop, m);
|
||||||
java_lang_invoke_MemberName::set_vmindex(mname_oop, vmindex); // vtable/itable index
|
java_lang_invoke_MemberName::set_vmindex(mname_oop, vmindex); // vtable/itable index
|
||||||
java_lang_invoke_MemberName::set_clazz(mname_oop, Klass::cast(receiver_limit)->java_mirror());
|
java_lang_invoke_MemberName::set_clazz(mname_oop, receiver_limit->java_mirror());
|
||||||
// Note: name and type can be lazily computed by resolve_MemberName,
|
// Note: name and type can be lazily computed by resolve_MemberName,
|
||||||
// if Java code needs them as resolved String and MethodType objects.
|
// if Java code needs them as resolved String and MethodType objects.
|
||||||
// The clazz must be eagerly stored, because it provides a GC
|
// The clazz must be eagerly stored, because it provides a GC
|
||||||
|
@ -258,7 +258,7 @@ oop MethodHandles::init_field_MemberName(oop mname_oop, Klass* field_holder,
|
||||||
java_lang_invoke_MemberName::set_flags(mname_oop, flags);
|
java_lang_invoke_MemberName::set_flags(mname_oop, flags);
|
||||||
java_lang_invoke_MemberName::set_vmtarget(mname_oop, vmtarget);
|
java_lang_invoke_MemberName::set_vmtarget(mname_oop, vmtarget);
|
||||||
java_lang_invoke_MemberName::set_vmindex(mname_oop, vmindex);
|
java_lang_invoke_MemberName::set_vmindex(mname_oop, vmindex);
|
||||||
java_lang_invoke_MemberName::set_clazz(mname_oop, Klass::cast(field_holder)->java_mirror());
|
java_lang_invoke_MemberName::set_clazz(mname_oop, field_holder->java_mirror());
|
||||||
if (name != NULL)
|
if (name != NULL)
|
||||||
java_lang_invoke_MemberName::set_name(mname_oop, name);
|
java_lang_invoke_MemberName::set_name(mname_oop, name);
|
||||||
if (type != NULL)
|
if (type != NULL)
|
||||||
|
@ -299,7 +299,7 @@ bool MethodHandles::is_method_handle_invoke_name(Klass* klass, Symbol* name) {
|
||||||
// The following test will fail spuriously during bootstrap of MethodHandle itself:
|
// The following test will fail spuriously during bootstrap of MethodHandle itself:
|
||||||
// if (klass != SystemDictionary::MethodHandle_klass())
|
// if (klass != SystemDictionary::MethodHandle_klass())
|
||||||
// Test the name instead:
|
// Test the name instead:
|
||||||
if (Klass::cast(klass)->name() != vmSymbols::java_lang_invoke_MethodHandle())
|
if (klass->name() != vmSymbols::java_lang_invoke_MethodHandle())
|
||||||
return false;
|
return false;
|
||||||
Symbol* poly_sig = vmSymbols::object_array_object_signature();
|
Symbol* poly_sig = vmSymbols::object_array_object_signature();
|
||||||
Method* m = InstanceKlass::cast(klass)->find_method(name, poly_sig);
|
Method* m = InstanceKlass::cast(klass)->find_method(name, poly_sig);
|
||||||
|
@ -363,7 +363,7 @@ vmIntrinsics::ID MethodHandles::signature_polymorphic_name_id(Symbol* name) {
|
||||||
|
|
||||||
vmIntrinsics::ID MethodHandles::signature_polymorphic_name_id(Klass* klass, Symbol* name) {
|
vmIntrinsics::ID MethodHandles::signature_polymorphic_name_id(Klass* klass, Symbol* name) {
|
||||||
if (klass != NULL &&
|
if (klass != NULL &&
|
||||||
Klass::cast(klass)->name() == vmSymbols::java_lang_invoke_MethodHandle()) {
|
klass->name() == vmSymbols::java_lang_invoke_MethodHandle()) {
|
||||||
vmIntrinsics::ID iid = signature_polymorphic_name_id(name);
|
vmIntrinsics::ID iid = signature_polymorphic_name_id(name);
|
||||||
if (iid != vmIntrinsics::_none)
|
if (iid != vmIntrinsics::_none)
|
||||||
return iid;
|
return iid;
|
||||||
|
@ -539,7 +539,7 @@ void MethodHandles::print_as_basic_type_signature_on(outputStream* st,
|
||||||
|
|
||||||
|
|
||||||
static oop object_java_mirror() {
|
static oop object_java_mirror() {
|
||||||
return Klass::cast(SystemDictionary::Object_klass())->java_mirror();
|
return SystemDictionary::Object_klass()->java_mirror();
|
||||||
}
|
}
|
||||||
|
|
||||||
static oop field_name_or_null(Symbol* s) {
|
static oop field_name_or_null(Symbol* s) {
|
||||||
|
@ -560,9 +560,9 @@ static oop field_signature_type_or_null(Symbol* s) {
|
||||||
if (s == vmSymbols::object_signature()) {
|
if (s == vmSymbols::object_signature()) {
|
||||||
return object_java_mirror();
|
return object_java_mirror();
|
||||||
} else if (s == vmSymbols::class_signature()) {
|
} else if (s == vmSymbols::class_signature()) {
|
||||||
return Klass::cast(SystemDictionary::Class_klass())->java_mirror();
|
return SystemDictionary::Class_klass()->java_mirror();
|
||||||
} else if (s == vmSymbols::string_signature()) {
|
} else if (s == vmSymbols::string_signature()) {
|
||||||
return Klass::cast(SystemDictionary::String_klass())->java_mirror();
|
return SystemDictionary::String_klass()->java_mirror();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -603,8 +603,8 @@ Handle MethodHandles::resolve_MemberName(Handle mname, TRAPS) {
|
||||||
{
|
{
|
||||||
Klass* defc_klass = java_lang_Class::as_Klass(defc_oop());
|
Klass* defc_klass = java_lang_Class::as_Klass(defc_oop());
|
||||||
if (defc_klass == NULL) return empty; // a primitive; no resolution possible
|
if (defc_klass == NULL) return empty; // a primitive; no resolution possible
|
||||||
if (!Klass::cast(defc_klass)->oop_is_instance()) {
|
if (!defc_klass->oop_is_instance()) {
|
||||||
if (!Klass::cast(defc_klass)->oop_is_array()) return empty;
|
if (!defc_klass->oop_is_array()) return empty;
|
||||||
defc_klass = SystemDictionary::Object_klass();
|
defc_klass = SystemDictionary::Object_klass();
|
||||||
}
|
}
|
||||||
defc = instanceKlassHandle(THREAD, defc_klass);
|
defc = instanceKlassHandle(THREAD, defc_klass);
|
||||||
|
@ -767,7 +767,7 @@ void MethodHandles::expand_MemberName(Handle mname, int suppress, TRAPS) {
|
||||||
{
|
{
|
||||||
// This is taken from LinkResolver::resolve_field, sans access checks.
|
// This is taken from LinkResolver::resolve_field, sans access checks.
|
||||||
assert(vmtarget->is_klass(), "field vmtarget is Klass*");
|
assert(vmtarget->is_klass(), "field vmtarget is Klass*");
|
||||||
if (!Klass::cast((Klass*) vmtarget)->oop_is_instance()) break;
|
if (!((Klass*) vmtarget)->oop_is_instance()) break;
|
||||||
instanceKlassHandle defc(THREAD, (Klass*) vmtarget);
|
instanceKlassHandle defc(THREAD, (Klass*) vmtarget);
|
||||||
DEBUG_ONLY(vmtarget = NULL); // safety
|
DEBUG_ONLY(vmtarget = NULL); // safety
|
||||||
bool is_static = ((flags & JVM_ACC_STATIC) != 0);
|
bool is_static = ((flags & JVM_ACC_STATIC) != 0);
|
||||||
|
@ -805,7 +805,7 @@ int MethodHandles::find_MemberNames(Klass* k,
|
||||||
|
|
||||||
// %%% take caller into account!
|
// %%% take caller into account!
|
||||||
|
|
||||||
if (k == NULL || !Klass::cast(k)->oop_is_instance()) return -1;
|
if (k == NULL || !k->oop_is_instance()) return -1;
|
||||||
|
|
||||||
int rfill = 0, rlimit = results->length(), rskip = skip;
|
int rfill = 0, rlimit = results->length(), rskip = skip;
|
||||||
// overflow measurement:
|
// overflow measurement:
|
||||||
|
@ -1032,7 +1032,7 @@ JVM_ENTRY(jobject, MHN_resolve_Mem(JNIEnv *env, jobject igcls, jobject mname_jh,
|
||||||
if (!Reflection::verify_class_access(caller,
|
if (!Reflection::verify_class_access(caller,
|
||||||
reference_klass,
|
reference_klass,
|
||||||
true)) {
|
true)) {
|
||||||
THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), Klass::cast(reference_klass)->external_name());
|
THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), reference_klass->external_name());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1108,7 +1108,7 @@ JVM_ENTRY(jobject, MHN_getMemberVMInfo(JNIEnv *env, jobject igcls, jobject mname
|
||||||
if (vmtarget == NULL) {
|
if (vmtarget == NULL) {
|
||||||
x = NULL;
|
x = NULL;
|
||||||
} else if (vmtarget->is_klass()) {
|
} else if (vmtarget->is_klass()) {
|
||||||
x = Klass::cast((Klass*) vmtarget)->java_mirror();
|
x = ((Klass*) vmtarget)->java_mirror();
|
||||||
} else if (vmtarget->is_method()) {
|
} else if (vmtarget->is_method()) {
|
||||||
Handle mname2 = MethodHandles::new_MemberName(CHECK_NULL);
|
Handle mname2 = MethodHandles::new_MemberName(CHECK_NULL);
|
||||||
x = MethodHandles::init_method_MemberName(mname2(), (Method*)vmtarget, false, NULL);
|
x = MethodHandles::init_method_MemberName(mname2(), (Method*)vmtarget, false, NULL);
|
||||||
|
@ -1237,7 +1237,7 @@ JVM_ENTRY(void, JVM_RegisterMethodHandleMethods(JNIEnv *env, jclass MHN_class))
|
||||||
if (SystemDictionary::MethodHandle_klass() == NULL) {
|
if (SystemDictionary::MethodHandle_klass() == NULL) {
|
||||||
enable_MH = false;
|
enable_MH = false;
|
||||||
} else {
|
} else {
|
||||||
oop mirror = Klass::cast(SystemDictionary::MethodHandle_klass())->java_mirror();
|
oop mirror = SystemDictionary::MethodHandle_klass()->java_mirror();
|
||||||
MH_class = (jclass) JNIHandles::make_local(env, mirror);
|
MH_class = (jclass) JNIHandles::make_local(env, mirror);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -349,7 +349,7 @@ address NativeLookup::lookup_entry_prefixed(methodHandle method, bool& in_base_l
|
||||||
TempNewSymbol wrapper_symbol = SymbolTable::probe(wrapper_name, wrapper_name_len);
|
TempNewSymbol wrapper_symbol = SymbolTable::probe(wrapper_name, wrapper_name_len);
|
||||||
if (wrapper_symbol != NULL) {
|
if (wrapper_symbol != NULL) {
|
||||||
KlassHandle kh(method->method_holder());
|
KlassHandle kh(method->method_holder());
|
||||||
Method* wrapper_method = Klass::cast(kh())->lookup_method(wrapper_symbol,
|
Method* wrapper_method = kh()->lookup_method(wrapper_symbol,
|
||||||
method->signature());
|
method->signature());
|
||||||
if (wrapper_method != NULL && !wrapper_method->is_native()) {
|
if (wrapper_method != NULL && !wrapper_method->is_native()) {
|
||||||
// we found a wrapper method, use its native entry
|
// we found a wrapper method, use its native entry
|
||||||
|
|
|
@ -771,7 +771,7 @@ UNSAFE_ENTRY(void, Unsafe_EnsureClassInitialized(JNIEnv *env, jobject unsafe, jo
|
||||||
oop mirror = JNIHandles::resolve_non_null(clazz);
|
oop mirror = JNIHandles::resolve_non_null(clazz);
|
||||||
|
|
||||||
Klass* klass = java_lang_Class::as_Klass(mirror);
|
Klass* klass = java_lang_Class::as_Klass(mirror);
|
||||||
if (klass != NULL && Klass::cast(klass)->should_be_initialized()) {
|
if (klass != NULL && klass->should_be_initialized()) {
|
||||||
InstanceKlass* k = InstanceKlass::cast(klass);
|
InstanceKlass* k = InstanceKlass::cast(klass);
|
||||||
k->initialize(CHECK);
|
k->initialize(CHECK);
|
||||||
}
|
}
|
||||||
|
@ -785,7 +785,7 @@ UNSAFE_ENTRY(jboolean, Unsafe_ShouldBeInitialized(JNIEnv *env, jobject unsafe, j
|
||||||
}
|
}
|
||||||
oop mirror = JNIHandles::resolve_non_null(clazz);
|
oop mirror = JNIHandles::resolve_non_null(clazz);
|
||||||
Klass* klass = java_lang_Class::as_Klass(mirror);
|
Klass* klass = java_lang_Class::as_Klass(mirror);
|
||||||
if (klass != NULL && Klass::cast(klass)->should_be_initialized()) {
|
if (klass != NULL && klass->should_be_initialized()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -39,7 +39,7 @@ static GrowableArray<Handle>* _preserved_oop_stack = NULL;
|
||||||
static GrowableArray<markOop>* _preserved_mark_stack = NULL;
|
static GrowableArray<markOop>* _preserved_mark_stack = NULL;
|
||||||
|
|
||||||
static void enable_biased_locking(Klass* k) {
|
static void enable_biased_locking(Klass* k) {
|
||||||
Klass::cast(k)->set_prototype_header(markOopDesc::biased_locking_prototype());
|
k->set_prototype_header(markOopDesc::biased_locking_prototype());
|
||||||
}
|
}
|
||||||
|
|
||||||
class VM_EnableBiasedLocking: public VM_Operation {
|
class VM_EnableBiasedLocking: public VM_Operation {
|
||||||
|
@ -149,7 +149,7 @@ static BiasedLocking::Condition revoke_bias(oop obj, bool allow_rebias, bool is_
|
||||||
if (TraceBiasedLocking) {
|
if (TraceBiasedLocking) {
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
tty->print_cr(" (Skipping revocation of object of type %s because it's no longer biased)",
|
tty->print_cr(" (Skipping revocation of object of type %s because it's no longer biased)",
|
||||||
Klass::cast(obj->klass())->external_name());
|
obj->klass()->external_name());
|
||||||
}
|
}
|
||||||
return BiasedLocking::NOT_BIASED;
|
return BiasedLocking::NOT_BIASED;
|
||||||
}
|
}
|
||||||
|
@ -161,7 +161,7 @@ static BiasedLocking::Condition revoke_bias(oop obj, bool allow_rebias, bool is_
|
||||||
if (TraceBiasedLocking && (Verbose || !is_bulk)) {
|
if (TraceBiasedLocking && (Verbose || !is_bulk)) {
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
tty->print_cr("Revoking bias of object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s , prototype header " INTPTR_FORMAT " , allow rebias %d , requesting thread " INTPTR_FORMAT,
|
tty->print_cr("Revoking bias of object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s , prototype header " INTPTR_FORMAT " , allow rebias %d , requesting thread " INTPTR_FORMAT,
|
||||||
(intptr_t) obj, (intptr_t) mark, Klass::cast(obj->klass())->external_name(), (intptr_t) Klass::cast(obj->klass())->prototype_header(), (allow_rebias ? 1 : 0), (intptr_t) requesting_thread);
|
(intptr_t) obj, (intptr_t) mark, obj->klass()->external_name(), (intptr_t) obj->klass()->prototype_header(), (allow_rebias ? 1 : 0), (intptr_t) requesting_thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
JavaThread* biased_thread = mark->biased_locker();
|
JavaThread* biased_thread = mark->biased_locker();
|
||||||
|
@ -326,7 +326,7 @@ static BiasedLocking::Condition bulk_revoke_or_rebias_at_safepoint(oop o,
|
||||||
tty->print_cr("* Beginning bulk revocation (kind == %s) because of object "
|
tty->print_cr("* Beginning bulk revocation (kind == %s) because of object "
|
||||||
INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s",
|
INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s",
|
||||||
(bulk_rebias ? "rebias" : "revoke"),
|
(bulk_rebias ? "rebias" : "revoke"),
|
||||||
(intptr_t) o, (intptr_t) o->mark(), Klass::cast(o->klass())->external_name());
|
(intptr_t) o, (intptr_t) o->mark(), o->klass()->external_name());
|
||||||
}
|
}
|
||||||
|
|
||||||
jlong cur_time = os::javaTimeMillis();
|
jlong cur_time = os::javaTimeMillis();
|
||||||
|
@ -334,7 +334,7 @@ static BiasedLocking::Condition bulk_revoke_or_rebias_at_safepoint(oop o,
|
||||||
|
|
||||||
|
|
||||||
Klass* k_o = o->klass();
|
Klass* k_o = o->klass();
|
||||||
Klass* klass = Klass::cast(k_o);
|
Klass* klass = k_o;
|
||||||
|
|
||||||
if (bulk_rebias) {
|
if (bulk_rebias) {
|
||||||
// Use the epoch in the klass of the object to implicitly revoke
|
// Use the epoch in the klass of the object to implicitly revoke
|
||||||
|
@ -546,7 +546,7 @@ BiasedLocking::Condition BiasedLocking::revoke_and_rebias(Handle obj, bool attem
|
||||||
return BIAS_REVOKED;
|
return BIAS_REVOKED;
|
||||||
}
|
}
|
||||||
} else if (mark->has_bias_pattern()) {
|
} else if (mark->has_bias_pattern()) {
|
||||||
Klass* k = Klass::cast(obj->klass());
|
Klass* k = obj->klass();
|
||||||
markOop prototype_header = k->prototype_header();
|
markOop prototype_header = k->prototype_header();
|
||||||
if (!prototype_header->has_bias_pattern()) {
|
if (!prototype_header->has_bias_pattern()) {
|
||||||
// This object has a stale bias from before the bulk revocation
|
// This object has a stale bias from before the bulk revocation
|
||||||
|
@ -590,7 +590,7 @@ BiasedLocking::Condition BiasedLocking::revoke_and_rebias(Handle obj, bool attem
|
||||||
if (heuristics == HR_NOT_BIASED) {
|
if (heuristics == HR_NOT_BIASED) {
|
||||||
return NOT_BIASED;
|
return NOT_BIASED;
|
||||||
} else if (heuristics == HR_SINGLE_REVOKE) {
|
} else if (heuristics == HR_SINGLE_REVOKE) {
|
||||||
Klass *k = Klass::cast(obj->klass());
|
Klass *k = obj->klass();
|
||||||
markOop prototype_header = k->prototype_header();
|
markOop prototype_header = k->prototype_header();
|
||||||
if (mark->biased_locker() == THREAD &&
|
if (mark->biased_locker() == THREAD &&
|
||||||
prototype_header->bias_epoch() == mark->bias_epoch()) {
|
prototype_header->bias_epoch() == mark->bias_epoch()) {
|
||||||
|
|
|
@ -70,8 +70,8 @@ static void trace_class_resolution(Klass* to_class) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (caller != NULL) {
|
if (caller != NULL) {
|
||||||
const char * from = Klass::cast(caller)->external_name();
|
const char * from = caller->external_name();
|
||||||
const char * to = Klass::cast(to_class)->external_name();
|
const char * to = to_class->external_name();
|
||||||
// print in a single call to reduce interleaving between threads
|
// print in a single call to reduce interleaving between threads
|
||||||
if (source_file != NULL) {
|
if (source_file != NULL) {
|
||||||
tty->print("RESOLVE %s %s %s:%d (reflection)\n", from, to, source_file, line_number);
|
tty->print("RESOLVE %s %s %s:%d (reflection)\n", from, to, source_file, line_number);
|
||||||
|
@ -330,7 +330,7 @@ arrayOop Reflection::reflect_new_array(oop element_mirror, jint length, TRAPS) {
|
||||||
return TypeArrayKlass::cast(tak)->allocate(length, THREAD);
|
return TypeArrayKlass::cast(tak)->allocate(length, THREAD);
|
||||||
} else {
|
} else {
|
||||||
Klass* k = java_lang_Class::as_Klass(element_mirror);
|
Klass* k = java_lang_Class::as_Klass(element_mirror);
|
||||||
if (Klass::cast(k)->oop_is_array() && ArrayKlass::cast(k)->dimension() >= MAX_DIM) {
|
if (k->oop_is_array() && ArrayKlass::cast(k)->dimension() >= MAX_DIM) {
|
||||||
THROW_0(vmSymbols::java_lang_IllegalArgumentException());
|
THROW_0(vmSymbols::java_lang_IllegalArgumentException());
|
||||||
}
|
}
|
||||||
return oopFactory::new_objArray(k, length, THREAD);
|
return oopFactory::new_objArray(k, length, THREAD);
|
||||||
|
@ -366,7 +366,7 @@ arrayOop Reflection::reflect_new_multi_array(oop element_mirror, typeArrayOop di
|
||||||
klass = basic_type_mirror_to_arrayklass(element_mirror, CHECK_NULL);
|
klass = basic_type_mirror_to_arrayklass(element_mirror, CHECK_NULL);
|
||||||
} else {
|
} else {
|
||||||
klass = java_lang_Class::as_Klass(element_mirror);
|
klass = java_lang_Class::as_Klass(element_mirror);
|
||||||
if (Klass::cast(klass)->oop_is_array()) {
|
if (klass->oop_is_array()) {
|
||||||
int k_dim = ArrayKlass::cast(klass)->dimension();
|
int k_dim = ArrayKlass::cast(klass)->dimension();
|
||||||
if (k_dim + len > MAX_DIM) {
|
if (k_dim + len > MAX_DIM) {
|
||||||
THROW_0(vmSymbols::java_lang_IllegalArgumentException());
|
THROW_0(vmSymbols::java_lang_IllegalArgumentException());
|
||||||
|
@ -374,7 +374,7 @@ arrayOop Reflection::reflect_new_multi_array(oop element_mirror, typeArrayOop di
|
||||||
dim += k_dim;
|
dim += k_dim;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
klass = Klass::cast(klass)->array_klass(dim, CHECK_NULL);
|
klass = klass->array_klass(dim, CHECK_NULL);
|
||||||
oop obj = ArrayKlass::cast(klass)->multi_allocate(len, dimensions, THREAD);
|
oop obj = ArrayKlass::cast(klass)->multi_allocate(len, dimensions, THREAD);
|
||||||
assert(obj->is_array(), "just checking");
|
assert(obj->is_array(), "just checking");
|
||||||
return arrayOop(obj);
|
return arrayOop(obj);
|
||||||
|
@ -387,7 +387,7 @@ oop Reflection::array_component_type(oop mirror, TRAPS) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Klass* klass = java_lang_Class::as_Klass(mirror);
|
Klass* klass = java_lang_Class::as_Klass(mirror);
|
||||||
if (!Klass::cast(klass)->oop_is_array()) {
|
if (!klass->oop_is_array()) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -395,15 +395,15 @@ oop Reflection::array_component_type(oop mirror, TRAPS) {
|
||||||
#ifdef ASSERT
|
#ifdef ASSERT
|
||||||
oop result2 = NULL;
|
oop result2 = NULL;
|
||||||
if (ArrayKlass::cast(klass)->dimension() == 1) {
|
if (ArrayKlass::cast(klass)->dimension() == 1) {
|
||||||
if (Klass::cast(klass)->oop_is_typeArray()) {
|
if (klass->oop_is_typeArray()) {
|
||||||
result2 = basic_type_arrayklass_to_mirror(klass, CHECK_NULL);
|
result2 = basic_type_arrayklass_to_mirror(klass, CHECK_NULL);
|
||||||
} else {
|
} else {
|
||||||
result2 = Klass::cast(ObjArrayKlass::cast(klass)->element_klass())->java_mirror();
|
result2 = ObjArrayKlass::cast(klass)->element_klass()->java_mirror();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Klass* lower_dim = ArrayKlass::cast(klass)->lower_dimension();
|
Klass* lower_dim = ArrayKlass::cast(klass)->lower_dimension();
|
||||||
assert(Klass::cast(lower_dim)->oop_is_array(), "just checking");
|
assert(lower_dim->oop_is_array(), "just checking");
|
||||||
result2 = Klass::cast(lower_dim)->java_mirror();
|
result2 = lower_dim->java_mirror();
|
||||||
}
|
}
|
||||||
assert(result == result2, "results must be consistent");
|
assert(result == result2, "results must be consistent");
|
||||||
#endif //ASSERT
|
#endif //ASSERT
|
||||||
|
@ -442,7 +442,7 @@ bool Reflection::reflect_check_access(Klass* field_class, AccessFlags acc, Klass
|
||||||
if (acc.is_protected()) {
|
if (acc.is_protected()) {
|
||||||
if (target_class != client_class) {
|
if (target_class != client_class) {
|
||||||
if (!is_same_class_package(client_class, field_class)) {
|
if (!is_same_class_package(client_class, field_class)) {
|
||||||
if (!Klass::cast(target_class)->is_subclass_of(client_class)) {
|
if (!target_class->is_subclass_of(client_class)) {
|
||||||
THROW_(vmSymbols::java_lang_IllegalAccessException(), false);
|
THROW_(vmSymbols::java_lang_IllegalAccessException(), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -468,7 +468,7 @@ bool Reflection::verify_class_access(Klass* current_class, Klass* new_class, boo
|
||||||
// sun/reflect/MagicAccessorImpl subclasses to succeed trivially.
|
// sun/reflect/MagicAccessorImpl subclasses to succeed trivially.
|
||||||
if ( JDK_Version::is_gte_jdk14x_version()
|
if ( JDK_Version::is_gte_jdk14x_version()
|
||||||
&& UseNewReflection
|
&& UseNewReflection
|
||||||
&& Klass::cast(current_class)->is_subclass_of(SystemDictionary::reflect_MagicAccessorImpl_klass())) {
|
&& current_class->is_subclass_of(SystemDictionary::reflect_MagicAccessorImpl_klass())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -546,12 +546,12 @@ bool Reflection::verify_field_access(Klass* current_class,
|
||||||
if (access.is_protected()) {
|
if (access.is_protected()) {
|
||||||
if (!protected_restriction) {
|
if (!protected_restriction) {
|
||||||
// See if current_class is a subclass of field_class
|
// See if current_class is a subclass of field_class
|
||||||
if (Klass::cast(current_class)->is_subclass_of(field_class)) {
|
if (current_class->is_subclass_of(field_class)) {
|
||||||
if (access.is_static() || // static fields are ok, see 6622385
|
if (access.is_static() || // static fields are ok, see 6622385
|
||||||
current_class == resolved_class ||
|
current_class == resolved_class ||
|
||||||
field_class == resolved_class ||
|
field_class == resolved_class ||
|
||||||
Klass::cast(current_class)->is_subclass_of(resolved_class) ||
|
current_class->is_subclass_of(resolved_class) ||
|
||||||
Klass::cast(resolved_class)->is_subclass_of(current_class)) {
|
resolved_class->is_subclass_of(current_class)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -566,7 +566,7 @@ bool Reflection::verify_field_access(Klass* current_class,
|
||||||
// sun/reflect/MagicAccessorImpl subclasses to succeed trivially.
|
// sun/reflect/MagicAccessorImpl subclasses to succeed trivially.
|
||||||
if ( JDK_Version::is_gte_jdk14x_version()
|
if ( JDK_Version::is_gte_jdk14x_version()
|
||||||
&& UseNewReflection
|
&& UseNewReflection
|
||||||
&& Klass::cast(current_class)->is_subclass_of(SystemDictionary::reflect_MagicAccessorImpl_klass())) {
|
&& current_class->is_subclass_of(SystemDictionary::reflect_MagicAccessorImpl_klass())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -693,7 +693,7 @@ Handle Reflection::new_type(Symbol* signature, KlassHandle k, TRAPS) {
|
||||||
}
|
}
|
||||||
|
|
||||||
oop loader = InstanceKlass::cast(k())->class_loader();
|
oop loader = InstanceKlass::cast(k())->class_loader();
|
||||||
oop protection_domain = Klass::cast(k())->protection_domain();
|
oop protection_domain = k()->protection_domain();
|
||||||
Klass* result = SystemDictionary::resolve_or_fail(signature,
|
Klass* result = SystemDictionary::resolve_or_fail(signature,
|
||||||
Handle(THREAD, loader),
|
Handle(THREAD, loader),
|
||||||
Handle(THREAD, protection_domain),
|
Handle(THREAD, protection_domain),
|
||||||
|
@ -703,7 +703,7 @@ Handle Reflection::new_type(Symbol* signature, KlassHandle k, TRAPS) {
|
||||||
trace_class_resolution(result);
|
trace_class_resolution(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
oop nt = Klass::cast(result)->java_mirror();
|
oop nt = result->java_mirror();
|
||||||
return Handle(THREAD, nt);
|
return Handle(THREAD, nt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -937,7 +937,7 @@ oop Reflection::invoke(instanceKlassHandle klass, methodHandle reflected_method,
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
Handle h_origexception = Exceptions::new_exception(THREAD,
|
Handle h_origexception = Exceptions::new_exception(THREAD,
|
||||||
vmSymbols::java_lang_AbstractMethodError(),
|
vmSymbols::java_lang_AbstractMethodError(),
|
||||||
Method::name_and_sig_as_C_string(Klass::cast(target_klass()),
|
Method::name_and_sig_as_C_string(target_klass(),
|
||||||
method->name(),
|
method->name(),
|
||||||
method->signature()));
|
method->signature()));
|
||||||
JavaCallArguments args(h_origexception);
|
JavaCallArguments args(h_origexception);
|
||||||
|
@ -947,7 +947,7 @@ oop Reflection::invoke(instanceKlassHandle klass, methodHandle reflected_method,
|
||||||
} else {
|
} else {
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
THROW_MSG_0(vmSymbols::java_lang_AbstractMethodError(),
|
THROW_MSG_0(vmSymbols::java_lang_AbstractMethodError(),
|
||||||
Method::name_and_sig_as_C_string(Klass::cast(target_klass()),
|
Method::name_and_sig_as_C_string(target_klass(),
|
||||||
method->name(),
|
method->name(),
|
||||||
method->signature()));
|
method->signature()));
|
||||||
}
|
}
|
||||||
|
@ -962,7 +962,7 @@ oop Reflection::invoke(instanceKlassHandle klass, methodHandle reflected_method,
|
||||||
if (method.is_null()) {
|
if (method.is_null()) {
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
THROW_MSG_0(vmSymbols::java_lang_NoSuchMethodError(),
|
THROW_MSG_0(vmSymbols::java_lang_NoSuchMethodError(),
|
||||||
Method::name_and_sig_as_C_string(Klass::cast(klass()),
|
Method::name_and_sig_as_C_string(klass(),
|
||||||
reflected_method->name(),
|
reflected_method->name(),
|
||||||
reflected_method->signature()));
|
reflected_method->signature()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1775,7 +1775,7 @@ JRT_ENTRY(void, SharedRuntime::slow_arraycopy_C(oopDesc* src, jint src_pos,
|
||||||
// The copy_array mechanism is awkward and could be removed, but
|
// The copy_array mechanism is awkward and could be removed, but
|
||||||
// the compilers don't call this function except as a last resort,
|
// the compilers don't call this function except as a last resort,
|
||||||
// so it probably doesn't matter.
|
// so it probably doesn't matter.
|
||||||
Klass::cast(src->klass())->copy_array((arrayOopDesc*)src, src_pos,
|
src->klass()->copy_array((arrayOopDesc*)src, src_pos,
|
||||||
(arrayOopDesc*)dest, dest_pos,
|
(arrayOopDesc*)dest, dest_pos,
|
||||||
length, thread);
|
length, thread);
|
||||||
}
|
}
|
||||||
|
@ -1788,8 +1788,8 @@ char* SharedRuntime::generate_class_cast_message(
|
||||||
vframeStream vfst(thread, true);
|
vframeStream vfst(thread, true);
|
||||||
assert(!vfst.at_end(), "Java frame must exist");
|
assert(!vfst.at_end(), "Java frame must exist");
|
||||||
Bytecode_checkcast cc(vfst.method(), vfst.method()->bcp_from(vfst.bci()));
|
Bytecode_checkcast cc(vfst.method(), vfst.method()->bcp_from(vfst.bci()));
|
||||||
Klass* targetKlass = Klass::cast(vfst.method()->constants()->klass_at(
|
Klass* targetKlass = vfst.method()->constants()->klass_at(
|
||||||
cc.index(), thread));
|
cc.index(), thread);
|
||||||
return generate_class_cast_message(objName, targetKlass->external_name());
|
return generate_class_cast_message(objName, targetKlass->external_name());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -354,7 +354,7 @@ oop SignatureStream::as_java_mirror(Handle class_loader, Handle protection_domai
|
||||||
return Universe::java_mirror(type());
|
return Universe::java_mirror(type());
|
||||||
Klass* klass = as_klass(class_loader, protection_domain, failure_mode, CHECK_NULL);
|
Klass* klass = as_klass(class_loader, protection_domain, failure_mode, CHECK_NULL);
|
||||||
if (klass == NULL) return NULL;
|
if (klass == NULL) return NULL;
|
||||||
return Klass::cast(klass)->java_mirror();
|
return klass->java_mirror();
|
||||||
}
|
}
|
||||||
|
|
||||||
Symbol* SignatureStream::as_symbol_or_null() {
|
Symbol* SignatureStream::as_symbol_or_null() {
|
||||||
|
|
|
@ -1323,7 +1323,7 @@ ObjectMonitor * ATTR ObjectSynchronizer::inflate (Thread * Self, oop object) {
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
tty->print_cr("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s",
|
tty->print_cr("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s",
|
||||||
(intptr_t) object, (intptr_t) object->mark(),
|
(intptr_t) object, (intptr_t) object->mark(),
|
||||||
Klass::cast(object->klass())->external_name());
|
object->klass()->external_name());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return m ;
|
return m ;
|
||||||
|
@ -1373,7 +1373,7 @@ ObjectMonitor * ATTR ObjectSynchronizer::inflate (Thread * Self, oop object) {
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
tty->print_cr("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s",
|
tty->print_cr("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s",
|
||||||
(intptr_t) object, (intptr_t) object->mark(),
|
(intptr_t) object, (intptr_t) object->mark(),
|
||||||
Klass::cast(object->klass())->external_name());
|
object->klass()->external_name());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return m ;
|
return m ;
|
||||||
|
@ -1440,7 +1440,7 @@ bool ObjectSynchronizer::deflate_monitor(ObjectMonitor* mid, oop obj,
|
||||||
if (obj->is_instance()) {
|
if (obj->is_instance()) {
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
tty->print_cr("Deflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s",
|
tty->print_cr("Deflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s",
|
||||||
(intptr_t) obj, (intptr_t) obj->mark(), Klass::cast(obj->klass())->external_name());
|
(intptr_t) obj, (intptr_t) obj->mark(), obj->klass()->external_name());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1785,7 +1785,7 @@ void JavaThread::exit(bool destroy_vm, ExitType exit_type) {
|
||||||
jio_fprintf(defaultStream::error_stream(),
|
jio_fprintf(defaultStream::error_stream(),
|
||||||
"\nException: %s thrown from the UncaughtExceptionHandler"
|
"\nException: %s thrown from the UncaughtExceptionHandler"
|
||||||
" in thread \"%s\"\n",
|
" in thread \"%s\"\n",
|
||||||
Klass::cast(pending_exception()->klass())->external_name(),
|
pending_exception()->klass()->external_name(),
|
||||||
get_thread_name());
|
get_thread_name());
|
||||||
CLEAR_PENDING_EXCEPTION;
|
CLEAR_PENDING_EXCEPTION;
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,7 +149,7 @@ static void print_locked_object_class_name(outputStream* st, Handle obj, const c
|
||||||
Klass* target_klass = java_lang_Class::as_Klass(obj());
|
Klass* target_klass = java_lang_Class::as_Klass(obj());
|
||||||
st->print_cr("(a java.lang.Class for %s)", InstanceKlass::cast(target_klass)->external_name());
|
st->print_cr("(a java.lang.Class for %s)", InstanceKlass::cast(target_klass)->external_name());
|
||||||
} else {
|
} else {
|
||||||
Klass* k = Klass::cast(obj->klass());
|
Klass* k = obj->klass();
|
||||||
st->print_cr("(a %s)", k->external_name());
|
st->print_cr("(a %s)", k->external_name());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -172,7 +172,7 @@ void javaVFrame::print_lock_info_on(outputStream* st, int frame_count) {
|
||||||
}
|
}
|
||||||
} else if (thread()->current_park_blocker() != NULL) {
|
} else if (thread()->current_park_blocker() != NULL) {
|
||||||
oop obj = thread()->current_park_blocker();
|
oop obj = thread()->current_park_blocker();
|
||||||
Klass* k = Klass::cast(obj->klass());
|
Klass* k = obj->klass();
|
||||||
st->print_cr("\t- %s <" INTPTR_FORMAT "> (a %s)", "parking to wait for ", (address)obj, k->external_name());
|
st->print_cr("\t- %s <" INTPTR_FORMAT "> (a %s)", "parking to wait for ", (address)obj, k->external_name());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -550,7 +550,7 @@ void javaVFrame::print_value() const {
|
||||||
InstanceKlass* k = m->method_holder();
|
InstanceKlass* k = m->method_holder();
|
||||||
tty->print_cr("frame( sp=" INTPTR_FORMAT ", unextended_sp=" INTPTR_FORMAT ", fp=" INTPTR_FORMAT ", pc=" INTPTR_FORMAT ")",
|
tty->print_cr("frame( sp=" INTPTR_FORMAT ", unextended_sp=" INTPTR_FORMAT ", fp=" INTPTR_FORMAT ", pc=" INTPTR_FORMAT ")",
|
||||||
_fr.sp(), _fr.unextended_sp(), _fr.fp(), _fr.pc());
|
_fr.sp(), _fr.unextended_sp(), _fr.fp(), _fr.pc());
|
||||||
tty->print("%s.%s", Klass::cast(k)->internal_name(), m->name()->as_C_string());
|
tty->print("%s.%s", k->internal_name(), m->name()->as_C_string());
|
||||||
|
|
||||||
if (!m->is_native()) {
|
if (!m->is_native()) {
|
||||||
Symbol* source_name = k->source_file_name();
|
Symbol* source_name = k->source_file_name();
|
||||||
|
|
|
@ -135,7 +135,7 @@ public:
|
||||||
// The spec is unclear at this point to count array klasses or not
|
// The spec is unclear at this point to count array klasses or not
|
||||||
// and also indirect creation of array of super class and secondaries
|
// and also indirect creation of array of super class and secondaries
|
||||||
//
|
//
|
||||||
// for (Klass* l = k; l != NULL; l = Klass::cast(l)->array_klass_or_null()) {
|
// for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) {
|
||||||
// KlassHandle h(_current_thread, l);
|
// KlassHandle h(_current_thread, l);
|
||||||
// _loaded_classes->append(h);
|
// _loaded_classes->append(h);
|
||||||
// }
|
// }
|
||||||
|
|
|
@ -879,7 +879,7 @@ void DumperSupport::dump_instance(DumpWriter* writer, oop o) {
|
||||||
writer->write_u4(STACK_TRACE_ID);
|
writer->write_u4(STACK_TRACE_ID);
|
||||||
|
|
||||||
// class ID
|
// class ID
|
||||||
writer->write_classID(Klass::cast(k));
|
writer->write_classID(k);
|
||||||
|
|
||||||
// number of bytes that follow
|
// number of bytes that follow
|
||||||
writer->write_u4(instance_size(k) );
|
writer->write_u4(instance_size(k) );
|
||||||
|
@ -891,7 +891,7 @@ void DumperSupport::dump_instance(DumpWriter* writer, oop o) {
|
||||||
// creates HPROF_GC_CLASS_DUMP record for the given class and each of
|
// creates HPROF_GC_CLASS_DUMP record for the given class and each of
|
||||||
// its array classes
|
// its array classes
|
||||||
void DumperSupport::dump_class_and_array_classes(DumpWriter* writer, Klass* k) {
|
void DumperSupport::dump_class_and_array_classes(DumpWriter* writer, Klass* k) {
|
||||||
Klass* klass = Klass::cast(k);
|
Klass* klass = k;
|
||||||
assert(klass->oop_is_instance(), "not an InstanceKlass");
|
assert(klass->oop_is_instance(), "not an InstanceKlass");
|
||||||
InstanceKlass* ik = (InstanceKlass*)klass;
|
InstanceKlass* ik = (InstanceKlass*)klass;
|
||||||
|
|
||||||
|
@ -906,7 +906,7 @@ void DumperSupport::dump_class_and_array_classes(DumpWriter* writer, Klass* k) {
|
||||||
if (java_super == NULL) {
|
if (java_super == NULL) {
|
||||||
writer->write_objectID(oop(NULL));
|
writer->write_objectID(oop(NULL));
|
||||||
} else {
|
} else {
|
||||||
writer->write_classID(Klass::cast(java_super));
|
writer->write_classID(java_super);
|
||||||
}
|
}
|
||||||
|
|
||||||
writer->write_objectID(ik->class_loader());
|
writer->write_objectID(ik->class_loader());
|
||||||
|
@ -932,7 +932,7 @@ void DumperSupport::dump_class_and_array_classes(DumpWriter* writer, Klass* k) {
|
||||||
// array classes
|
// array classes
|
||||||
k = klass->array_klass_or_null();
|
k = klass->array_klass_or_null();
|
||||||
while (k != NULL) {
|
while (k != NULL) {
|
||||||
Klass* klass = Klass::cast(k);
|
Klass* klass = k;
|
||||||
assert(klass->oop_is_objArray(), "not an ObjArrayKlass");
|
assert(klass->oop_is_objArray(), "not an ObjArrayKlass");
|
||||||
|
|
||||||
writer->write_u1(HPROF_GC_CLASS_DUMP);
|
writer->write_u1(HPROF_GC_CLASS_DUMP);
|
||||||
|
@ -942,7 +942,7 @@ void DumperSupport::dump_class_and_array_classes(DumpWriter* writer, Klass* k) {
|
||||||
// super class of array classes is java.lang.Object
|
// super class of array classes is java.lang.Object
|
||||||
java_super = klass->java_super();
|
java_super = klass->java_super();
|
||||||
assert(java_super != NULL, "checking");
|
assert(java_super != NULL, "checking");
|
||||||
writer->write_classID(Klass::cast(java_super));
|
writer->write_classID(java_super);
|
||||||
|
|
||||||
writer->write_objectID(ik->class_loader());
|
writer->write_objectID(ik->class_loader());
|
||||||
writer->write_objectID(ik->signers());
|
writer->write_objectID(ik->signers());
|
||||||
|
@ -965,7 +965,7 @@ void DumperSupport::dump_class_and_array_classes(DumpWriter* writer, Klass* k) {
|
||||||
void DumperSupport::dump_basic_type_array_class(DumpWriter* writer, Klass* k) {
|
void DumperSupport::dump_basic_type_array_class(DumpWriter* writer, Klass* k) {
|
||||||
// array classes
|
// array classes
|
||||||
while (k != NULL) {
|
while (k != NULL) {
|
||||||
Klass* klass = Klass::cast(k);
|
Klass* klass = k;
|
||||||
|
|
||||||
writer->write_u1(HPROF_GC_CLASS_DUMP);
|
writer->write_u1(HPROF_GC_CLASS_DUMP);
|
||||||
writer->write_classID(klass);
|
writer->write_classID(klass);
|
||||||
|
@ -974,7 +974,7 @@ void DumperSupport::dump_basic_type_array_class(DumpWriter* writer, Klass* k) {
|
||||||
// super class of array classes is java.lang.Object
|
// super class of array classes is java.lang.Object
|
||||||
Klass* java_super = klass->java_super();
|
Klass* java_super = klass->java_super();
|
||||||
assert(java_super != NULL, "checking");
|
assert(java_super != NULL, "checking");
|
||||||
writer->write_classID(Klass::cast(java_super));
|
writer->write_classID(java_super);
|
||||||
|
|
||||||
writer->write_objectID(oop(NULL)); // loader
|
writer->write_objectID(oop(NULL)); // loader
|
||||||
writer->write_objectID(oop(NULL)); // signers
|
writer->write_objectID(oop(NULL)); // signers
|
||||||
|
@ -1001,7 +1001,7 @@ void DumperSupport::dump_object_array(DumpWriter* writer, objArrayOop array) {
|
||||||
writer->write_u4((u4)array->length());
|
writer->write_u4((u4)array->length());
|
||||||
|
|
||||||
// array class ID
|
// array class ID
|
||||||
writer->write_classID(Klass::cast(array->klass()));
|
writer->write_classID(array->klass());
|
||||||
|
|
||||||
// [id]* elements
|
// [id]* elements
|
||||||
for (int index=0; index<array->length(); index++) {
|
for (int index=0; index<array->length(); index++) {
|
||||||
|
@ -1525,7 +1525,7 @@ void VM_HeapDumper::do_load_class(Klass* k) {
|
||||||
writer()->write_u4(++class_serial_num);
|
writer()->write_u4(++class_serial_num);
|
||||||
|
|
||||||
// class ID
|
// class ID
|
||||||
Klass* klass = Klass::cast(k);
|
Klass* klass = k;
|
||||||
writer()->write_classID(klass);
|
writer()->write_classID(klass);
|
||||||
|
|
||||||
// add the Klass* and class serial number pair
|
// add the Klass* and class serial number pair
|
||||||
|
@ -1796,7 +1796,7 @@ void VM_HeapDumper::dump_stack_traces() {
|
||||||
// write fake frame that makes it look like the thread, which caused OOME,
|
// write fake frame that makes it look like the thread, which caused OOME,
|
||||||
// is in the OutOfMemoryError zero-parameter constructor
|
// is in the OutOfMemoryError zero-parameter constructor
|
||||||
if (thread == _oome_thread && _oome_constructor != NULL) {
|
if (thread == _oome_thread && _oome_constructor != NULL) {
|
||||||
int oome_serial_num = _klass_map->find(Klass::cast(_oome_constructor->method_holder()));
|
int oome_serial_num = _klass_map->find(_oome_constructor->method_holder());
|
||||||
// the class serial number starts from 1
|
// the class serial number starts from 1
|
||||||
assert(oome_serial_num > 0, "OutOfMemoryError class not found");
|
assert(oome_serial_num > 0, "OutOfMemoryError class not found");
|
||||||
DumperSupport::dump_stack_frame(writer(), ++frame_serial_num, oome_serial_num,
|
DumperSupport::dump_stack_frame(writer(), ++frame_serial_num, oome_serial_num,
|
||||||
|
@ -1806,7 +1806,7 @@ void VM_HeapDumper::dump_stack_traces() {
|
||||||
for (int j=0; j < depth; j++) {
|
for (int j=0; j < depth; j++) {
|
||||||
StackFrameInfo* frame = stack_trace->stack_frame_at(j);
|
StackFrameInfo* frame = stack_trace->stack_frame_at(j);
|
||||||
Method* m = frame->method();
|
Method* m = frame->method();
|
||||||
int class_serial_num = _klass_map->find(Klass::cast(m->method_holder()));
|
int class_serial_num = _klass_map->find(m->method_holder());
|
||||||
// the class serial number starts from 1
|
// the class serial number starts from 1
|
||||||
assert(class_serial_num > 0, "class not found");
|
assert(class_serial_num > 0, "class not found");
|
||||||
DumperSupport::dump_stack_frame(writer(), ++frame_serial_num, class_serial_num, m, frame->bci());
|
DumperSupport::dump_stack_frame(writer(), ++frame_serial_num, class_serial_num, m, frame->bci());
|
||||||
|
|
|
@ -1417,7 +1417,7 @@ JVM_ENTRY(jobjectArray, jmm_GetLoadedClasses(JNIEnv *env))
|
||||||
|
|
||||||
for (int i = 0; i < num_classes; i++) {
|
for (int i = 0; i < num_classes; i++) {
|
||||||
KlassHandle kh = lce.get_klass(i);
|
KlassHandle kh = lce.get_klass(i);
|
||||||
oop mirror = Klass::cast(kh())->java_mirror();
|
oop mirror = kh()->java_mirror();
|
||||||
classes_ah->obj_at_put(i, mirror);
|
classes_ah->obj_at_put(i, mirror);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,14 +57,13 @@ class ServiceUtil : public AllStatic {
|
||||||
if (k->is_klass()) {
|
if (k->is_klass()) {
|
||||||
// if it's a class for an object, an object array, or
|
// if it's a class for an object, an object array, or
|
||||||
// primitive (type) array then it's visible.
|
// primitive (type) array then it's visible.
|
||||||
Klass* klass = k;
|
if (k->oop_is_instance()) {
|
||||||
if (Klass::cast(klass)->oop_is_instance()) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (Klass::cast(klass)->oop_is_objArray()) {
|
if (k->oop_is_objArray()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (Klass::cast(klass)->oop_is_typeArray()) {
|
if (k->oop_is_typeArray()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue