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

Incorrect ifdef in compilationMemoryStatistic.cpp

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • 25
    • hotspot
    • b21

      The first ifdef in the code below (from compilationMemoryStatistic.cpp) should be COMPILER1 instead of COMPILER 2. Not a bug, just extra code included when building with C2 but not C1.

      #ifdef COMPILER2
          // C1: print allocations broken down by arena types
          if (_comp_type == CompilerType::compiler_c1) {
            st->print("[");
            size_t sums[arena_tag_max];
            _counters_at_global_peak.summarize(sums);
            bool print_comma = false;
            for (int i = 0; i < arena_tag_max; i++) {
              if (sums[i] > 0) {
                if (print_comma) {
                  st->print_raw(", ");
                }
                st->print("%s %zu", Arena::tag_name[i], sums[i]);
                print_comma = true;
              }
            }
            st->print_cr("]");
          }
      #endif // COMPILER1
      #ifdef COMPILER2
          // C2: print counters and timeline on multiple lines, indented
          if (_comp_type == CompilerType::compiler_c2) {
            streamIndentor si(st, 4);
            st->cr();
            st->print_cr("--- Arena Usage by Arena Type and compilation phase, at arena usage peak of %zu ---", _peak);
            {
              streamIndentor si(st, 4);
             _counters_at_global_peak.print_on(st);
            }
            st->print_cr("--- Allocation timelime by phase ---");
            {
              streamIndentor si(st, 4);
              _timeline.print_on(st);
            }
            st->print_cr("---");
          }
      #endif

            jsikstro Joel Sikstrom
            jsikstro Joel Sikstrom
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: