< prev index next >
src/hotspot/share/oops/method.cpp
Print this page
@@ -322,22 +322,25 @@
int extra_bytes = (is_native) ? 2*sizeof(address*) : 0;
int extra_words = align_up(extra_bytes, BytesPerWord) / BytesPerWord;
return align_metadata_size(header_size() + extra_words);
}
-
Symbol* Method::klass_name() const {
return method_holder()->name();
}
-
void Method::metaspace_pointers_do(MetaspaceClosure* it) {
log_trace(cds)("Iter(Method): %p", this);
it->push(&_constMethod);
it->push(&_method_data);
it->push(&_method_counters);
+
+ Method* this_ptr = this;
+ it->push_method_entry(&this_ptr, (intptr_t*)&_i2i_entry);
+ it->push_method_entry(&this_ptr, (intptr_t*)&_from_compiled_entry);
+ it->push_method_entry(&this_ptr, (intptr_t*)&_from_interpreted_entry);
}
// Attempt to return method oop to original state. Clear any pointers
// (to objects outside the shared spaces). We won't be able to predict
// where they should point in a new JVM. Further initialize some
@@ -1663,16 +1666,19 @@
return a->name()->fast_compare(b->name());
}
// This is only done during class loading, so it is OK to assume method_idnum matches the methods() array
// default_methods also uses this without the ordering for fast find_method
-void Method::sort_methods(Array<Method*>* methods, bool set_idnums) {
+void Method::sort_methods(Array<Method*>* methods, bool set_idnums, method_comparator_func func) {
int length = methods->length();
if (length > 1) {
+ if (func == NULL) {
+ func = method_comparator;
+ }
{
NoSafepointVerifier nsv;
- QuickSort::sort(methods->data(), length, method_comparator, /*idempotent=*/false);
+ QuickSort::sort(methods->data(), length, func, /*idempotent=*/false);
}
// Reset method ordering
if (set_idnums) {
for (int i = 0; i < length; i++) {
Method* m = methods->at(i);
< prev index next >