RFR: 8357060: [premain] assert(left >= right) failed: avoid underflow [v2]
Ashutosh Mehra
asmehra at openjdk.org
Tue May 20 14:33:30 UTC 2025
On Mon, 19 May 2025 10:44:32 GMT, Andrew Dinn <adinn at openjdk.org> wrote:
>> Ashutosh Mehra has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - Fix compile failure in zero variant
>>
>> Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
>> - Add methods in AOTCacheAccess to convert offset to appropriate metadata pointer
>>
>> Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
>
> src/hotspot/share/cds/aotCacheAccess.hpp line 51:
>
>> 49: static bool can_generate_aot_code(InstanceKlass* ik) NOT_CDS_RETURN_(false);
>> 50:
>> 51: static uint delta_from_base_address(address addr);
>
> Could we have a comment here to distinguish the operation of `delta_from_base_address` and `convert_offset_to_klass/method.
>
> As I understand it:
>
> `convert_offset_to_method/klass` are used during a production run to retrieve a pointer to a `Method/Klass` located in a loaded archive. The offset argument identifies a delta from the archive's currently mapped shared base address to the start of the object. It will normally have been obtained by reading a value embedded in some other archive entry.
>
> `delta_from_base_address` are used during an assembly run to compute the offset at which a metadata object will be found in the mapped region of an archive under construction. The input argument is the address of a metadata object (`Method/Klass`) loaded by the assembly JVM. Computation of the offset requires mapping the supplied metadata object to a clean copy which resides in the current mapped archive range, remapping the address of that copy to its target location in some requested address range and subtracting that address from the requested base address (the latter being the address at which the shared archive is expected to be remapped). n.b. the offset of the clean copy in the current shared address range may not be the same as the offset of the object in the requested address range.
I added comments based on your suggestion.
-------------
PR Review Comment: https://git.openjdk.org/leyden/pull/68#discussion_r2098134166
More information about the leyden-dev
mailing list