RFR: 8261731: shallow copy the internal buffer of a scalar-replaced java.lang.String object

Volker Simonis simonis at openjdk.java.net
Wed Mar 3 11:57:02 UTC 2021


On Mon, 22 Feb 2021 10:17:04 GMT, Xin Liu <xliu at openjdk.org> wrote:

>> What about GC? What happens if the original String isn't reachable any more? Do you put a reference to the byte array into the corresponding oop maps to make sure it can't be garbage collected?
>
>> What about GC? What happens if the original String isn't reachable any more? Do you put a reference to the byte array into the corresponding oop maps to make sure it can't be garbage collected?
> 
> hi, Volker, 
> 
> I don't know OopMap very much.  IMHO, it should be discovered by GC because I put the byte array oop to `jvm->locals`
> I do that for all safepoints nodes. 
> 
>           // 1. src oop
>           sfpt->add_req(ac->in(ArrayCopyNode::Src));
> https://github.com/openjdk/jdk/pull/2570/files#diff-2faebd05d08f9115f8d9ef771644cf05087a6986c2f9013d7163c6aa720169c3R995

Hi Xin,
when building a fastdebug build of your latest changes I got a crash because of an assertion in your new code.
I've attached the hs_err and replay file. After restarting the build it succeeded so there must have been a special situation. Hopefully the replay file can help you to reproduce the error.

Best regards,
Volker

[hs_err_pid18140.log](https://github.com/openjdk/jdk/files/6075724/hs_err_pid18140.log)
[replay_pid18140.log](https://github.com/openjdk/jdk/files/6075725/replay_pid18140.log)

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

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


More information about the hotspot-compiler-dev mailing list