Integrated: 8255285: Move JVMFlag origins into a new enum JVMFlagOrigin

Ioi Lam iklam at openjdk.java.net
Fri Oct 30 03:49:03 UTC 2020


On Fri, 23 Oct 2020 06:33:06 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> Many JVM function take an `JVMFlag::Flags` parameter to indicate the origin of the flag -- i.e., "who is setting this flag". E.g., in arguments.hpp:
> 
> static bool parse_argument(const char* arg, JVMFlag::Flags origin);
> 
> However, `JVMFlag::Flags` contains many other bits that are unrelated to the origin. We should add a new enum `JVMFlagOrigin` that has only the valid values for the origin. This makes it possible to do more type-safety checks at C++ compilation time.
> 
> This patch also renamed the confusing bit `JVMFlag::ORIG_COMMAND_LINE` to `WAS_SET_IN_COMMAND_LINE` and added documentation, so that it won't be confused with `JVMFlagOrigin::COMMAND_LINE`.

This pull request has now been integrated.

Changeset: 1a89d68e
Author:    Ioi Lam <iklam at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/1a89d68e
Stats:     229 lines in 23 files changed: 39 ins; 14 del; 176 mod

8255285: Move JVMFlag origins into a new enum JVMFlagOrigin

Reviewed-by: dholmes, redestad

-------------

PR: https://git.openjdk.java.net/jdk/pull/823


More information about the hotspot-dev mailing list