mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 03:24:38 +02:00
7117389: Add a framework for vendor-specific command line switch extensions to Hotspot
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
This commit is contained in:
parent
5e1d1487de
commit
6532572c0b
4 changed files with 74 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -55,10 +55,13 @@ RUNTIME_OS_FLAGS(MATERIALIZE_DEVELOPER_FLAG, MATERIALIZE_PD_DEVELOPER_FLAG, \
|
||||||
MATERIALIZE_PRODUCT_FLAG, MATERIALIZE_PD_PRODUCT_FLAG, \
|
MATERIALIZE_PRODUCT_FLAG, MATERIALIZE_PD_PRODUCT_FLAG, \
|
||||||
MATERIALIZE_DIAGNOSTIC_FLAG, MATERIALIZE_NOTPRODUCT_FLAG)
|
MATERIALIZE_DIAGNOSTIC_FLAG, MATERIALIZE_NOTPRODUCT_FLAG)
|
||||||
|
|
||||||
|
MATERIALIZE_FLAGS_EXT
|
||||||
|
|
||||||
|
|
||||||
bool Flag::is_unlocker() const {
|
bool Flag::is_unlocker() const {
|
||||||
return strcmp(name, "UnlockDiagnosticVMOptions") == 0 ||
|
return strcmp(name, "UnlockDiagnosticVMOptions") == 0 ||
|
||||||
strcmp(name, "UnlockExperimentalVMOptions") == 0;
|
strcmp(name, "UnlockExperimentalVMOptions") == 0 ||
|
||||||
|
is_unlocker_ext();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Flag::is_unlocked() const {
|
bool Flag::is_unlocked() const {
|
||||||
|
@ -74,7 +77,7 @@ bool Flag::is_unlocked() const {
|
||||||
strcmp(kind, "{C2 experimental}") == 0) {
|
strcmp(kind, "{C2 experimental}") == 0) {
|
||||||
return UnlockExperimentalVMOptions;
|
return UnlockExperimentalVMOptions;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return is_unlocked_ext();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,6 +244,7 @@ static Flag flagTable[] = {
|
||||||
#ifdef SHARK
|
#ifdef SHARK
|
||||||
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)
|
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)
|
||||||
#endif
|
#endif
|
||||||
|
FLAGTABLE_EXT
|
||||||
{0, NULL, NULL}
|
{0, NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -243,6 +243,9 @@ struct Flag {
|
||||||
bool is_writeable() const;
|
bool is_writeable() const;
|
||||||
bool is_external() const;
|
bool is_external() const;
|
||||||
|
|
||||||
|
bool is_unlocker_ext() const;
|
||||||
|
bool is_unlocked_ext() const;
|
||||||
|
|
||||||
void print_on(outputStream* st, bool withComments = false );
|
void print_on(outputStream* st, bool withComments = false );
|
||||||
void print_as_flag(outputStream* st);
|
void print_as_flag(outputStream* st);
|
||||||
};
|
};
|
||||||
|
@ -3907,4 +3910,8 @@ RUNTIME_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT
|
||||||
|
|
||||||
RUNTIME_OS_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_NOTPRODUCT_FLAG)
|
RUNTIME_OS_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_NOTPRODUCT_FLAG)
|
||||||
|
|
||||||
|
// Extensions
|
||||||
|
|
||||||
|
#include "runtime/globals_ext.hpp"
|
||||||
|
|
||||||
#endif // SHARE_VM_RUNTIME_GLOBALS_HPP
|
#endif // SHARE_VM_RUNTIME_GLOBALS_HPP
|
||||||
|
|
56
hotspot/src/share/vm/runtime/globals_ext.hpp
Normal file
56
hotspot/src/share/vm/runtime/globals_ext.hpp
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SHARE_VM_RUNTIME_GLOBALS_EXT_HPP
|
||||||
|
#define SHARE_VM_RUNTIME_GLOBALS_EXT_HPP
|
||||||
|
|
||||||
|
// globals_extension.hpp extension
|
||||||
|
|
||||||
|
// Additional CommandLineFlags enum values
|
||||||
|
#define COMMANDLINEFLAG_EXT
|
||||||
|
|
||||||
|
// Additional CommandLineFlagsWithType enum values
|
||||||
|
#define COMMANDLINEFLAGWITHTYPE_EXT
|
||||||
|
|
||||||
|
|
||||||
|
// globals.cpp extension
|
||||||
|
|
||||||
|
// Additional flag definitions
|
||||||
|
#define MATERIALIZE_FLAGS_EXT
|
||||||
|
|
||||||
|
// Additional flag descriptors: see flagTable definition
|
||||||
|
#define FLAGTABLE_EXT
|
||||||
|
|
||||||
|
|
||||||
|
// Default method implementations
|
||||||
|
|
||||||
|
inline bool Flag::is_unlocker_ext() const {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool Flag::is_unlocked_ext() const {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // SHARE_VM_RUNTIME_GLOBALS_EXT_HPP
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -93,6 +93,7 @@ typedef enum {
|
||||||
#ifdef COMPILER2
|
#ifdef COMPILER2
|
||||||
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)
|
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)
|
||||||
#endif
|
#endif
|
||||||
|
COMMANDLINEFLAG_EXT
|
||||||
NUM_CommandLineFlag
|
NUM_CommandLineFlag
|
||||||
} CommandLineFlag;
|
} CommandLineFlag;
|
||||||
|
|
||||||
|
@ -192,6 +193,7 @@ typedef enum {
|
||||||
C2_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE,
|
C2_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE,
|
||||||
C2_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE)
|
C2_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE)
|
||||||
#endif
|
#endif
|
||||||
|
COMMANDLINEFLAGWITHTYPE_EXT
|
||||||
NUM_CommandLineFlagWithType
|
NUM_CommandLineFlagWithType
|
||||||
} CommandLineFlagWithType;
|
} CommandLineFlagWithType;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue