equal
deleted
inserted
replaced
1497 if (method_matches(m, signature, skipping_overpass, skipping_static, skipping_private)) return i; |
1497 if (method_matches(m, signature, skipping_overpass, skipping_static, skipping_private)) return i; |
1498 } |
1498 } |
1499 // not found |
1499 // not found |
1500 #ifdef ASSERT |
1500 #ifdef ASSERT |
1501 int index = (skipping_overpass || skipping_static || skipping_private) ? -1 : linear_search(methods, name, signature); |
1501 int index = (skipping_overpass || skipping_static || skipping_private) ? -1 : linear_search(methods, name, signature); |
1502 assert(index == -1, err_msg("binary search should have found entry %d", index)); |
1502 assert(index == -1, "binary search should have found entry %d", index); |
1503 #endif |
1503 #endif |
1504 } |
1504 } |
1505 return -1; |
1505 return -1; |
1506 } |
1506 } |
1507 int InstanceKlass::find_method_by_name(Symbol* name, int* end) { |
1507 int InstanceKlass::find_method_by_name(Symbol* name, int* end) { |
1913 assert_locked_or_safepoint(CodeCache_lock); |
1913 assert_locked_or_safepoint(CodeCache_lock); |
1914 |
1914 |
1915 for (nmethodBucket* b = deps; b != NULL; b = b->next()) { |
1915 for (nmethodBucket* b = deps; b != NULL; b = b->next()) { |
1916 if (nm == b->get_nmethod()) { |
1916 if (nm == b->get_nmethod()) { |
1917 int val = b->decrement(); |
1917 int val = b->decrement(); |
1918 guarantee(val >= 0, err_msg("Underflow: %d", val)); |
1918 guarantee(val >= 0, "Underflow: %d", val); |
1919 return (val == 0); |
1919 return (val == 0); |
1920 } |
1920 } |
1921 } |
1921 } |
1922 #ifdef ASSERT |
1922 #ifdef ASSERT |
1923 tty->print_raw_cr("### can't find dependent nmethod"); |
1923 tty->print_raw_cr("### can't find dependent nmethod"); |
1934 nmethodBucket* first = deps; |
1934 nmethodBucket* first = deps; |
1935 nmethodBucket* last = NULL; |
1935 nmethodBucket* last = NULL; |
1936 nmethodBucket* b = first; |
1936 nmethodBucket* b = first; |
1937 |
1937 |
1938 while (b != NULL) { |
1938 while (b != NULL) { |
1939 assert(b->count() >= 0, err_msg("bucket count: %d", b->count())); |
1939 assert(b->count() >= 0, "bucket count: %d", b->count()); |
1940 nmethodBucket* next = b->next(); |
1940 nmethodBucket* next = b->next(); |
1941 if (b->count() == 0) { |
1941 if (b->count() == 0) { |
1942 if (last == NULL) { |
1942 if (last == NULL) { |
1943 first = next; |
1943 first = next; |
1944 } else { |
1944 } else { |
1974 bool nmethodBucket::is_dependent_nmethod(nmethodBucket* deps, nmethod* nm) { |
1974 bool nmethodBucket::is_dependent_nmethod(nmethodBucket* deps, nmethod* nm) { |
1975 for (nmethodBucket* b = deps; b != NULL; b = b->next()) { |
1975 for (nmethodBucket* b = deps; b != NULL; b = b->next()) { |
1976 if (nm == b->get_nmethod()) { |
1976 if (nm == b->get_nmethod()) { |
1977 #ifdef ASSERT |
1977 #ifdef ASSERT |
1978 int count = b->count(); |
1978 int count = b->count(); |
1979 assert(count >= 0, err_msg("count shouldn't be negative: %d", count)); |
1979 assert(count >= 0, "count shouldn't be negative: %d", count); |
1980 #endif |
1980 #endif |
1981 return true; |
1981 return true; |
1982 } |
1982 } |
1983 } |
1983 } |
1984 return false; |
1984 return false; |
1999 } |
1999 } |
2000 #ifdef ASSERT |
2000 #ifdef ASSERT |
2001 else { |
2001 else { |
2002 // Verification |
2002 // Verification |
2003 for (nmethodBucket* b = _dependencies; b != NULL; b = b->next()) { |
2003 for (nmethodBucket* b = _dependencies; b != NULL; b = b->next()) { |
2004 assert(b->count() >= 0, err_msg("bucket count: %d", b->count())); |
2004 assert(b->count() >= 0, "bucket count: %d", b->count()); |
2005 assert(b->count() != 0, "empty buckets need to be cleaned"); |
2005 assert(b->count() != 0, "empty buckets need to be cleaned"); |
2006 } |
2006 } |
2007 } |
2007 } |
2008 #endif |
2008 #endif |
2009 } |
2009 } |
3108 // Verify siblings |
3108 // Verify siblings |
3109 Klass* super = this->super(); |
3109 Klass* super = this->super(); |
3110 Klass* sib = next_sibling(); |
3110 Klass* sib = next_sibling(); |
3111 if (sib != NULL) { |
3111 if (sib != NULL) { |
3112 if (sib == this) { |
3112 if (sib == this) { |
3113 fatal(err_msg("subclass points to itself " PTR_FORMAT, sib)); |
3113 fatal("subclass points to itself " PTR_FORMAT, sib); |
3114 } |
3114 } |
3115 |
3115 |
3116 guarantee(sib->is_klass(), "should be klass"); |
3116 guarantee(sib->is_klass(), "should be klass"); |
3117 guarantee(sib->super() == super, "siblings should have same superklass"); |
3117 guarantee(sib->super() == super, "siblings should have same superklass"); |
3118 } |
3118 } |