--- old/src/share/vm/oops/methodCounters.hpp 2016-03-21 16:43:04.521546318 -0700 +++ new/src/share/vm/oops/methodCounters.hpp 2016-03-21 16:43:04.456546222 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016 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 @@ -34,8 +34,10 @@ friend class VMStructs; friend class JVMCIVMStructs; private: +#if defined(COMPILER2) || INCLUDE_JVMCI int _interpreter_invocation_count; // Count of times invoked (reused as prev_event_count in tiered) u2 _interpreter_throwout_count; // Count of times method was exited via exception while interpreting +#endif u2 _number_of_breakpoints; // fullspeed debugging support InvocationCounter _invocation_counter; // Incremented before each activation of the method - used to trigger frequency-based optimizations InvocationCounter _backedge_counter; // Incremented before each backedge taken - used to trigger frequencey-based optimizations @@ -60,9 +62,7 @@ u1 _highest_osr_comp_level; // Same for OSR level #endif - MethodCounters(methodHandle mh) : _interpreter_invocation_count(0), - _interpreter_throwout_count(0), - _number_of_breakpoints(0), + MethodCounters(methodHandle mh) : _number_of_breakpoints(0), _nmethod_age(INT_MAX) #ifdef TIERED , _rate(0), @@ -71,6 +71,8 @@ _highest_osr_comp_level(0) #endif { + set_interpreter_invocation_count(0); + set_interpreter_throwout_count(0); invocation_counter()->init(); backedge_counter()->init(); @@ -110,25 +112,45 @@ void clear_counters(); int interpreter_invocation_count() { +#if defined(COMPILER2) || INCLUDE_JVMCI return _interpreter_invocation_count; +#else + return 0; +#endif } void set_interpreter_invocation_count(int count) { +#if defined(COMPILER2) || INCLUDE_JVMCI _interpreter_invocation_count = count; +#else + assert(count == 0, "count must be 0"); +#endif } +#if defined(COMPILER2) || INCLUDE_JVMCI int increment_interpreter_invocation_count() { return ++_interpreter_invocation_count; } +#endif +#if defined(COMPILER2) || INCLUDE_JVMCI void interpreter_throwout_increment() { if (_interpreter_throwout_count < 65534) { _interpreter_throwout_count++; } } +#endif int interpreter_throwout_count() const { +#if defined(COMPILER2) || INCLUDE_JVMCI return _interpreter_throwout_count; +#else + return 0; +#endif } void set_interpreter_throwout_count(int count) { +#if defined(COMPILER2) || INCLUDE_JVMCI _interpreter_throwout_count = count; +#else + assert(count == 0, "count must be 0"); +#endif } u2 number_of_breakpoints() const { return _number_of_breakpoints; } @@ -171,7 +193,12 @@ } static ByteSize interpreter_invocation_counter_offset() { +#if defined(COMPILER2) || INCLUDE_JVMCI return byte_offset_of(MethodCounters, _interpreter_invocation_count); +#else + ShouldNotReachHere(); + return in_ByteSize(0); +#endif } static ByteSize invocation_counter_offset() { @@ -182,9 +209,11 @@ return byte_offset_of(MethodCounters, _backedge_counter); } +#if defined(COMPILER2) || INCLUDE_JVMCI static int interpreter_invocation_counter_offset_in_bytes() { return offset_of(MethodCounters, _interpreter_invocation_count); } +#endif static ByteSize interpreter_invocation_limit_offset() { return byte_offset_of(MethodCounters, _interpreter_invocation_limit);