Pls review (S) 7117389: Add a framework for vendor-specific command line switch extensions to Hotspot
Paul Hohensee
paul.hohensee at oracle.com
Mon Dec 5 07:06:02 PST 2011
Here's an example vendor-specific globals_ext.hpp that defines a single
vendor-specific flag.
I have no idea whether it will even compile, but it gives the flavor of
what's needed.
Paul
----
#ifndef SHARE_VM_RUNTIME_GLOBALS_EXT_HPP
#define SHARE_VM_RUNTIME_GLOBALS_EXT_HPP
// globals.hpp extension
#define VENDOR_FLAGS(develop,
product) \
\
product(bool, VendorFlag, false, "A vendor-specific flag")
VENDOR_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG)
// globals_extension.hpp extension
// Additional CommandLineFlags enum values
#define COMMANDLINEFLAG_EXT \
VENDOR_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER, RUNTIME_PRODUCT_FLAG_MEMBER)
// Additional CommandLineFlagsWithType enum values
#define COMMANDLINEFLAGWITHTYPE_EXT \
VENDOR_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE, \
RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE)
// globals.cpp extension
// Additional flag definitions
#define MATERIALIZE_FLAGS_EXT \
VENDOR_FLAGS(MATERIALIZE_DEVELOPER_FLAG, MATERIALIZE_PRODUCT_FLAG)
// Additional flag descriptors: see flagTable definition
#define FLAGTABLE_EXT \
VENDOR_FLAGS(RUNTIME_DEVELOP_FLAG_STRUCT, RUNTIME_PRODUCT_FLAG_STRUCT)
// Extended method definitions
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
David Holmes wrote:
> Hi Paul,
>
> This looks okay to me, but I agree that an example of how to use it
> would help set the context for the review.
>
> David
>
> On 3/12/2011 1:54 AM, Paul Hohensee wrote:
>> Webrev here:
>>
>> http://cr.openjdk.java.net/~phh/7117389/
>>
>> This webrev defines and uses, but does not implement, a switch extension
>> interface.
>>
>> I've added a new file, globals_ext.hpp, that contains hooks for
>> vendor-specific additions
>> to the set of Hotspot command line switches and added their use to
>> globals.hpp,
>> globals.cpp and globals_extension.hpp. I chose "_ext" as a generic
>> suffix for files
>> containing extension hooks. In effect, such files are interface
>> definitions. A vendor
>> supplies a file, perhaps of the same name in another source base (as can
>> be seen in
>> the Hotspot makefiles), that implements the extension hooks.
>>
>> Thanks,
>>
>> Paul
>>
More information about the hotspot-dev
mailing list