hotspot/src/share/vm/gc/g1/heapRegionType.cpp
author pliden
Wed, 13 May 2015 15:16:06 +0200
changeset 30764 fec48bf5a827
parent 26846 hotspot/src/share/vm/gc_implementation/g1/heapRegionType.cpp@7d4376f8560e
child 31346 a70d45c06136
permissions -rw-r--r--
8079792: GC directory structure cleanup Reviewed-by: brutisso, stefank, david
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
     1
/*
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 26846
diff changeset
     2
 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
     4
 *
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
     7
 * published by the Free Software Foundation.
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
     8
 *
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    13
 * accompanied this code).
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    14
 *
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    18
 *
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    21
 * questions.
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    22
 *
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    23
 */
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    24
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    25
#include "precompiled.hpp"
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 26846
diff changeset
    26
#include "gc/g1/heapRegionType.hpp"
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    27
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    28
bool HeapRegionType::is_valid(Tag tag) {
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    29
  switch (tag) {
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    30
    case FreeTag:
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    31
    case EdenTag:
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    32
    case SurvTag:
26846
7d4376f8560e 8058495: G1: normalize names for isHumongous() and friends
tonyp
parents: 26696
diff changeset
    33
    case StartsHumongousTag:
7d4376f8560e 8058495: G1: normalize names for isHumongous() and friends
tonyp
parents: 26696
diff changeset
    34
    case ContinuesHumongousTag:
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    35
    case OldTag:
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    36
      return true;
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    37
  }
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    38
  return false;
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    39
}
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    40
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    41
const char* HeapRegionType::get_str() const {
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    42
  hrt_assert_is_valid(_tag);
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    43
  switch (_tag) {
26846
7d4376f8560e 8058495: G1: normalize names for isHumongous() and friends
tonyp
parents: 26696
diff changeset
    44
    case FreeTag:               return "FREE";
7d4376f8560e 8058495: G1: normalize names for isHumongous() and friends
tonyp
parents: 26696
diff changeset
    45
    case EdenTag:               return "EDEN";
7d4376f8560e 8058495: G1: normalize names for isHumongous() and friends
tonyp
parents: 26696
diff changeset
    46
    case SurvTag:               return "SURV";
7d4376f8560e 8058495: G1: normalize names for isHumongous() and friends
tonyp
parents: 26696
diff changeset
    47
    case StartsHumongousTag:    return "HUMS";
7d4376f8560e 8058495: G1: normalize names for isHumongous() and friends
tonyp
parents: 26696
diff changeset
    48
    case ContinuesHumongousTag: return "HUMC";
7d4376f8560e 8058495: G1: normalize names for isHumongous() and friends
tonyp
parents: 26696
diff changeset
    49
    case OldTag:                return "OLD";
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    50
  }
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    51
  ShouldNotReachHere();
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    52
  // keep some compilers happy
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    53
  return NULL;
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    54
}
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    55
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    56
const char* HeapRegionType::get_short_str() const {
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    57
  hrt_assert_is_valid(_tag);
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    58
  switch (_tag) {
26846
7d4376f8560e 8058495: G1: normalize names for isHumongous() and friends
tonyp
parents: 26696
diff changeset
    59
    case FreeTag:               return "F";
7d4376f8560e 8058495: G1: normalize names for isHumongous() and friends
tonyp
parents: 26696
diff changeset
    60
    case EdenTag:               return "E";
7d4376f8560e 8058495: G1: normalize names for isHumongous() and friends
tonyp
parents: 26696
diff changeset
    61
    case SurvTag:               return "S";
7d4376f8560e 8058495: G1: normalize names for isHumongous() and friends
tonyp
parents: 26696
diff changeset
    62
    case StartsHumongousTag:    return "HS";
7d4376f8560e 8058495: G1: normalize names for isHumongous() and friends
tonyp
parents: 26696
diff changeset
    63
    case ContinuesHumongousTag: return "HC";
7d4376f8560e 8058495: G1: normalize names for isHumongous() and friends
tonyp
parents: 26696
diff changeset
    64
    case OldTag:                return "O";
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    65
  }
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    66
  ShouldNotReachHere();
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    67
  // keep some compilers happy
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    68
  return NULL;
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    69
}