--- a/hotspot/src/share/vm/code/nmethod.hpp Fri Dec 04 16:38:04 2015 +0100
+++ b/hotspot/src/share/vm/code/nmethod.hpp Fri Dec 04 23:46:19 2015 +0300
@@ -392,6 +392,9 @@
int handler_table_size() const { return handler_table_end() - handler_table_begin(); }
int nul_chk_table_size() const { return nul_chk_table_end() - nul_chk_table_begin(); }
+ int oops_count() const { assert(oops_size() % oopSize == 0, ""); return (oops_size() / oopSize) + 1; }
+ int metadata_count() const { assert(metadata_size() % wordSize == 0, ""); return (metadata_size() / wordSize) + 1; }
+
int total_size () const;
void dec_hotness_counter() { _hotness_counter--; }
@@ -491,7 +494,7 @@
oop oop_at(int index) const { return index == 0 ? (oop) NULL: *oop_addr_at(index); }
oop* oop_addr_at(int index) const { // for GC
// relocation indexes are biased by 1 (because 0 is reserved)
- assert(index > 0 && index <= oops_size(), "must be a valid non-zero index");
+ assert(index > 0 && index <= oops_count(), "must be a valid non-zero index");
assert(!_oops_are_stale, "oops are stale");
return &oops_begin()[index - 1];
}
@@ -501,13 +504,15 @@
Metadata* metadata_at(int index) const { return index == 0 ? NULL: *metadata_addr_at(index); }
Metadata** metadata_addr_at(int index) const { // for GC
// relocation indexes are biased by 1 (because 0 is reserved)
- assert(index > 0 && index <= metadata_size(), "must be a valid non-zero index");
+ assert(index > 0 && index <= metadata_count(), "must be a valid non-zero index");
return &metadata_begin()[index - 1];
}
void copy_values(GrowableArray<jobject>* oops);
void copy_values(GrowableArray<Metadata*>* metadata);
+ Method* attached_method(address call_pc);
+
// Relocation support
private:
void fix_oop_relocations(address begin, address end, bool initialize_immediates);
@@ -696,6 +701,8 @@
void print_calls(outputStream* st) PRODUCT_RETURN;
void print_handler_table() PRODUCT_RETURN;
void print_nul_chk_table() PRODUCT_RETURN;
+ void print_recorded_oops() PRODUCT_RETURN;
+ void print_recorded_metadata() PRODUCT_RETURN;
void print_nmethod(bool print_code);
// need to re-define this from CodeBlob else the overload hides it