src/share/vm/oops/compiledICHolder.cpp

Print this page
rev 6676 : 8044775: Improve usage of umbrella header atomic.inline.hpp.
Reviewed-by: stefank, kvn

*** 25,39 **** --- 25,55 ---- #include "precompiled.hpp" #include "oops/compiledICHolder.hpp" #include "oops/klass.hpp" #include "oops/method.hpp" #include "oops/oop.inline2.hpp" + #include "runtime/atomic.inline.hpp" volatile int CompiledICHolder::_live_count; volatile int CompiledICHolder::_live_not_claimed_count; + CompiledICHolder::CompiledICHolder(Method* method, Klass* klass) + : _holder_method(method), _holder_klass(klass) { + #ifdef ASSERT + Atomic::inc(&_live_count); + Atomic::inc(&_live_not_claimed_count); + #endif // ASSERT + } + + #ifdef ASSERT + CompiledICHolder::~CompiledICHolder() { + assert(_live_count > 0, "underflow"); + Atomic::dec(&_live_count); + } + #endif // ASSERT + // Printing void CompiledICHolder::print_on(outputStream* st) const { st->print("%s", internal_name()); st->print(" - method: "); holder_method()->print_value_on(st); st->cr();
*** 49,53 **** --- 65,77 ---- void CompiledICHolder::verify_on(outputStream* st) { guarantee(holder_method()->is_method(), "should be method"); guarantee(holder_klass()->is_klass(), "should be klass"); } + + #ifdef ASSERT + + void CompiledICHolder::claim() { + Atomic::dec(&_live_not_claimed_count); + } + + #endif // ASSERT