Top


定義場所(file name)

hotspot/src/share/vm/classfile/systemDictionary.cpp

名前(function name)

  static void print() {

本体部(body)

  {- -------------------------------------------
  (1) SystemDictionary::methods_do() でメソッド情報を取得し, 結果を出力する.
      ---------------------------------------- -}

        initialize();
        SystemDictionary::methods_do(do_method);
        // generate output
        tty->cr();
        tty->print_cr("Method statistics (static):");
        // flag distribution
        tty->cr();
        tty->print_cr("%6d final        methods  %6.1f%%", _number_of_final_methods       , _number_of_final_methods        * 100.0F / _number_of_methods);
        tty->print_cr("%6d static       methods  %6.1f%%", _number_of_static_methods      , _number_of_static_methods       * 100.0F / _number_of_methods);
        tty->print_cr("%6d native       methods  %6.1f%%", _number_of_native_methods      , _number_of_native_methods       * 100.0F / _number_of_methods);
        tty->print_cr("%6d synchronized methods  %6.1f%%", _number_of_synchronized_methods, _number_of_synchronized_methods * 100.0F / _number_of_methods);
        tty->print_cr("%6d profiled     methods  %6.1f%%", _number_of_profiled_methods, _number_of_profiled_methods * 100.0F / _number_of_methods);
        // parameter size profile
        tty->cr();
        { int tot = 0;
          int avg = 0;
          for (int i = 0; i < max_parameter_size; i++) {
            int n = _parameter_size_profile[i];
            tot += n;
            avg += n*i;
            tty->print_cr("parameter size = %1d: %6d methods  %5.1f%%", i, n, n * 100.0F / _number_of_methods);
          }
          assert(tot == _number_of_methods, "should be the same");
          tty->print_cr("                    %6d methods  100.0%%", _number_of_methods);
          tty->print_cr("(average parameter size = %3.1f including receiver, if any)", (float)avg / _number_of_methods);
        }
        // bytecodes profile
        tty->cr();
        { int tot = 0;
          for (int i = 0; i < Bytecodes::number_of_java_codes; i++) {
            if (Bytecodes::is_defined(i)) {
              Bytecodes::Code c = Bytecodes::cast(i);
              int n = _bytecodes_profile[c];
              tot += n;
              tty->print_cr("%9d  %7.3f%%  %s", n, n * 100.0F / _number_of_bytecodes, Bytecodes::name(c));
            }
          }
          assert(tot == _number_of_bytecodes, "should be the same");
          tty->print_cr("%9d  100.000%%", _number_of_bytecodes);
        }
        tty->cr();
      }

This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.