Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8010862

The Method counter fields used for profiling can be allocated lazily

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • hs25
    • 8
    • embedded
    • None
    • b29
    • generic
    • generic

        The following 7 Method fields are used for interpreter/tiered compilation profiling. These fields are not used until a java method is executed.

          int _interpreter_invocation_count;
          u2 _interpreter_throwout_count;
          u2 _number_of_breakpoints;
          InvocationCounter _invocation_counter;
          InvocationCounter _backedge_counter;
        #ifdef TIERED
          float _rate;
          jlong _prev_time;
        #endif

        Move those fields into a separate MethodCounters object referenced from Method. The counter object for a specific method can be allocated upon the first time when any of the fields is modified.

        A separate data structer is used for the interpreter counters instead of adding the counters to MethodData, because the MethodData might not have the same life span as the interpreter counters. For example when TieredCompilation is not enabled, the MethodData is not allocated until the interpreter counter reaches InterpreterProfileLimit. Allocating the MethodData early would waste memory for non-hot methods which only execute a few times. Also the MethodData is only allocated when ProfileInterpreter is enabled, which is the default case for c2 but not for c1. Under TieredCompilation, there are cases where MethodData exist but the interpreter counters are never accessed.

              jiangli Jiangli Zhou
              jiangli Jiangli Zhou
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: