What does CompileThreshold, Tier2CompileThreshold, Tier3CompileThreshold and Tier4CompileThreshold control?

前端 未结 1 1933
走了就别回头了
走了就别回头了 2020-12-13 05:03

HotSpot\'s tiered compilation uses the interpreter until a threshold of invocations (for methods) or iterations (for loops) triggers a client compilation with self-profiling

相关标签:
1条回答
  • 2020-12-13 05:35

    The comments in advancedThresholdPolicy.hpp discuss the different compiler tiers and the thresholds. See that file for a deeper discussion.

    The system supports 5 execution levels:

    • Tier 0 - interpreter
    • Tier 1 - C1 with full optimization (no profiling)
    • Tier 2 - C1 with invocation and backedge counters
    • Tier 3 - C1 with full profiling (level 2 + MDO)
    • Tier 4 - C2

    C1 is the client compiler. C2 is the server compiler.

    In the common case, the compilation goes: 0 → 3 → 4. Atypical cases are used based on C1 and C2 queue lengths. Tier 2 is used when the C2 queue length is too long so that the method can execute about 30% faster until the C2 can process the profiling information. If the method is determined to be trivial, then it is compiled with Tier 1 since it will produce the same code as Tier 4.

    Thresholds are dynamically adjusted based on the length of the C1 and C2 queues.

    0 讨论(0)
提交回复
热议问题