Mon, 05 Dec 2011 12:50:00 -0500
7117389: Add a framework for vendor-specific command line switch extensions to Hotspot
Summary: Add a file, globals_ext.hpp, containing a null interface, to be replaced by a vendor in altsrc as needed.
Reviewed-by: coleenp, kamg, dholmes, johnc, jrose
1.1 --- a/src/share/vm/runtime/globals.cpp Wed Nov 30 12:48:52 2011 -0500 1.2 +++ b/src/share/vm/runtime/globals.cpp Mon Dec 05 12:50:00 2011 -0500 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -55,10 +55,13 @@ 1.11 MATERIALIZE_PRODUCT_FLAG, MATERIALIZE_PD_PRODUCT_FLAG, \ 1.12 MATERIALIZE_DIAGNOSTIC_FLAG, MATERIALIZE_NOTPRODUCT_FLAG) 1.13 1.14 +MATERIALIZE_FLAGS_EXT 1.15 + 1.16 + 1.17 bool Flag::is_unlocker() const { 1.18 return strcmp(name, "UnlockDiagnosticVMOptions") == 0 || 1.19 - strcmp(name, "UnlockExperimentalVMOptions") == 0; 1.20 - 1.21 + strcmp(name, "UnlockExperimentalVMOptions") == 0 || 1.22 + is_unlocker_ext(); 1.23 } 1.24 1.25 bool Flag::is_unlocked() const { 1.26 @@ -74,7 +77,7 @@ 1.27 strcmp(kind, "{C2 experimental}") == 0) { 1.28 return UnlockExperimentalVMOptions; 1.29 } else { 1.30 - return true; 1.31 + return is_unlocked_ext(); 1.32 } 1.33 } 1.34 1.35 @@ -241,6 +244,7 @@ 1.36 #ifdef SHARK 1.37 SHARK_FLAGS(SHARK_DEVELOP_FLAG_STRUCT, SHARK_PD_DEVELOP_FLAG_STRUCT, SHARK_PRODUCT_FLAG_STRUCT, SHARK_PD_PRODUCT_FLAG_STRUCT, SHARK_DIAGNOSTIC_FLAG_STRUCT, SHARK_NOTPRODUCT_FLAG_STRUCT) 1.38 #endif 1.39 + FLAGTABLE_EXT 1.40 {0, NULL, NULL} 1.41 }; 1.42
2.1 --- a/src/share/vm/runtime/globals.hpp Wed Nov 30 12:48:52 2011 -0500 2.2 +++ b/src/share/vm/runtime/globals.hpp Mon Dec 05 12:50:00 2011 -0500 2.3 @@ -243,6 +243,9 @@ 2.4 bool is_writeable() const; 2.5 bool is_external() const; 2.6 2.7 + bool is_unlocker_ext() const; 2.8 + bool is_unlocked_ext() const; 2.9 + 2.10 void print_on(outputStream* st, bool withComments = false ); 2.11 void print_as_flag(outputStream* st); 2.12 }; 2.13 @@ -3907,4 +3910,8 @@ 2.14 2.15 RUNTIME_OS_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_NOTPRODUCT_FLAG) 2.16 2.17 +// Extensions 2.18 + 2.19 +#include "runtime/globals_ext.hpp" 2.20 + 2.21 #endif // SHARE_VM_RUNTIME_GLOBALS_HPP
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/src/share/vm/runtime/globals_ext.hpp Mon Dec 05 12:50:00 2011 -0500 3.3 @@ -0,0 +1,56 @@ 3.4 +/* 3.5 + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved. 3.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3.7 + * 3.8 + * This code is free software; you can redistribute it and/or modify it 3.9 + * under the terms of the GNU General Public License version 2 only, as 3.10 + * published by the Free Software Foundation. 3.11 + * 3.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 3.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 3.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 3.15 + * version 2 for more details (a copy is included in the LICENSE file that 3.16 + * accompanied this code). 3.17 + * 3.18 + * You should have received a copy of the GNU General Public License version 3.19 + * 2 along with this work; if not, write to the Free Software Foundation, 3.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 3.21 + * 3.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 3.23 + * or visit www.oracle.com if you need additional information or have any 3.24 + * questions. 3.25 + * 3.26 + */ 3.27 + 3.28 +#ifndef SHARE_VM_RUNTIME_GLOBALS_EXT_HPP 3.29 +#define SHARE_VM_RUNTIME_GLOBALS_EXT_HPP 3.30 + 3.31 +// globals_extension.hpp extension 3.32 + 3.33 +// Additional CommandLineFlags enum values 3.34 +#define COMMANDLINEFLAG_EXT 3.35 + 3.36 +// Additional CommandLineFlagsWithType enum values 3.37 +#define COMMANDLINEFLAGWITHTYPE_EXT 3.38 + 3.39 + 3.40 +// globals.cpp extension 3.41 + 3.42 +// Additional flag definitions 3.43 +#define MATERIALIZE_FLAGS_EXT 3.44 + 3.45 +// Additional flag descriptors: see flagTable definition 3.46 +#define FLAGTABLE_EXT 3.47 + 3.48 + 3.49 +// Default method implementations 3.50 + 3.51 +inline bool Flag::is_unlocker_ext() const { 3.52 + return false; 3.53 +} 3.54 + 3.55 +inline bool Flag::is_unlocked_ext() const { 3.56 + return true; 3.57 +} 3.58 + 3.59 +#endif // SHARE_VM_RUNTIME_GLOBALS_EXT_HPP
4.1 --- a/src/share/vm/runtime/globals_extension.hpp Wed Nov 30 12:48:52 2011 -0500 4.2 +++ b/src/share/vm/runtime/globals_extension.hpp Mon Dec 05 12:50:00 2011 -0500 4.3 @@ -1,5 +1,5 @@ 4.4 /* 4.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 4.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 4.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4.8 * 4.9 * This code is free software; you can redistribute it and/or modify it 4.10 @@ -93,6 +93,7 @@ 4.11 #ifdef COMPILER2 4.12 C2_FLAGS(C2_DEVELOP_FLAG_MEMBER, C2_PD_DEVELOP_FLAG_MEMBER, C2_PRODUCT_FLAG_MEMBER, C2_PD_PRODUCT_FLAG_MEMBER, C2_DIAGNOSTIC_FLAG_MEMBER, C2_EXPERIMENTAL_FLAG_MEMBER, C2_NOTPRODUCT_FLAG_MEMBER) 4.13 #endif 4.14 + COMMANDLINEFLAG_EXT 4.15 NUM_CommandLineFlag 4.16 } CommandLineFlag; 4.17 4.18 @@ -192,6 +193,7 @@ 4.19 C2_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE, 4.20 C2_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE) 4.21 #endif 4.22 + COMMANDLINEFLAGWITHTYPE_EXT 4.23 NUM_CommandLineFlagWithType 4.24 } CommandLineFlagWithType; 4.25