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

Empty methods should be considered trivial by SimpleThresholdPolicy

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 11
    • Fix Version/s: tbd
    • Component/s: hotspot
    • Labels:

      Description

      Adding method->is_empty_method() to SimpleThresholdPolicy::is_trivial(Method* method) would allow tiered compilation to shortcut an unnecessary pass through tier 3:

      diff -r 770679787db5 src/hotspot/share/runtime/simpleThresholdPolicy.inline.hpp
      --- a/src/hotspot/share/runtime/simpleThresholdPolicy.inline.hpp Thu Apr 26 17:14:04 2018 +0200
      +++ b/src/hotspot/share/runtime/simpleThresholdPolicy.inline.hpp Thu Apr 26 18:13:46 2018 +0200
      @@ -73,7 +73,8 @@
       // Determine if a given method is such a case.
       bool SimpleThresholdPolicy::is_trivial(Method* method) {
         if (method->is_accessor() ||
      - method->is_constant_getter()) {
      + method->is_constant_getter() ||
      + method->is_empty_method()) {
           return true;
         }
       #if INCLUDE_JVMCI

      The current Method::is_empty_method implicitly avoids treating Object.<init> as a trivial method, so it's possible that it'd be worthwhile to add an alternative method that would include Object.<init> by using java_code_at(0) == Bytecodes::_return rather than *code_base() == Bytecodes::_return

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                redestad Claes Redestad
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: