src/hotspot/share/gc/g1/g1AllocationContext.hpp
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 30764 hotspot/src/share/vm/gc/g1/g1AllocationContext.hpp@fec48bf5a827
child 49054 fa4c8865a4ff
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
26837
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
     1
/*
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 27897
diff changeset
     2
 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
26837
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
     4
 *
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
     7
 * published by the Free Software Foundation.
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
     8
 *
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    13
 * accompanied this code).
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    14
 *
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    18
 *
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    21
 * questions.
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    22
 *
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    23
 */
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    24
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 27897
diff changeset
    25
#ifndef SHARE_VM_GC_G1_G1ALLOCATIONCONTEXT_HPP
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 27897
diff changeset
    26
#define SHARE_VM_GC_G1_G1ALLOCATIONCONTEXT_HPP
26837
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    27
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    28
#include "memory/allocation.hpp"
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    29
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    30
typedef unsigned char AllocationContext_t;
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    31
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    32
class AllocationContext : AllStatic {
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    33
public:
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    34
  // Currently used context
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    35
  static AllocationContext_t current() {
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    36
    return 0;
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    37
  }
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    38
  // System wide default context
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    39
  static AllocationContext_t system() {
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    40
    return 0;
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    41
  }
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    42
};
72a43d3841e7 8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
diff changeset
    43
26841
d460d343d888 8057818: collect allocation context statistics at gc pauses
jcoomes
parents: 26837
diff changeset
    44
class AllocationContextStats: public StackObj {
d460d343d888 8057818: collect allocation context statistics at gc pauses
jcoomes
parents: 26837
diff changeset
    45
public:
d460d343d888 8057818: collect allocation context statistics at gc pauses
jcoomes
parents: 26837
diff changeset
    46
  inline void clear() { }
d460d343d888 8057818: collect allocation context statistics at gc pauses
jcoomes
parents: 26837
diff changeset
    47
  inline void update(bool full_gc) { }
27897
253140db0e9a 8065227: Report allocation context stats at end of cleanup
sjohanss
parents: 26843
diff changeset
    48
  inline void update_after_mark() { }
26843
1220c9e50fff 8057827: notify an obj when allocation context stats are available
jcoomes
parents: 26841
diff changeset
    49
  inline bool available() { return false; }
26841
d460d343d888 8057818: collect allocation context statistics at gc pauses
jcoomes
parents: 26837
diff changeset
    50
};
d460d343d888 8057818: collect allocation context statistics at gc pauses
jcoomes
parents: 26837
diff changeset
    51
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 27897
diff changeset
    52
#endif // SHARE_VM_GC_G1_G1ALLOCATIONCONTEXT_HPP