Path: blob/master/src/hotspot/share/runtime/globals_shared.hpp
40951 views
/*1* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef SHARE_RUNTIME_GLOBALS_SHARED_HPP25#define SHARE_RUNTIME_GLOBALS_SHARED_HPP2627#include "utilities/align.hpp"28#include "utilities/globalDefinitions.hpp"29#include "utilities/macros.hpp"3031#include <float.h> // for DBL_MAX3233// The larger HeapWordSize for 64bit requires larger heaps34// for the same application running in 64bit. See bug 4967770.35// The minimum alignment to a heap word size is done. Other36// parts of the memory system may require additional alignment37// and are responsible for those alignments.38#ifdef _LP6439#define ScaleForWordSize(x) align_down((x) * 13 / 10, HeapWordSize)40#else41#define ScaleForWordSize(x) (x)42#endif4344// use this for flags that are true by default in the debug version but45// false in the optimized version, and vice versa46#ifdef ASSERT47#define trueInDebug true48#define falseInDebug false49#else50#define trueInDebug false51#define falseInDebug true52#endif5354// use this for flags that are true per default in the product build55// but false in development builds, and vice versa56#ifdef PRODUCT57#define trueInProduct true58#define falseInProduct false59#else60#define trueInProduct false61#define falseInProduct true62#endif6364// Only materialize src code for range checking when required, ignore otherwise65#define IGNORE_RANGE(a, b)66// Only materialize src code for contraint checking when required, ignore otherwise67#define IGNORE_CONSTRAINT(func,type)6869#define IGNORE_FLAG(...)7071#define DECLARE_PRODUCT_FLAG(type, name, value, ...) extern "C" type name;72#define DECLARE_PD_PRODUCT_FLAG(type, name, ...) extern "C" type name;73#ifdef PRODUCT74#define DECLARE_DEVELOPER_FLAG(type, name, value, ...) const type name = value;75#define DECLARE_PD_DEVELOPER_FLAG(type, name, ...) const type name = pd_##name;76#define DECLARE_NOTPRODUCT_FLAG(type, name, value, ...) const type name = value;77#else78#define DECLARE_DEVELOPER_FLAG(type, name, value, ...) extern "C" type name;79#define DECLARE_PD_DEVELOPER_FLAG(type, name, ...) extern "C" type name;80#define DECLARE_NOTPRODUCT_FLAG(type, name, value, ...) extern "C" type name;81#endif // PRODUCT8283#define DECLARE_FLAGS(flag_group) \84flag_group(DECLARE_DEVELOPER_FLAG, \85DECLARE_PD_DEVELOPER_FLAG, \86DECLARE_PRODUCT_FLAG, \87DECLARE_PD_PRODUCT_FLAG, \88DECLARE_NOTPRODUCT_FLAG, \89IGNORE_RANGE, \90IGNORE_CONSTRAINT)9192#define DECLARE_ARCH_FLAGS(flag_group) \93flag_group(DECLARE_DEVELOPER_FLAG, \94DECLARE_PRODUCT_FLAG, \95DECLARE_NOTPRODUCT_FLAG, \96IGNORE_RANGE, \97IGNORE_CONSTRAINT)9899#endif // SHARE_RUNTIME_GLOBALS_SHARED_HPP100101102