1 /* 2 * Copyright (c) 2000, 2019, 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 #include "precompiled.hpp" 26 #include "jvm.h" 27 #include "jvmci/jvmci_globals.hpp" 28 #include "gc/shared/gcConfig.hpp" 29 #include "utilities/defaultStream.hpp" 30 #include "utilities/ostream.hpp" 31 #include "runtime/globals_extension.hpp" 32 33 fileStream* JVMCIGlobals::_jni_config_file = NULL; 34 35 // Return true if jvmci flags are consistent. 36 bool JVMCIGlobals::check_jvmci_flags_are_consistent() { 37 38 #ifndef PRODUCT 39 #define APPLY_JVMCI_FLAGS(params3, params4) \ 40 JVMCI_FLAGS(params4, params3, params4, params3, params4, params3, params4, params4, IGNORE_RANGE, IGNORE_CONSTRAINT, IGNORE_WRITEABLE) 41 #define JVMCI_DECLARE_CHECK4(type, name, value, doc) bool name##checked = false; 42 #define JVMCI_DECLARE_CHECK3(type, name, doc) bool name##checked = false; 43 #define JVMCI_FLAG_CHECKED(name) name##checked = true; 44 APPLY_JVMCI_FLAGS(JVMCI_DECLARE_CHECK3, JVMCI_DECLARE_CHECK4) 45 #else 46 #define JVMCI_FLAG_CHECKED(name) 47 #endif 48 49 // Checks that a given flag is not set if a given guard flag is false. 50 #define CHECK_NOT_SET(FLAG, GUARD) \ 51 JVMCI_FLAG_CHECKED(FLAG) \ 52 if (!GUARD && !FLAG_IS_DEFAULT(FLAG)) { \ 53 jio_fprintf(defaultStream::error_stream(), \ 54 "Improperly specified VM option '%s': '%s' must be enabled\n", #FLAG, #GUARD); \ 55 return false; \ 56 } 57 58 if (EnableJVMCIProduct) { 59 if (FLAG_IS_DEFAULT(EnableJVMCI)) { 60 FLAG_SET_DEFAULT(EnableJVMCI, true); | 1 /* 2 * Copyright (c) 2000, 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 #include "precompiled.hpp" 26 #include "jvm.h" 27 #include "jvmci/jvmci_globals.hpp" 28 #include "gc/shared/gcConfig.hpp" 29 #include "utilities/defaultStream.hpp" 30 #include "utilities/ostream.hpp" 31 #include "runtime/globals_extension.hpp" 32 33 fileStream* JVMCIGlobals::_jni_config_file = NULL; 34 35 // Return true if jvmci flags are consistent. 36 bool JVMCIGlobals::check_jvmci_flags_are_consistent() { 37 38 #ifndef PRODUCT 39 #define APPLY_JVMCI_FLAGS(params3, params4) \ 40 JVMCI_FLAGS(params4, params3, params4, params3, params4, params3, params4, params4, IGNORE_RANGE, IGNORE_CONSTRAINT) 41 #define JVMCI_DECLARE_CHECK4(type, name, value, doc) bool name##checked = false; 42 #define JVMCI_DECLARE_CHECK3(type, name, doc) bool name##checked = false; 43 #define JVMCI_FLAG_CHECKED(name) name##checked = true; 44 APPLY_JVMCI_FLAGS(JVMCI_DECLARE_CHECK3, JVMCI_DECLARE_CHECK4) 45 #else 46 #define JVMCI_FLAG_CHECKED(name) 47 #endif 48 49 // Checks that a given flag is not set if a given guard flag is false. 50 #define CHECK_NOT_SET(FLAG, GUARD) \ 51 JVMCI_FLAG_CHECKED(FLAG) \ 52 if (!GUARD && !FLAG_IS_DEFAULT(FLAG)) { \ 53 jio_fprintf(defaultStream::error_stream(), \ 54 "Improperly specified VM option '%s': '%s' must be enabled\n", #FLAG, #GUARD); \ 55 return false; \ 56 } 57 58 if (EnableJVMCIProduct) { 59 if (FLAG_IS_DEFAULT(EnableJVMCI)) { 60 FLAG_SET_DEFAULT(EnableJVMCI, true); |