hotspot/src/share/vm/gc/g1/g1HRPrinter.hpp
author jiangli
Fri, 12 Jun 2015 19:49:54 -0400
changeset 31346 a70d45c06136
parent 30764 fec48bf5a827
child 33786 ac8da6513351
permissions -rw-r--r--
8042668: GC Support for shared heap ranges in CDS Summary: Added "Archive Region" support to the G1 GC Reviewed-by: tschatzl, brutisso Contributed-by: tom.benson@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10001
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
     1
/*
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 10001
diff changeset
     2
 * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
10001
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
     4
 *
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
     7
 * published by the Free Software Foundation.
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
     8
 *
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    13
 * accompanied this code).
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    14
 *
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    18
 *
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    21
 * questions.
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    22
 *
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    23
 */
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    24
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 10001
diff changeset
    25
#ifndef SHARE_VM_GC_G1_G1HRPRINTER_HPP
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 10001
diff changeset
    26
#define SHARE_VM_GC_G1_G1HRPRINTER_HPP
10001
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    27
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 10001
diff changeset
    28
#include "gc/g1/heapRegion.hpp"
10001
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    29
#include "memory/allocation.hpp"
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    30
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    31
#define SKIP_RETIRED_FULL_REGIONS 1
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    32
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    33
class G1HRPrinter VALUE_OBJ_CLASS_SPEC {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    34
public:
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    35
  typedef enum {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    36
    Alloc,
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    37
    AllocForce,
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    38
    Retire,
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    39
    Reuse,
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    40
    CSet,
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    41
    EvacFailure,
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    42
    Cleanup,
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    43
    PostCompaction,
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    44
    Commit,
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    45
    Uncommit
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    46
  } ActionType;
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    47
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    48
  typedef enum {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    49
    Unset,
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    50
    Eden,
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    51
    Survivor,
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    52
    Old,
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    53
    SingleHumongous,
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    54
    StartsHumongous,
31346
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
    55
    ContinuesHumongous,
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
    56
    Archive
10001
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    57
  } RegionType;
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    58
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    59
  typedef enum {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    60
    StartGC,
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    61
    EndGC,
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    62
    StartFullGC,
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    63
    EndFullGC
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    64
  } PhaseType;
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    65
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    66
private:
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    67
  bool _active;
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    68
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    69
  static const char* action_name(ActionType action);
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    70
  static const char* region_type_name(RegionType type);
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    71
  static const char* phase_name(PhaseType phase);
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    72
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    73
  // Print an action event. This version is used in most scenarios and
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    74
  // only prints the region's bottom. The parameters type and top are
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    75
  // optional (the "not set" values are Unset and NULL).
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    76
  static void print(ActionType action, RegionType type,
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    77
                    HeapRegion* hr, HeapWord* top);
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    78
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    79
  // Print an action event. This version prints both the region's
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    80
  // bottom and end. Used for Commit / Uncommit events.
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    81
  static void print(ActionType action, HeapWord* bottom, HeapWord* end);
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    82
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    83
  // Print a phase event.
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    84
  static void print(PhaseType phase, size_t phase_num);
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    85
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    86
public:
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    87
  // In some places we iterate over a list in order to generate output
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    88
  // for the list's elements. By exposing this we can avoid this
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    89
  // iteration if the printer is not active.
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    90
  const bool is_active() { return _active; }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    91
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    92
  // Have to set this explicitly as we have to do this during the
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    93
  // heap's initialize() method, not in the constructor.
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    94
  void set_active(bool active) { _active = active; }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    95
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    96
  // The methods below are convenient wrappers for the print() methods.
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    97
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    98
  void alloc(HeapRegion* hr, RegionType type, bool force = false) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
    99
    if (is_active()) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   100
      print((!force) ? Alloc : AllocForce, type, hr, NULL);
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   101
    }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   102
  }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   103
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   104
  void alloc(RegionType type, HeapRegion* hr, HeapWord* top) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   105
    if (is_active()) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   106
      print(Alloc, type, hr, top);
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   107
    }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   108
  }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   109
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   110
  void retire(HeapRegion* hr) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   111
    if (is_active()) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   112
      if (!SKIP_RETIRED_FULL_REGIONS || hr->top() < hr->end()) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   113
        print(Retire, Unset, hr, hr->top());
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   114
      }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   115
    }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   116
  }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   117
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   118
  void reuse(HeapRegion* hr) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   119
    if (is_active()) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   120
      print(Reuse, Unset, hr, NULL);
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   121
    }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   122
  }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   123
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   124
  void cset(HeapRegion* hr) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   125
    if (is_active()) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   126
      print(CSet, Unset, hr, NULL);
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   127
    }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   128
  }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   129
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   130
  void evac_failure(HeapRegion* hr) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   131
    if (is_active()) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   132
      print(EvacFailure, Unset, hr, NULL);
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   133
    }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   134
  }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   135
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   136
  void cleanup(HeapRegion* hr) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   137
    if (is_active()) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   138
      print(Cleanup, Unset, hr, NULL);
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   139
    }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   140
  }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   141
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   142
  void post_compaction(HeapRegion* hr, RegionType type) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   143
    if (is_active()) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   144
      print(PostCompaction, type, hr, hr->top());
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   145
    }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   146
  }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   147
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   148
  void commit(HeapWord* bottom, HeapWord* end) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   149
    if (is_active()) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   150
      print(Commit, bottom, end);
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   151
    }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   152
  }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   153
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   154
  void uncommit(HeapWord* bottom, HeapWord* end) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   155
    if (is_active()) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   156
      print(Uncommit, bottom, end);
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   157
    }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   158
  }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   159
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   160
  void start_gc(bool full, size_t gc_num) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   161
    if (is_active()) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   162
      if (!full) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   163
        print(StartGC, gc_num);
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   164
      } else {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   165
        print(StartFullGC, gc_num);
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   166
      }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   167
    }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   168
  }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   169
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   170
  void end_gc(bool full, size_t gc_num) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   171
    if (is_active()) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   172
      if (!full) {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   173
        print(EndGC, gc_num);
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   174
      } else {
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   175
        print(EndFullGC, gc_num);
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   176
      }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   177
    }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   178
  }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   179
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   180
  G1HRPrinter() : _active(false) { }
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   181
};
8aa7f885326e 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
tonyp
parents:
diff changeset
   182
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 10001
diff changeset
   183
#endif // SHARE_VM_GC_G1_G1HRPRINTER_HPP