RFR: 8280481: Duplicated static stubs in NMethod Stub Code section [v2]

Evgeny Astigeevich duke at openjdk.java.net
Thu Apr 21 12:40:23 UTC 2022


On Wed, 20 Apr 2022 17:42:23 GMT, Yi-Fan Tsai <duke at openjdk.java.net> wrote:

>> Evgeny Astigeevich has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update copyright year and add Unimplemented guards
>
> src/hotspot/share/asm/codeBuffer.cpp line 992:
> 
>> 990: void CodeBuffer::shared_stub_to_interp_for(Method* method, address caller_pc) {
>> 991:   if (_shared_stub_to_interp_requests == NULL) {
>> 992:     _shared_stub_to_interp_requests = new SharedStubToInterpRequests();
> 
> Shouldn't _shared_stub_to_interp_requests be freed in CodeBuffer destructor?

For the implementation of `SharedStubToInterpRequests` based on `GrowableArray`, there is no need to do this explicitly. By default `GrowableArray` is allocated in thread's resource area which should be automatically cleaned up with a proper set resource mark. A resource mark is set in [CompileBroker::invoke_compiler_on_method](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/compiler/compileBroker.cpp#L2166).

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

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


More information about the hotspot-compiler-dev mailing list