hotspot/src/share/vm/oops/compiledICHolder.hpp
changeset 25351 7c198a690050
parent 13728 882756847a04
equal deleted inserted replaced
25350:6423a57e5451 25351:7c198a690050
    24 
    24 
    25 #ifndef SHARE_VM_OOPS_COMPILEDICHOLDEROOP_HPP
    25 #ifndef SHARE_VM_OOPS_COMPILEDICHOLDEROOP_HPP
    26 #define SHARE_VM_OOPS_COMPILEDICHOLDEROOP_HPP
    26 #define SHARE_VM_OOPS_COMPILEDICHOLDEROOP_HPP
    27 
    27 
    28 #include "oops/oop.hpp"
    28 #include "oops/oop.hpp"
       
    29 #include "utilities/macros.hpp"
    29 
    30 
    30 // A CompiledICHolder* is a helper object for the inline cache implementation.
    31 // A CompiledICHolder* is a helper object for the inline cache implementation.
    31 // It holds an intermediate value (method+klass pair) used when converting from
    32 // It holds an intermediate value (method+klass pair) used when converting from
    32 // compiled to an interpreted call.
    33 // compiled to an interpreted call.
    33 //
    34 //
    48   Klass*    _holder_klass;    // to avoid name conflict with oopDesc::_klass
    49   Klass*    _holder_klass;    // to avoid name conflict with oopDesc::_klass
    49   CompiledICHolder* _next;
    50   CompiledICHolder* _next;
    50 
    51 
    51  public:
    52  public:
    52   // Constructor
    53   // Constructor
    53   CompiledICHolder(Method* method, Klass* klass)
    54   CompiledICHolder(Method* method, Klass* klass);
    54       : _holder_method(method), _holder_klass(klass) {
    55   ~CompiledICHolder() NOT_DEBUG_RETURN;
    55 #ifdef ASSERT
       
    56     Atomic::inc(&_live_count);
       
    57     Atomic::inc(&_live_not_claimed_count);
       
    58 #endif
       
    59   }
       
    60 
       
    61   ~CompiledICHolder() {
       
    62 #ifdef ASSERT
       
    63     assert(_live_count > 0, "underflow");
       
    64     Atomic::dec(&_live_count);
       
    65 #endif
       
    66   }
       
    67 
    56 
    68   static int live_count() { return _live_count; }
    57   static int live_count() { return _live_count; }
    69   static int live_not_claimed_count() { return _live_not_claimed_count; }
    58   static int live_not_claimed_count() { return _live_not_claimed_count; }
    70 
    59 
    71   // accessors
    60   // accessors
    89   void print_on(outputStream* st) const;
    78   void print_on(outputStream* st) const;
    90   void print_value_on(outputStream* st) const;
    79   void print_value_on(outputStream* st) const;
    91 
    80 
    92   const char* internal_name() const { return "{compiledICHolder}"; }
    81   const char* internal_name() const { return "{compiledICHolder}"; }
    93 
    82 
    94   void claim() {
    83   void claim() NOT_DEBUG_RETURN;
    95 #ifdef ASSERT
       
    96     Atomic::dec(&_live_not_claimed_count);
       
    97 #endif
       
    98   }
       
    99 };
    84 };
   100 
    85 
   101 #endif // SHARE_VM_OOPS_COMPILEDICHOLDEROOP_HPP
    86 #endif // SHARE_VM_OOPS_COMPILEDICHOLDEROOP_HPP