1 /*
   2  * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_RUNTIME_GLOBALS_SHARED_HPP
  26 #define SHARE_RUNTIME_GLOBALS_SHARED_HPP
  27 
  28 #include "gc/shared/jvmFlagConstraintsGC.hpp"           // FIXME -- to be moved to individual *globals.hpp file
  29 #include "runtime/flags/jvmFlagConstraintsCompiler.hpp" // FIXME -- to be moved to individual *globals.hpp file
  30 #include "runtime/flags/jvmFlagConstraintsRuntime.hpp"  // FIXME -- to be moved to individual *globals.hpp file
  31 #include "utilities/align.hpp"
  32 #include "utilities/globalDefinitions.hpp"
  33 #include "utilities/macros.hpp"
  34 
  35 #include <float.h> // for DBL_MAX
  36 
  37 // The larger HeapWordSize for 64bit requires larger heaps
  38 // for the same application running in 64bit.  See bug 4967770.
  39 // The minimum alignment to a heap word size is done.  Other
  40 // parts of the memory system may require additional alignment
  41 // and are responsible for those alignments.
  42 #ifdef _LP64
  43 #define ScaleForWordSize(x) align_down_((x) * 13 / 10, HeapWordSize)
  44 #else
  45 #define ScaleForWordSize(x) (x)
  46 #endif
  47 
  48 // use this for flags that are true per default in the tiered build
  49 // but false in non-tiered builds, and vice versa
  50 #ifdef TIERED
  51 #define  trueInTiered true
  52 #define falseInTiered false
  53 #else
  54 #define  trueInTiered false
  55 #define falseInTiered true
  56 #endif
  57 
  58 // use this for flags that are true by default in the debug version but
  59 // false in the optimized version, and vice versa
  60 #ifdef ASSERT
  61 #define trueInDebug  true
  62 #define falseInDebug false
  63 #else
  64 #define trueInDebug  false
  65 #define falseInDebug true
  66 #endif
  67 
  68 // use this for flags that are true per default in the product build
  69 // but false in development builds, and vice versa
  70 #ifdef PRODUCT
  71 #define trueInProduct  true
  72 #define falseInProduct false
  73 #else
  74 #define trueInProduct  false
  75 #define falseInProduct true
  76 #endif
  77 
  78 #endif // SHARE_RUNTIME_GLOBALS_SHARED_HPP