13 *
14 * You should have received a copy of the GNU General Public License version
15 * 2 along with this work; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
21 *
22 */
23
24 #include "precompiled.hpp"
25 #include "oops/compiledICHolder.hpp"
26 #include "runtime/atomic.hpp"
27
28 volatile int CompiledICHolder::_live_count;
29 volatile int CompiledICHolder::_live_not_claimed_count;
30
31
32 CompiledICHolder::CompiledICHolder(Metadata* metadata, Klass* klass, bool is_method)
33 : _holder_metadata(metadata), _holder_klass(klass), _is_metadata_method(is_method) {
34 #ifdef ASSERT
35 Atomic::inc(&_live_count);
36 Atomic::inc(&_live_not_claimed_count);
37 #endif // ASSERT
38 }
39
40 #ifdef ASSERT
41 CompiledICHolder::~CompiledICHolder() {
42 assert(_live_count > 0, "underflow");
43 Atomic::dec(&_live_count);
44 }
45 #endif // ASSERT
46
47 // Printing
48
49 void CompiledICHolder::print_on(outputStream* st) const {
50 st->print("%s", internal_name());
51 st->print(" - metadata: "); holder_metadata()->print_value_on(st); st->cr();
52 st->print(" - klass: "); holder_klass()->print_value_on(st); st->cr();
|
13 *
14 * You should have received a copy of the GNU General Public License version
15 * 2 along with this work; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
21 *
22 */
23
24 #include "precompiled.hpp"
25 #include "oops/compiledICHolder.hpp"
26 #include "runtime/atomic.hpp"
27
28 volatile int CompiledICHolder::_live_count;
29 volatile int CompiledICHolder::_live_not_claimed_count;
30
31
32 CompiledICHolder::CompiledICHolder(Metadata* metadata, Klass* klass, bool is_method)
33 : _holder_metadata(metadata),
34 _holder_klass(klass),
35 _next(NULL),
36 _is_enqueued(false),
37 _is_metadata_method(is_method) {
38 #ifdef ASSERT
39 Atomic::inc(&_live_count);
40 Atomic::inc(&_live_not_claimed_count);
41 #endif // ASSERT
42 }
43
44 #ifdef ASSERT
45 CompiledICHolder::~CompiledICHolder() {
46 assert(_live_count > 0, "underflow");
47 Atomic::dec(&_live_count);
48 }
49 #endif // ASSERT
50
51 // Printing
52
53 void CompiledICHolder::print_on(outputStream* st) const {
54 st->print("%s", internal_name());
55 st->print(" - metadata: "); holder_metadata()->print_value_on(st); st->cr();
56 st->print(" - klass: "); holder_klass()->print_value_on(st); st->cr();
|