src/share/vm/oops/instanceKlass.cpp

Print this page
rev 6670 : 8049426: Minor cleanups after G1 class unloading
Reviewed-by: stefank


1934     tty->print("[%d] count=%d { ", idx++, b->count());
1935     if (!verbose) {
1936       nm->print_on(tty, "nmethod");
1937       tty->print_cr(" } ");
1938     } else {
1939       nm->print();
1940       nm->print_dependencies();
1941       tty->print_cr("--- } ");
1942     }
1943     b = b->next();
1944   }
1945 }
1946 
1947 
1948 bool InstanceKlass::is_dependent_nmethod(nmethod* nm) {
1949   nmethodBucket* b = _dependencies;
1950   while (b != NULL) {
1951     if (nm == b->get_nmethod()) {
1952 #ifdef ASSERT
1953       int count = b->count();
1954       assert(count >= 0, "Just check if we ever get here 1");
1955       assert(count > 0,  "Just check if we ever get here 2");
1956 #endif
1957       return true;
1958     }
1959     b = b->next();
1960   }
1961   return false;
1962 }
1963 #endif //PRODUCT
1964 
1965 
1966 // Garbage collection
1967 
1968 #ifdef ASSERT
1969 template <class T> void assert_is_in(T *p) {
1970   T heap_oop = oopDesc::load_heap_oop(p);
1971   if (!oopDesc::is_null(heap_oop)) {
1972     oop o = oopDesc::decode_heap_oop_not_null(heap_oop);
1973     assert(Universe::heap()->is_in(o), "should be in heap");
1974   }
1975 }




1934     tty->print("[%d] count=%d { ", idx++, b->count());
1935     if (!verbose) {
1936       nm->print_on(tty, "nmethod");
1937       tty->print_cr(" } ");
1938     } else {
1939       nm->print();
1940       nm->print_dependencies();
1941       tty->print_cr("--- } ");
1942     }
1943     b = b->next();
1944   }
1945 }
1946 
1947 
1948 bool InstanceKlass::is_dependent_nmethod(nmethod* nm) {
1949   nmethodBucket* b = _dependencies;
1950   while (b != NULL) {
1951     if (nm == b->get_nmethod()) {
1952 #ifdef ASSERT
1953       int count = b->count();
1954       assert(count >= 0, err_msg("count shouldn't be negative: %d", count));

1955 #endif
1956       return true;
1957     }
1958     b = b->next();
1959   }
1960   return false;
1961 }
1962 #endif //PRODUCT
1963 
1964 
1965 // Garbage collection
1966 
1967 #ifdef ASSERT
1968 template <class T> void assert_is_in(T *p) {
1969   T heap_oop = oopDesc::load_heap_oop(p);
1970   if (!oopDesc::is_null(heap_oop)) {
1971     oop o = oopDesc::decode_heap_oop_not_null(heap_oop);
1972     assert(Universe::heap()->is_in(o), "should be in heap");
1973   }
1974 }