RFR: 8255746: Make PrintCompilation available on a per method level [v2]

Joshua Cao duke at openjdk.org
Thu Oct 13 20:40:26 UTC 2022


On Thu, 13 Oct 2022 07:33:37 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> May be we are looking the wrong way. Can we do `task->set_directive(directive)` when we create `task`?
>> Then you don't need to move PrintCompilation code - `task->directive()` will be available at the beginning of this method.
>
>> elapsedTimer time; just declares variable. TraceTime uses it (with start/stop) later to accumulate time.
> So declaration can be placed anywhere before JVMCI code below.
> 
> Got it, thanks for the clarification - then it does not matter much where we place this declaration.

I pushed a change that sets the directive in `CompileTask::initialize()`. To make this change work, I had to remove the `const` from `CompileTask::_directive`. This is because the broker needs a non const version of the directive.

This does not change much. Prior to this PR, the broker would `task->setDirective(directive)`, where `directive` is not a const. `directive` is later passed in to the constructor for `Compilation` as a non const. So although the `CompileTask::_directive` was `const DirectiveSet *`, the directive can still be modified from a different reference.

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

PR: https://git.openjdk.org/jdk/pull/10668


More information about the hotspot-compiler-dev mailing list