8148639: Some MethodCounter fields can be excluded when not including C2

Removed _interpreter_invocation_count and _interpreter_throwout_count fields for C1

Reviewed-by: kvn, coleenp
This commit is contained in:
Chris Plummer 2016-03-30 09:52:02 -07:00
parent 755b6af36e
commit fbe049838a
8 changed files with 83 additions and 16 deletions

View file

@ -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 @@ class MethodCounters: public MetaspaceObj {
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 @@ class MethodCounters: public MetaspaceObj {
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 @@ class MethodCounters: public MetaspaceObj {
_highest_osr_comp_level(0)
#endif
{
set_interpreter_invocation_count(0);
set_interpreter_throwout_count(0);
invocation_counter()->init();
backedge_counter()->init();
@ -109,6 +111,8 @@ class MethodCounters: public MetaspaceObj {
void clear_counters();
#if defined(COMPILER2) || INCLUDE_JVMCI
int interpreter_invocation_count() {
return _interpreter_invocation_count;
}
@ -131,6 +135,24 @@ class MethodCounters: public MetaspaceObj {
_interpreter_throwout_count = count;
}
#else // defined(COMPILER2) || INCLUDE_JVMCI
int interpreter_invocation_count() {
return 0;
}
void set_interpreter_invocation_count(int count) {
assert(count == 0, "count must be 0");
}
int interpreter_throwout_count() const {
return 0;
}
void set_interpreter_throwout_count(int count) {
assert(count == 0, "count must be 0");
}
#endif // defined(COMPILER2) || INCLUDE_JVMCI
u2 number_of_breakpoints() const { return _number_of_breakpoints; }
void incr_number_of_breakpoints() { ++_number_of_breakpoints; }
void decr_number_of_breakpoints() { --_number_of_breakpoints; }
@ -170,10 +192,25 @@ class MethodCounters: public MetaspaceObj {
return byte_offset_of(MethodCounters, _nmethod_age);
}
#if defined(COMPILER2) || INCLUDE_JVMCI
static ByteSize interpreter_invocation_counter_offset() {
return byte_offset_of(MethodCounters, _interpreter_invocation_count);
}
static int interpreter_invocation_counter_offset_in_bytes() {
return offset_of(MethodCounters, _interpreter_invocation_count);
}
#else // defined(COMPILER2) || INCLUDE_JVMCI
static ByteSize interpreter_invocation_counter_offset() {
ShouldNotReachHere();
return in_ByteSize(0);
}
#endif // defined(COMPILER2) || INCLUDE_JVMCI
static ByteSize invocation_counter_offset() {
return byte_offset_of(MethodCounters, _invocation_counter);
}
@ -182,10 +219,6 @@ class MethodCounters: public MetaspaceObj {
return byte_offset_of(MethodCounters, _backedge_counter);
}
static int interpreter_invocation_counter_offset_in_bytes() {
return offset_of(MethodCounters, _interpreter_invocation_count);
}
static ByteSize interpreter_invocation_limit_offset() {
return byte_offset_of(MethodCounters, _interpreter_invocation_limit);
}