RFR: JDK-8304546: CompileTask::_directive leaked if CompileBroker::invoke_compiler_on_method not called
Tobias Hartmann
thartmann at openjdk.org
Thu Mar 30 07:10:18 UTC 2023
On Mon, 20 Mar 2023 20:48:28 GMT, Justin King <jcking at openjdk.org> wrote:
> Ensure `CompileTask::_directive` is not leaked when `CompileBroker::invoke_compiler_on_method` is not called. This can happen for stale tasks or when compilation is disabled.
src/hotspot/share/compiler/compileTask.cpp line 71:
> 69: if (task->_directive != nullptr) {
> 70: DirectivesStack::release(task->_directive);
> 71: task->clear_directive();
Just wondering, shouldn't we first call `task->clear_directive()` to avoid having a dangling pointer? It's of course not an issue here but a static code analysis tool might complain.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13108#discussion_r1152822535
More information about the hotspot-compiler-dev
mailing list