Skip to content

Commit

Permalink
8290834: Improve potentially confusing documentation on collection of…
Browse files Browse the repository at this point in the history
… profiling information

Reviewed-by: thartmann, kvn, dlong
  • Loading branch information
TheShermanTanker authored and dean-long committed Jul 25, 2022
1 parent 7c3cfd1 commit 0ca5cb1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/hotspot/share/c1/c1_globals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@
"Use CHA and exact type results at call sites when updating MDOs")\
\
product(bool, C1UpdateMethodData, true, \
"Update MethodData*s in Tier1-generated code") \
"Update MethodData*s in Tier 3 C1 generated code") \
\
develop(bool, PrintCFGToFile, false, \
"print control flow graph to a separate file during compilation")
Expand Down
15 changes: 12 additions & 3 deletions src/hotspot/share/compiler/compilationPolicy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,20 @@ class CompileTask;
class CompileQueue;
/*
* The system supports 5 execution levels:
* * level 0 - interpreter
* * level 0 - interpreter (Profiling is tracked by a MethodData object, or MDO in short)
* * level 1 - C1 with full optimization (no profiling)
* * level 2 - C1 with invocation and backedge counters
* * level 3 - C1 with full profiling (level 2 + MDO)
* * level 4 - C2
* * level 3 - C1 with full profiling (level 2 + All other MDO profiling information)
* * level 4 - C2 with full profile guided optimization
*
* The MethodData object is created by both the interpreter or either compiler to store any
* profiling information collected on a method (ciMethod::ensure_method_data() for C1 and C2
* and CompilationPolicy::create_mdo() for the interpreter). Both the interpreter and code
* compiled by C1 at level 3 will constantly update profiling information in the MDO during
* execution. The information in the MDO is then used by C1 and C2 during compilation, via
* the compiler interface (ciMethodXXX).
* See ciMethod.cpp and ciMethodData.cpp for information transfer from an MDO to the compilers
* through the compiler interface.
*
* Levels 0, 2 and 3 periodically notify the runtime about the current value of the counters
* (invocation counters and backedge counters). The frequency of these notifications is
Expand Down
4 changes: 3 additions & 1 deletion src/hotspot/share/oops/methodData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
class BytecodeStream;

// The MethodData object collects counts and other profile information
// during zeroth-tier (interpretive) and first-tier execution.
// during zeroth-tier (interpreter) and third-tier (C1 with full profiling)
// execution.
//
// The profile is used later by compilation heuristics. Some heuristics
// enable use of aggressive (or "heroic") optimizations. An aggressive
// optimization often has a down-side, a corner case that it handles
Expand Down

1 comment on commit 0ca5cb1

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.