src/share/vm/oops/symbol.hpp

Print this page
rev 4205 : Fix non-PCH build on Linux, Windows and MacOS X

*** 1,7 **** /* ! * Copyright (c) 1997, 2012, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 25,35 **** #ifndef SHARE_VM_OOPS_SYMBOL_HPP #define SHARE_VM_OOPS_SYMBOL_HPP #include "utilities/utf8.hpp" #include "memory/allocation.hpp" - #include "runtime/atomic.hpp" // A Symbol is a canonicalized string. // All Symbols reside in global SymbolTable and are reference counted. // Reference counting --- 25,34 ----
*** 148,159 **** // For symbol table alternate hashing unsigned int new_hash(jint seed); // Reference counting. See comments above this class for when to use. int refcount() const { return _refcount; } ! inline void increment_refcount(); ! inline void decrement_refcount(); int byte_at(int index) const { assert(index >=0 && index < _length, "symbol index overflow"); return base()[index]; } --- 147,158 ---- // For symbol table alternate hashing unsigned int new_hash(jint seed); // Reference counting. See comments above this class for when to use. int refcount() const { return _refcount; } ! void increment_refcount(); ! void decrement_refcount(); int byte_at(int index) const { assert(index >=0 && index < _length, "symbol index overflow"); return base()[index]; }
*** 230,257 **** // so use address comparison for speed int Symbol::fast_compare(Symbol* other) const { return (((uintptr_t)this < (uintptr_t)other) ? -1 : ((uintptr_t)this == (uintptr_t) other) ? 0 : 1); } - - inline 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);) - } - } - - inline void Symbol::decrement_refcount() { - if (_refcount >= 0) { - Atomic::dec(&_refcount); - #ifdef ASSERT - if (_refcount < 0) { - print(); - assert(false, "reference count underflow for symbol"); - } - #endif - } - } #endif // SHARE_VM_OOPS_SYMBOL_HPP --- 229,234 ----