< prev index next >

src/hotspot/share/interpreter/invocationCounter.hpp

Print this page




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_INTERPRETER_INVOCATIONCOUNTER_HPP
  26 #define SHARE_VM_INTERPRETER_INVOCATIONCOUNTER_HPP
  27 
  28 #include "memory/allocation.hpp"
  29 #include "runtime/handles.hpp"
  30 #include "utilities/exceptions.hpp"
  31 
  32 // InvocationCounters are used to trigger actions when a limit (threshold) is reached.
  33 // For different states, different limits and actions can be defined in the initialization
  34 // routine of InvocationCounters.
  35 //
  36 // Implementation notes: For space reasons, state & counter are both encoded in one word,
  37 // The state is encoded using some of the least significant bits, the counter is using the
  38 // more significant bits. The counter is incremented before a method is activated and an
  39 // action is triggered when count() > limit().
  40 
  41 class InvocationCounter {
  42   friend class VMStructs;
  43   friend class JVMCIVMStructs;
  44   friend class ciReplay;
  45  private:                             // bit no: |31  3|  2  | 1 0 |
  46   unsigned int _counter;              // format: [count|carry|state]
  47 
  48   enum PrivateConstants {




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_INTERPRETER_INVOCATIONCOUNTER_HPP
  26 #define SHARE_VM_INTERPRETER_INVOCATIONCOUNTER_HPP
  27 

  28 #include "runtime/handles.hpp"
  29 #include "utilities/exceptions.hpp"
  30 
  31 // InvocationCounters are used to trigger actions when a limit (threshold) is reached.
  32 // For different states, different limits and actions can be defined in the initialization
  33 // routine of InvocationCounters.
  34 //
  35 // Implementation notes: For space reasons, state & counter are both encoded in one word,
  36 // The state is encoded using some of the least significant bits, the counter is using the
  37 // more significant bits. The counter is incremented before a method is activated and an
  38 // action is triggered when count() > limit().
  39 
  40 class InvocationCounter {
  41   friend class VMStructs;
  42   friend class JVMCIVMStructs;
  43   friend class ciReplay;
  44  private:                             // bit no: |31  3|  2  | 1 0 |
  45   unsigned int _counter;              // format: [count|carry|state]
  46 
  47   enum PrivateConstants {


< prev index next >