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

methods_do() always run at exit

XMLWordPrintable

    • b11

      This should have more parenthesis in java.cpp. The lack of parenthesis makes this always true, and we always run SystemDictionary::methods_do. The collect_profiled_methods function has a conditional that won't add the method, so this is a useless iteration through the methods at exit.

      void print_method_profiling_data() {
        if (ProfileInterpreter COMPILER1_PRESENT(|| C1UpdateMethodData) &&
           (PrintMethodData || CompilerOracle::should_print_methods())) {
          ResourceMark rm;
          collected_profiled_methods = new GrowableArray<Method*>(1024);
          SystemDictionary::methods_do(collect_profiled_methods);
          collected_profiled_methods->sort(&compare_methods);

      There are no tests for -XX:+PrintMethodData so one should be added with this bug fix.

            tholenstein Tobias Holenstein (Inactive)
            coleenp Coleen Phillimore
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: