src/hotspot/share/gc/epsilon/epsilonArguments.cpp
author shade
Fri, 19 Jan 2018 12:24:15 +0100
branchepsilon-gc-branch
changeset 56028 267a6ce379ba
parent 56022 dd005db4ec5c
child 56350 56014b46de69
permissions -rw-r--r--
Use proper flag aliasing machinery. Avoid setting immutable develop flags in release builds.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
55935
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
     1
/*
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
     2
 * Copyright (c) 2017, Red Hat, Inc. and/or its affiliates.
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
     4
 *
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
     7
 * published by the Free Software Foundation.
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
     8
 *
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    13
 * accompanied this code).
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    14
 *
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    18
 *
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    21
 * questions.
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    22
 *
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    23
 */
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    24
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    25
#include "precompiled.hpp"
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    26
#include "gc/epsilon/epsilonArguments.hpp"
55939
c5c3e1a5c3f0 Rename EpsilonCollectedHeap to EpsilonHeap.
shade
parents: 55935
diff changeset
    27
#include "gc/epsilon/epsilonHeap.hpp"
55935
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    28
#include "gc/epsilon/epsilonCollectorPolicy.hpp"
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    29
#include "gc/shared/gcArguments.inline.hpp"
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    30
#include "runtime/globals.hpp"
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    31
#include "runtime/globals_extension.hpp"
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    32
#include "runtime/vm_version.hpp"
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    33
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    34
size_t EpsilonArguments::conservative_max_heap_alignment() {
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    35
  return UseLargePages ? os::large_page_size() : os::vm_page_size();
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    36
}
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    37
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    38
void EpsilonArguments::initialize_flags() {
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    39
  GCArguments::initialize_flags();
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    40
56028
267a6ce379ba Use proper flag aliasing machinery. Avoid setting immutable develop flags in release builds.
shade
parents: 56022
diff changeset
    41
  assert(UseEpsilonGC, "Error");
55935
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    42
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    43
  // Forcefully exit when OOME is detected. Nothing we can do at that point.
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    44
  if (FLAG_IS_DEFAULT(ExitOnOutOfMemoryError)) {
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    45
    FLAG_SET_DEFAULT(ExitOnOutOfMemoryError, true);
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    46
  }
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    47
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    48
#if INCLUDE_ALL_GCS
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    49
  if (EpsilonMaxTLABSize < MinTLABSize) {
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    50
    warning("EpsilonMaxTLABSize < MinTLABSize, adjusting it to " SIZE_FORMAT, MinTLABSize);
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    51
    EpsilonMaxTLABSize = MinTLABSize;
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    52
  }
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    53
#endif
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    54
}
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    55
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    56
CollectedHeap* EpsilonArguments::create_heap() {
55939
c5c3e1a5c3f0 Rename EpsilonCollectedHeap to EpsilonHeap.
shade
parents: 55935
diff changeset
    57
  return create_heap_with_policy<EpsilonHeap, EpsilonCollectorPolicy>();
55935
f4e069848424 Fixup Epsilon for GC interface updates
shade
parents:
diff changeset
    58
}