RFR: 8276571: C2: pass compilation options as structure [v2]
Aleksey Shipilev
shade at openjdk.java.net
Thu Nov 4 16:21:10 UTC 2021
On Thu, 4 Nov 2021 16:16:36 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
>> Currently we pass several compilation options as separate arguments to `Compile`:
>>
>> Compile C(env, target, entry_bci, subsume_loads, do_escape_analysis, eliminate_boxing, do_locks_coarsening, install_code, directive);
>>
>> Originally we had only `subsume_loads` option but we added few since then and we may add more.
>>
>> I suggest to add new `Options` class to pass these values into `Compile`.
>
> Vladimir Kozlov has updated the pull request incrementally with one additional commit since the last revision:
>
> Address review comments
All right, this works too. Next user of `Options` would probably have to introduce per-use factory methods to disambiguate constructors, so maybe we could do this early on.
class Options {
static Options for_runtime_stub_gen() const {
return Options(
/* subsume_loads = */ true,
/* do_escape_analysis = */ false,
/* eliminate_boxing = */ false,
/* do_lock_coarsening = */ false,
/* install_code = */ true
);
}
}
-------------
Marked as reviewed by shade (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/6237
More information about the hotspot-dev
mailing list