RFR: 8337797: Additional ExternalAddress cleanup [v2]
Vladimir Kozlov
kvn at openjdk.org
Tue Aug 6 16:45:31 UTC 2024
On Tue, 6 Aug 2024 13:44:32 GMT, Andrew Dinn <adinn at openjdk.org> wrote:
>> src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp line 845:
>>
>>> 843: Label& L_ok) {
>>> 844: Label L_fail;
>>> 845: __ lea(temp_reg, AddressLiteral(code_start, relocInfo::none));
>>
>> No need relocation here. This check code is generated for i2c adapters which we don't relocate - we put them into reserved code buffer.
>
> What about when try to save and restore an adapter in Leyden?
Short answer: we should exclude these checks when we cache adapters in Leyden.
Long answer:
1. These checks are enabled only in debug VM and only on x86.
2. We never caught any issues with these checks since JDK 9 (I found only one issue [JDK-8023465](https://bugs.openjdk.org/browse/JDK-8023465)).
3. Enabling it create issues because we don't add an adapters to hash table until all stubs are generated [contains_all_checks](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/runtime/sharedRuntime.cpp#L2637) which which creates duplicated adapters for the same method's signature.
4. These checks may miss an issue because they pass if adapter called from stubs but stubs may be called from compiled call.
I was actually considering removing these checks but decided to keep them for now. But I don't think we need them in cached adapters in Leyden.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20470#discussion_r1705839108
More information about the hotspot-dev
mailing list