Mercurial > hg > graal-compiler
diff src/share/vm/oops/method.hpp @ 6940:18fb7da42534
8000725: NPG: method_holder() and pool_holder() and pool_holder field should be InstanceKlass
Summary: Change types of above methods and field to InstanceKlass and remove unneeded casts from the source files.
Reviewed-by: dholmes, coleenp, zgu
Contributed-by: harold.seigel@oracle.com
author | coleenp |
---|---|
date | Tue, 06 Nov 2012 15:09:37 -0500 |
parents | 4735d2c84362 |
children | e522a00b91aa 59c790074993 b2dbd323c668 |
line wrap: on
line diff
--- a/src/share/vm/oops/method.hpp Thu Oct 04 14:55:57 2012 +0200 +++ b/src/share/vm/oops/method.hpp Tue Nov 06 15:09:37 2012 -0500 @@ -209,21 +209,21 @@ // annotations support AnnotationArray* annotations() const { - InstanceKlass* ik = InstanceKlass::cast(method_holder()); + InstanceKlass* ik = method_holder(); if (ik->annotations() == NULL) { return NULL; } return ik->annotations()->get_method_annotations_of(method_idnum()); } AnnotationArray* parameter_annotations() const { - InstanceKlass* ik = InstanceKlass::cast(method_holder()); + InstanceKlass* ik = method_holder(); if (ik->annotations() == NULL) { return NULL; } return ik->annotations()->get_method_parameter_annotations_of(method_idnum()); } AnnotationArray* annotation_default() const { - InstanceKlass* ik = InstanceKlass::cast(method_holder()); + InstanceKlass* ik = method_holder(); if (ik->annotations() == NULL) { return NULL; } @@ -496,7 +496,7 @@ { return constMethod()->compressed_linenumber_table(); } // method holder (the Klass* holding this method) - Klass* method_holder() const { return constants()->pool_holder(); } + InstanceKlass* method_holder() const { return constants()->pool_holder(); } void compute_size_of_parameters(Thread *thread); // word size of parameters (receiver if any + arguments) Symbol* klass_name() const; // returns the name of the method holder @@ -697,18 +697,18 @@ // Get this method's jmethodID -- allocate if it doesn't exist jmethodID jmethod_id() { methodHandle this_h(this); - return InstanceKlass::get_jmethod_id(InstanceKlass::cast(method_holder()), this_h); } + return InstanceKlass::get_jmethod_id(method_holder(), this_h); } // Lookup the jmethodID for this method. Return NULL if not found. // NOTE that this function can be called from a signal handler // (see AsyncGetCallTrace support for Forte Analyzer) and this // needs to be async-safe. No allocation should be done and // so handles are not used to avoid deadlock. - jmethodID find_jmethod_id_or_null() { return InstanceKlass::cast(method_holder())->jmethod_id_or_null(this); } + jmethodID find_jmethod_id_or_null() { return method_holder()->jmethod_id_or_null(this); } // JNI static invoke cached itable index accessors - int cached_itable_index() { return InstanceKlass::cast(method_holder())->cached_itable_index(method_idnum()); } - void set_cached_itable_index(int index) { InstanceKlass::cast(method_holder())->set_cached_itable_index(method_idnum(), index); } + int cached_itable_index() { return method_holder()->cached_itable_index(method_idnum()); } + void set_cached_itable_index(int index) { method_holder()->set_cached_itable_index(method_idnum(), index); } // Support for inlining of intrinsic methods vmIntrinsics::ID intrinsic_id() const { return (vmIntrinsics::ID) _intrinsic_id; } @@ -734,11 +734,11 @@ // On-stack replacement support bool has_osr_nmethod(int level, bool match_level) { - return InstanceKlass::cast(method_holder())->lookup_osr_nmethod(this, InvocationEntryBci, level, match_level) != NULL; + return method_holder()->lookup_osr_nmethod(this, InvocationEntryBci, level, match_level) != NULL; } nmethod* lookup_osr_nmethod_for(int bci, int level, bool match_level) { - return InstanceKlass::cast(method_holder())->lookup_osr_nmethod(this, bci, level, match_level); + return method_holder()->lookup_osr_nmethod(this, bci, level, match_level); } // Inline cache support