changeset 46326:70de7011f79a

8159734: Consistency check fails with -XX:-ProfileInterpreter Summary: Re-establish the consistency of profiling information also with -XX:-ProfileInterpreter. Reviewed-by: kvn
author zmajo
date Mon, 13 Mar 2017 13:01:47 +0100
parents 0fa9327949f8
children 91576389a517
files hotspot/src/share/vm/ci/ciMethod.cpp
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/src/share/vm/ci/ciMethod.cpp	Mon Mar 13 12:13:09 2017 +0100
+++ b/hotspot/src/share/vm/ci/ciMethod.cpp	Mon Mar 13 13:01:47 2017 +0100
@@ -504,10 +504,11 @@
           morphism++;
         }
         int epsilon = 0;
-        if (TieredCompilation && ProfileInterpreter) {
-          // Interpreter and C1 treat final and special invokes differently.
-          // C1 will record a type, whereas the interpreter will just
-          // increment the count. Detect this case.
+        if (TieredCompilation) {
+          // For a call, it is assumed that either the type of the receiver(s)
+          // is recorded or an associated counter is incremented, but not both. With
+          // tiered compilation, however, both can happen due to the interpreter and
+          // C1 profiling invocations differently. Address that inconsistency here.
           if (morphism == 1 && count > 0) {
             epsilon = count;
             count = 0;
@@ -525,8 +526,8 @@
           // we will set result._method also.
         }
         // Determine call site's morphism.
-        // The call site count is 0 with known morphism (onlt 1 or 2 receivers)
-        // or < 0 in the case of a type check failured for checkcast, aastore, instanceof.
+        // The call site count is 0 with known morphism (only 1 or 2 receivers)
+        // 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.
         if (morphism > 0 && morphism == result._limit) {
            // The morphism <= MorphismLimit.