mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8000725: NPG: method_holder() and pool_holder() and pool_holder field should be InstanceKlass
Change types of above methods and field to InstanceKlass and remove unneeded casts from the source files. Reviewed-by: dholmes, coleenp, zgu
This commit is contained in:
parent
e1d995ab86
commit
7fee66f152
39 changed files with 176 additions and 179 deletions
|
@ -243,12 +243,12 @@ void Method::mask_for(int bci, InterpreterOopMap* mask) {
|
|||
warning("oopmap should only be accessed by the "
|
||||
"VM, GC task or CMS threads (or during debugging)");
|
||||
InterpreterOopMap local_mask;
|
||||
InstanceKlass::cast(method_holder())->mask_for(h_this, bci, &local_mask);
|
||||
method_holder()->mask_for(h_this, bci, &local_mask);
|
||||
local_mask.print();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
InstanceKlass::cast(method_holder())->mask_for(h_this, bci, mask);
|
||||
method_holder()->mask_for(h_this, bci, mask);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -523,7 +523,7 @@ bool Method::compute_has_loops_flag() {
|
|||
bool Method::is_final_method() const {
|
||||
// %%% Should return true for private methods also,
|
||||
// since there is no way to override them.
|
||||
return is_final() || Klass::cast(method_holder())->is_final();
|
||||
return is_final() || method_holder()->is_final();
|
||||
}
|
||||
|
||||
|
||||
|
@ -555,7 +555,7 @@ bool Method::is_initializer() const {
|
|||
|
||||
bool Method::has_valid_initializer_flags() const {
|
||||
return (is_static() ||
|
||||
InstanceKlass::cast(method_holder())->major_version() < 51);
|
||||
method_holder()->major_version() < 51);
|
||||
}
|
||||
|
||||
bool Method::is_static_initializer() const {
|
||||
|
@ -617,7 +617,7 @@ bool Method::is_klass_loaded_by_klass_index(int klass_index) const {
|
|||
if( constants()->tag_at(klass_index).is_unresolved_klass() ) {
|
||||
Thread *thread = Thread::current();
|
||||
Symbol* klass_name = constants()->klass_name_at(klass_index);
|
||||
Handle loader(thread, InstanceKlass::cast(method_holder())->class_loader());
|
||||
Handle loader(thread, method_holder()->class_loader());
|
||||
Handle prot (thread, Klass::cast(method_holder())->protection_domain());
|
||||
return SystemDictionary::find(klass_name, loader, prot, thread) != NULL;
|
||||
} else {
|
||||
|
@ -935,7 +935,7 @@ bool Method::is_overridden_in(Klass* k) const {
|
|||
|
||||
// If method is an interface, we skip it - except if it
|
||||
// is a miranda method
|
||||
if (InstanceKlass::cast(method_holder())->is_interface()) {
|
||||
if (method_holder()->is_interface()) {
|
||||
// Check that method is not a miranda method
|
||||
if (ik->lookup_method(name(), signature()) == NULL) {
|
||||
// No implementation exist - so miranda method
|
||||
|
@ -1020,7 +1020,7 @@ methodHandle Method::make_method_handle_intrinsic(vmIntrinsics::ID iid,
|
|||
ConstantPool* cp_oop = ConstantPool::allocate(loader_data, cp_length, CHECK_(empty));
|
||||
cp = constantPoolHandle(THREAD, cp_oop);
|
||||
}
|
||||
cp->set_pool_holder(holder());
|
||||
cp->set_pool_holder(InstanceKlass::cast(holder()));
|
||||
cp->symbol_at_put(_imcp_invoke_name, name);
|
||||
cp->symbol_at_put(_imcp_invoke_signature, signature);
|
||||
cp->set_preresolution();
|
||||
|
@ -1237,8 +1237,8 @@ bool Method::load_signature_classes(methodHandle m, TRAPS) {
|
|||
return false;
|
||||
}
|
||||
bool sig_is_loaded = true;
|
||||
Handle class_loader(THREAD, InstanceKlass::cast(m->method_holder())->class_loader());
|
||||
Handle protection_domain(THREAD, Klass::cast(m->method_holder())->protection_domain());
|
||||
Handle class_loader(THREAD, m->method_holder()->class_loader());
|
||||
Handle protection_domain(THREAD, m->method_holder()->protection_domain());
|
||||
ResourceMark rm(THREAD);
|
||||
Symbol* signature = m->signature();
|
||||
for(SignatureStream ss(signature); !ss.is_done(); ss.next()) {
|
||||
|
@ -1264,8 +1264,8 @@ bool Method::load_signature_classes(methodHandle m, TRAPS) {
|
|||
}
|
||||
|
||||
bool Method::has_unloaded_classes_in_signature(methodHandle m, TRAPS) {
|
||||
Handle class_loader(THREAD, InstanceKlass::cast(m->method_holder())->class_loader());
|
||||
Handle protection_domain(THREAD, Klass::cast(m->method_holder())->protection_domain());
|
||||
Handle class_loader(THREAD, m->method_holder()->class_loader());
|
||||
Handle protection_domain(THREAD, m->method_holder()->protection_domain());
|
||||
ResourceMark rm(THREAD);
|
||||
Symbol* signature = m->signature();
|
||||
for(SignatureStream ss(signature); !ss.is_done(); ss.next()) {
|
||||
|
@ -1472,7 +1472,7 @@ bool CompressedLineNumberReadStream::read_pair() {
|
|||
|
||||
|
||||
Bytecodes::Code Method::orig_bytecode_at(int bci) const {
|
||||
BreakpointInfo* bp = InstanceKlass::cast(method_holder())->breakpoints();
|
||||
BreakpointInfo* bp = method_holder()->breakpoints();
|
||||
for (; bp != NULL; bp = bp->next()) {
|
||||
if (bp->match(this, bci)) {
|
||||
return bp->orig_bytecode();
|
||||
|
@ -1484,7 +1484,7 @@ Bytecodes::Code Method::orig_bytecode_at(int bci) const {
|
|||
|
||||
void Method::set_orig_bytecode_at(int bci, Bytecodes::Code code) {
|
||||
assert(code != Bytecodes::_breakpoint, "cannot patch breakpoints this way");
|
||||
BreakpointInfo* bp = InstanceKlass::cast(method_holder())->breakpoints();
|
||||
BreakpointInfo* bp = method_holder()->breakpoints();
|
||||
for (; bp != NULL; bp = bp->next()) {
|
||||
if (bp->match(this, bci)) {
|
||||
bp->set_orig_bytecode(code);
|
||||
|
@ -1494,7 +1494,7 @@ void Method::set_orig_bytecode_at(int bci, Bytecodes::Code code) {
|
|||
}
|
||||
|
||||
void Method::set_breakpoint(int bci) {
|
||||
InstanceKlass* ik = InstanceKlass::cast(method_holder());
|
||||
InstanceKlass* ik = method_holder();
|
||||
BreakpointInfo *bp = new BreakpointInfo(this, bci);
|
||||
bp->set_next(ik->breakpoints());
|
||||
ik->set_breakpoints(bp);
|
||||
|
@ -1503,7 +1503,7 @@ void Method::set_breakpoint(int bci) {
|
|||
}
|
||||
|
||||
static void clear_matches(Method* m, int bci) {
|
||||
InstanceKlass* ik = InstanceKlass::cast(m->method_holder());
|
||||
InstanceKlass* ik = m->method_holder();
|
||||
BreakpointInfo* prev_bp = NULL;
|
||||
BreakpointInfo* next_bp;
|
||||
for (BreakpointInfo* bp = ik->breakpoints(); bp != NULL; bp = next_bp) {
|
||||
|
@ -1786,7 +1786,7 @@ void Method::change_method_associated_with_jmethod_id(jmethodID jmid, Method* ne
|
|||
bool Method::is_method_id(jmethodID mid) {
|
||||
Method* m = resolve_jmethod_id(mid);
|
||||
assert(m != NULL, "should be called with non-null method");
|
||||
InstanceKlass* ik = InstanceKlass::cast(m->method_holder());
|
||||
InstanceKlass* ik = m->method_holder();
|
||||
ClassLoaderData* cld = ik->class_loader_data();
|
||||
if (cld->jmethod_ids() == NULL) return false;
|
||||
return (cld->jmethod_ids()->contains((Method**)mid));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue