src/share/vm/oops/symbol.cpp
Print this page
*** 227,254 ****
// Use alternate hashing algorithm on this symbol.
return AltHashing::murmur3_32(seed, (const jbyte*)as_C_string(), utf8_length());
}
void Symbol::increment_refcount() {
! // Only increment the refcount if positive. If negative either
// overflow has occurred or it is a permanent symbol in a read only
// shared archive.
! if (_refcount >= 0) {
Atomic::inc(&_refcount);
NOT_PRODUCT(Atomic::inc(&_total_count);)
}
}
void Symbol::decrement_refcount() {
! if (_refcount >= 0) {
! Atomic::dec(&_refcount);
#ifdef ASSERT
! if (_refcount < 0) {
print();
assert(false, "reference count underflow for symbol");
}
#endif
}
}
void Symbol::print_on(outputStream* st) const {
if (this == NULL) {
--- 227,255 ----
// Use alternate hashing algorithm on this symbol.
return AltHashing::murmur3_32(seed, (const jbyte*)as_C_string(), utf8_length());
}
void Symbol::increment_refcount() {
! // Only increment the refcount if non-negative. If negative either
// overflow has occurred or it is a permanent symbol in a read only
// shared archive.
! if (_refcount >= 0) { // not a permanent symbol
Atomic::inc(&_refcount);
NOT_PRODUCT(Atomic::inc(&_total_count);)
}
}
void Symbol::decrement_refcount() {
! if (_refcount >= 0) { // not a permanent symbol
! jshort new_value = Atomic::add(-1, &_refcount);
#ifdef ASSERT
! if (new_value == -1) { // we have transitioned from 0 -> -1
print();
assert(false, "reference count underflow for symbol");
}
#endif
+ (void)new_value;
}
}
void Symbol::print_on(outputStream* st) const {
if (this == NULL) {