hotspot/src/share/vm/gc/g1/heapRegionType.hpp
author kbarrett
Tue, 22 Nov 2016 20:50:31 -0500
changeset 42589 037b433e8069
parent 36098 e056a98ac7ca
child 46810 7dad333205cd
permissions -rw-r--r--
8166811: Missing memory fences between memory allocation and refinement Summary: Refactored to have needed barrier Reviewed-by: tschatzl, ehelin
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
/*
42589
037b433e8069 8166811: Missing memory fences between memory allocation and refinement
kbarrett
parents: 36098
diff changeset
     2
 * Copyright (c) 2014, 2016, 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
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 26846
diff changeset
    25
#ifndef SHARE_VM_GC_G1_HEAPREGIONTYPE_HPP
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 26846
diff changeset
    26
#define SHARE_VM_GC_G1_HEAPREGIONTYPE_HPP
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    27
36098
e056a98ac7ca 8149650: Create a trace event for G1 heap region type transitions
david
parents: 33105
diff changeset
    28
#include "gc/g1/g1HeapRegionTraceType.hpp"
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    29
#include "memory/allocation.hpp"
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    30
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    31
#define hrt_assert_is_valid(tag) \
33105
294e48b4f704 8080775: Better argument formatting for assert() and friends
david
parents: 32623
diff changeset
    32
  assert(is_valid((tag)), "invalid HR type: %u", (uint) (tag))
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    33
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    34
class HeapRegionType VALUE_OBJ_CLASS_SPEC {
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    35
private:
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    36
  // We encode the value of the heap region type so the generation can be
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    37
  // determined quickly. The tag is split into two parts:
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    38
  //
32623
390a27af5657 8134626: Misc cleanups after generation array removal
jwilhelm
parents: 31346
diff changeset
    39
  //   major type (young, old, humongous, archive)           : top N-1 bits
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    40
  //   minor type (eden / survivor, starts / cont hum, etc.) : bottom 1 bit
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    41
  //
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    42
  // If there's need to increase the number of minor types in the
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    43
  // future, we'll have to increase the size of the latter and hence
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    44
  // decrease the size of the former.
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    45
  //
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    46
  // 0000 0 [ 0] Free
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    47
  //
31346
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
    48
  // 0001 0 [ 2] Young Mask
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    49
  // 0001 0 [ 2] Eden
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    50
  // 0001 1 [ 3] Survivor
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    51
  //
31346
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
    52
  // 0010 0 [ 4] Humongous Mask
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
    53
  // 0100 0 [ 8] Pinned Mask
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
    54
  // 0110 0 [12] Starts Humongous
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
    55
  // 0110 1 [13] Continues Humongous
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    56
  //
31346
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
    57
  // 1000 0 [16] Old Mask
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
    58
  //
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
    59
  // 1100 0 [24] Archive
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    60
  typedef enum {
26846
7d4376f8560e 8058495: G1: normalize names for isHumongous() and friends
tonyp
parents: 26696
diff changeset
    61
    FreeTag               = 0,
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    62
26846
7d4376f8560e 8058495: G1: normalize names for isHumongous() and friends
tonyp
parents: 26696
diff changeset
    63
    YoungMask             = 2,
7d4376f8560e 8058495: G1: normalize names for isHumongous() and friends
tonyp
parents: 26696
diff changeset
    64
    EdenTag               = YoungMask,
7d4376f8560e 8058495: G1: normalize names for isHumongous() and friends
tonyp
parents: 26696
diff changeset
    65
    SurvTag               = YoungMask + 1,
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    66
26846
7d4376f8560e 8058495: G1: normalize names for isHumongous() and friends
tonyp
parents: 26696
diff changeset
    67
    HumongousMask         = 4,
31346
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
    68
    PinnedMask            = 8,
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
    69
    StartsHumongousTag    = HumongousMask | PinnedMask,
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
    70
    ContinuesHumongousTag = HumongousMask | PinnedMask + 1,
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    71
31346
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
    72
    OldMask               = 16,
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
    73
    OldTag                = OldMask,
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
    74
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
    75
    ArchiveTag            = PinnedMask | OldMask
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    76
  } Tag;
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    77
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    78
  volatile Tag _tag;
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    79
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    80
  static bool is_valid(Tag tag);
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    81
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    82
  Tag get() const {
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    83
    hrt_assert_is_valid(_tag);
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    84
    return _tag;
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    85
  }
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    86
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    87
  // Sets the type to 'tag'.
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    88
  void set(Tag tag) {
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    89
    hrt_assert_is_valid(tag);
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    90
    hrt_assert_is_valid(_tag);
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    91
    _tag = tag;
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    92
  }
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    93
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    94
  // Sets the type to 'tag', expecting the type to be 'before'. This
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    95
  // is available for when we want to add sanity checking to the type
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    96
  // transition.
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    97
  void set_from(Tag tag, Tag before) {
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    98
    hrt_assert_is_valid(tag);
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
    99
    hrt_assert_is_valid(before);
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   100
    hrt_assert_is_valid(_tag);
33105
294e48b4f704 8080775: Better argument formatting for assert() and friends
david
parents: 32623
diff changeset
   101
    assert(_tag == before, "HR tag: %u, expected: %u new tag; %u", _tag, before, tag);
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   102
    _tag = tag;
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   103
  }
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   104
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   105
public:
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   106
  // Queries
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   107
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   108
  bool is_free() const { return get() == FreeTag; }
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   109
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   110
  bool is_young()    const { return (get() & YoungMask) != 0; }
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   111
  bool is_eden()     const { return get() == EdenTag;  }
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   112
  bool is_survivor() const { return get() == SurvTag;  }
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   113
26846
7d4376f8560e 8058495: G1: normalize names for isHumongous() and friends
tonyp
parents: 26696
diff changeset
   114
  bool is_humongous()           const { return (get() & HumongousMask) != 0;   }
7d4376f8560e 8058495: G1: normalize names for isHumongous() and friends
tonyp
parents: 26696
diff changeset
   115
  bool is_starts_humongous()    const { return get() == StartsHumongousTag;    }
7d4376f8560e 8058495: G1: normalize names for isHumongous() and friends
tonyp
parents: 26696
diff changeset
   116
  bool is_continues_humongous() const { return get() == ContinuesHumongousTag; }
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   117
31346
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
   118
  bool is_archive() const { return get() == ArchiveTag; }
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
   119
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
   120
  // is_old regions may or may not also be pinned
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
   121
  bool is_old() const { return (get() & OldMask) != 0; }
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
   122
42589
037b433e8069 8166811: Missing memory fences between memory allocation and refinement
kbarrett
parents: 36098
diff changeset
   123
  bool is_old_or_humongous() const { return (get() & (OldMask | HumongousMask)) != 0; }
037b433e8069 8166811: Missing memory fences between memory allocation and refinement
kbarrett
parents: 36098
diff changeset
   124
31346
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
   125
  // is_pinned regions may be archive or humongous
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
   126
  bool is_pinned() const { return (get() & PinnedMask) != 0; }
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   127
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   128
  // Setters
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   129
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   130
  void set_free() { set(FreeTag); }
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   131
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   132
  void set_eden()        { set_from(EdenTag, FreeTag); }
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   133
  void set_eden_pre_gc() { set_from(EdenTag, SurvTag); }
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   134
  void set_survivor()    { set_from(SurvTag, FreeTag); }
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   135
26846
7d4376f8560e 8058495: G1: normalize names for isHumongous() and friends
tonyp
parents: 26696
diff changeset
   136
  void set_starts_humongous()    { set_from(StartsHumongousTag,    FreeTag); }
7d4376f8560e 8058495: G1: normalize names for isHumongous() and friends
tonyp
parents: 26696
diff changeset
   137
  void set_continues_humongous() { set_from(ContinuesHumongousTag, FreeTag); }
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   138
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   139
  void set_old() { set(OldTag); }
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   140
31346
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
   141
  void set_archive() { set_from(ArchiveTag, FreeTag); }
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
   142
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   143
  // Misc
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   144
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   145
  const char* get_str() const;
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   146
  const char* get_short_str() const;
36098
e056a98ac7ca 8149650: Create a trace event for G1 heap region type transitions
david
parents: 33105
diff changeset
   147
  G1HeapRegionTraceType::Type get_trace_type();
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   148
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   149
  HeapRegionType() : _tag(FreeTag) { hrt_assert_is_valid(_tag); }
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   150
};
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents:
diff changeset
   151
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 26846
diff changeset
   152
#endif // SHARE_VM_GC_G1_HEAPREGIONTYPE_HPP