RFR: 8294308: Allow dynamically choosing the MEMFLAGS of a type without ResourceObj [v3]

Coleen Phillimore coleenp at openjdk.org
Wed Sep 28 18:23:34 UTC 2022


On Wed, 28 Sep 2022 13:45:53 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> Here's a suggested solution for the ticket mentioned and a use case for outputStream. I'm not attached to the name.
>> 
>> This saves space for all allocated outputStreams, which is nice. It also makes the purpose of ResourceObj more clear ("please handle the life cycle for me"), reducing the need for it.
>> 
>> Thank you for considering it.
>
> Johan Sjölen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains six commits:
> 
>  - Introduce new, invalid, memory flag
>  - delete _print_inlining_stream
>  - Merge remote-tracking branch 'origin/master' into dyn-cheapobj
>  - Avoid leaking predString
>  - Try out Coleen's suggestion
>  - DynCHeapObj

Changes requested by coleenp (Reviewer).

src/hotspot/share/opto/compile.hpp line 1064:

> 1062:     delete _print_inlining_stream;
> 1063:   };
> 1064: 

compile.cpp has print_inlining_stream_free() calls which will leak the stringStream now if called.  I think this function needs to be removed and it should call the reset function to reinitialize the stream.
There should be compiler tests that will fail if print_inlining_stream_free() is called with a null _print_inlining_stream pointer (I think the delete should fail (?) with null)

src/hotspot/share/utilities/ostream.hpp line 45:

> 43: // This allows for redirection via -XX:+DisplayVMOutputToStdout and
> 44: // -XX:+DisplayVMOutputToStderr
> 45: class outputStream : public CHeapObj<mtInternal> {

Were you going to change this to mtInvalid to require all components to pass the appropriate mtComponent flag?  People might bikeshed on the name mtInvalid - it could also be mtOverride or mtDynamic.  In any case, this is a nice improvement.

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

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


More information about the hotspot-dev mailing list