aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm/oops/klassVtable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/share/vm/oops/klassVtable.cpp')
-rw-r--r--src/share/vm/oops/klassVtable.cpp102
1 files changed, 63 insertions, 39 deletions
diff --git a/src/share/vm/oops/klassVtable.cpp b/src/share/vm/oops/klassVtable.cpp
index f8e4d0223..43036e754 100644
--- a/src/share/vm/oops/klassVtable.cpp
+++ b/src/share/vm/oops/klassVtable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -610,6 +610,7 @@ void klassVtable::copy_vtable_to(vtableEntry* start) {
Copy::disjoint_words((HeapWord*)table(), (HeapWord*)start, _length * vtableEntry::size());
}
+#if INCLUDE_JVMTI
void klassVtable::adjust_method_entries(Method** old_methods, Method** new_methods,
int methods_length, bool * trace_name_printed) {
// search the vtable for uses of either obsolete or EMCP methods
@@ -638,11 +639,39 @@ void klassVtable::adjust_method_entries(Method** old_methods, Method** new_metho
new_method->name()->as_C_string(),
new_method->signature()->as_C_string()));
}
+ // cannot 'break' here; see for-loop comment above.
}
}
}
}
+// a vtable should never contain old or obsolete methods
+bool klassVtable::check_no_old_or_obsolete_entries() {
+ for (int i = 0; i < length(); i++) {
+ Method* m = unchecked_method_at(i);
+ if (m != NULL &&
+ (NOT_PRODUCT(!m->is_valid() ||) m->is_old() || m->is_obsolete())) {
+ return false;
+ }
+ }
+ return true;
+}
+
+void klassVtable::dump_vtable() {
+ tty->print_cr("vtable dump --");
+ for (int i = 0; i < length(); i++) {
+ Method* m = unchecked_method_at(i);
+ if (m != NULL) {
+ tty->print(" (%5d) ", i);
+ m->access_flags().print_on(tty);
+ tty->print(" -- ");
+ m->print_name(tty);
+ tty->cr();
+ }
+ }
+}
+#endif // INCLUDE_JVMTI
+
// CDS/RedefineClasses support - clear vtables so they can be reinitialized
void klassVtable::clear_vtable() {
for (int i = 0; i < _length; i++) table()[i].clear();
@@ -805,6 +834,7 @@ void klassItable::initialize_with_method(Method* m) {
}
}
+#if INCLUDE_JVMTI
void klassItable::adjust_method_entries(Method** old_methods, Method** new_methods,
int methods_length, bool * trace_name_printed) {
// search the itable for uses of either obsolete or EMCP methods
@@ -833,13 +863,44 @@ void klassItable::adjust_method_entries(Method** old_methods, Method** new_metho
new_method->name()->as_C_string(),
new_method->signature()->as_C_string()));
}
- // Cannot break because there might be another entry for this method
+ // cannot 'break' here; see for-loop comment above.
}
ime++;
}
}
}
+// an itable should never contain old or obsolete methods
+bool klassItable::check_no_old_or_obsolete_entries() {
+ itableMethodEntry* ime = method_entry(0);
+ for (int i = 0; i < _size_method_table; i++) {
+ Method* m = ime->method();
+ if (m != NULL &&
+ (NOT_PRODUCT(!m->is_valid() ||) m->is_old() || m->is_obsolete())) {
+ return false;
+ }
+ ime++;
+ }
+ return true;
+}
+
+void klassItable::dump_itable() {
+ itableMethodEntry* ime = method_entry(0);
+ tty->print_cr("itable dump --");
+ for (int i = 0; i < _size_method_table; i++) {
+ Method* m = ime->method();
+ if (m != NULL) {
+ tty->print(" (%5d) ", i);
+ m->access_flags().print_on(tty);
+ tty->print(" -- ");
+ m->print_name(tty);
+ tty->cr();
+ }
+ ime++;
+ }
+}
+#endif // INCLUDE_JVMTI
+
// Setup
class InterfaceVisiterClosure : public StackObj {
@@ -1126,43 +1187,6 @@ void klassVtable::print_statistics() {
tty->print_cr("%6d bytes total", total);
}
-bool klassVtable::check_no_old_entries() {
- // Check that there really is no entry
- for (int i = 0; i < length(); i++) {
- Method* m = unchecked_method_at(i);
- if (m != NULL) {
- if (!m->is_valid() || m->is_old()) {
- return false;
- }
- }
- }
- return true;
-}
-
-void klassVtable::dump_vtable() {
- tty->print_cr("vtable dump --");
- for (int i = 0; i < length(); i++) {
- Method* m = unchecked_method_at(i);
- if (m != NULL) {
- tty->print(" (%5d) ", i);
- m->access_flags().print_on(tty);
- tty->print(" -- ");
- m->print_name(tty);
- tty->cr();
- }
- }
-}
-
-bool klassItable::check_no_old_entries() {
- itableMethodEntry* ime = method_entry(0);
- for(int i = 0; i < _size_method_table; i++) {
- Method* m = ime->method();
- if (m != NULL && (!m->is_valid() || m->is_old())) return false;
- ime++;
- }
- return true;
-}
-
int klassItable::_total_classes; // Total no. of classes with itables
long klassItable::_total_size; // Total no. of bytes used for itables