Integrated: 8262328: Templatize JVMFlag boilerplate access methods

Ioi Lam iklam at openjdk.java.net
Sat Apr 10 15:44:21 UTC 2021


On Thu, 1 Apr 2021 22:44:34 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> We have a bunch of boilerplate method like:
> 
> JVMFlagAccess::boolAtPut (JVMFlag* f, bool* v, JVMFlagOrigin origin)
> JVMFlagAccess::intAtPut (JVMFlag* f, int* v, JVMFlagOrigin origin)
> JVMFlagAccess::uintAtPut (JVMFlag* f, uint* v, JVMFlagOrigin origin)
> ...
> 
> Similarly, we also have 8 different functions: JVMFlag::{set_bool, set_int, set_intx, ...}
> 
> We should replace such patterns with
> 
> template <typename T>
> JVMFlagAccess::set(JVMFlag* f, T* value, JVMFlagOrigin origin)
> 
> This would allow us to templatize the 8x boilerplate functions in writeableFlags.cpp.
> 
> The flag access code in whitebox.cpp can also be improved.

This pull request has now been integrated.

Changeset: 627ad9fe
Author:    Ioi Lam <iklam at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/627ad9fe
Stats:     337 lines in 10 files changed: 100 ins; 140 del; 97 mod

8262328: Templatize JVMFlag boilerplate access methods

Reviewed-by: dholmes, gziemski

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

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


More information about the hotspot-dev mailing list