RFR: 8255285: Move JVMFlag origins into a new enum JVMFlagOrigin [v4]

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


> 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`.

Ioi Lam has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision:

 - Merge branch 'master' of https://github.com/openjdk/jdk into 8255285-new-enum-JVMFlagOrigin
 - fixed build
 - Merge branch 'master' into 8255285-new-enum-JVMFlagOrigin
 - renamed WAS_SET_IN_COMMAND_LINE to WAS_SET_ON_COMMAND_LINE
 - Removed aliases of JVMFlagOrigin::X as JVMFlag::X
 - fixed whitespaces
 - jvmflagorigin

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/823/files
  - new: https://git.openjdk.java.net/jdk/pull/823/files/b1d53802..2e0552d6

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=823&range=03
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=823&range=02-03

  Stats: 2283 lines in 60 files changed: 565 ins; 1559 del; 159 mod
  Patch: https://git.openjdk.java.net/jdk/pull/823.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/823/head:pull/823

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


More information about the hotspot-dev mailing list