8159734: Consistency check fails with -XX:-ProfileInterpreter

Re-establish the consistency of profiling information also with -XX:-ProfileInterpreter.

Reviewed-by: kvn
This commit is contained in:
Zoltan Majo 2017-03-13 13:01:47 +01:00
parent 43a771e998
commit fcb5908230

View File

@ -504,10 +504,11 @@ ciCallProfile ciMethod::call_profile_at_bci(int bci) {
morphism++; morphism++;
} }
int epsilon = 0; int epsilon = 0;
if (TieredCompilation && ProfileInterpreter) { if (TieredCompilation) {
// Interpreter and C1 treat final and special invokes differently. // For a call, it is assumed that either the type of the receiver(s)
// C1 will record a type, whereas the interpreter will just // is recorded or an associated counter is incremented, but not both. With
// increment the count. Detect this case. // tiered compilation, however, both can happen due to the interpreter and
// C1 profiling invocations differently. Address that inconsistency here.
if (morphism == 1 && count > 0) { if (morphism == 1 && count > 0) {
epsilon = count; epsilon = count;
count = 0; count = 0;
@ -525,8 +526,8 @@ ciCallProfile ciMethod::call_profile_at_bci(int bci) {
// we will set result._method also. // we will set result._method also.
} }
// Determine call site's morphism. // Determine call site's morphism.
// The call site count is 0 with known morphism (onlt 1 or 2 receivers) // The call site count is 0 with known morphism (only 1 or 2 receivers)
// or < 0 in the case of a type check failured for checkcast, aastore, instanceof. // or < 0 in the case of a type check failure for checkcast, aastore, instanceof.
// The call site count is > 0 in the case of a polymorphic virtual call. // The call site count is > 0 in the case of a polymorphic virtual call.
if (morphism > 0 && morphism == result._limit) { if (morphism > 0 && morphism == result._limit) {
// The morphism <= MorphismLimit. // The morphism <= MorphismLimit.