[lworld] RFR: 8263067: [lworld] Improve buffer instance allocation in MacroAssembler::store_inline_type_fields_to_buf [v2]
Tobias Hartmann
thartmann at openjdk.java.net
Mon Mar 8 11:54:23 UTC 2021
On Mon, 8 Mar 2021 03:49:30 GMT, Yi Yang <yyang at openjdk.org> wrote:
>> TLAB allocation in MacroAssembler::store_inline_type_fields_to_buf looks duplicated with MacroAssembler::tlab_allocate, we might use existing MacroAssembler::tlab_allocate instead of duplicated ones. It will generate safer and faster code. (See details on JBS). All jtreg tests are passed with slowdebug mode. When UseTLAB is disabled, we can also try to allocate the buffer object in eden space.
>>
>> Thanks!
>> Yang
>
> Yi Yang has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR.
Found some little typos in the comments, otherwise the changes look good to me. I think the `FIXME` you've mentioned can be removed.
Best regards,
Tobias
src/hotspot/cpu/x86/macroAssembler_x86.cpp line 5415:
> 5413:
> 5414: #ifdef _LP64
> 5415: // The following code is similar to allocate_instance but has some slightly differences,
`slightly differences` -> `slight differences`
src/hotspot/cpu/x86/macroAssembler_x86.cpp line 5417:
> 5415: // The following code is similar to allocate_instance but has some slightly differences,
> 5416: // e.g. object size is always not zero, sometimes it's constant; storing klass ptr after
> 5417: // allocating is not necessary if vk != NULL, etc. allocate_instance can not aware of these.
`allocate_instance can not aware of these` -> `allocate_instance is not aware of these`
src/hotspot/cpu/x86/macroAssembler_x86.cpp line 5456:
> 5454: // 3. Initialize its fields with an inline class specific handler
> 5455: if (vk != NULL) {
> 5456: // FIXME -- do the packing in-line to avoid the runtime call
This can be removed. I don't think it pays off.
src/hotspot/cpu/x86/macroAssembler_x86.cpp line 5420:
> 5418: Label slow_case;
> 5419: // 1. Try to allocate a new buffered inline instance either from TLAB or eden space
> 5420: mov(rscratch1, rax); // save rax for slow_case since *_allocate may corrupts it when allocation failed
`corrupts it` -> `corrupt it`
-------------
Marked as reviewed by thartmann (Committer).
PR: https://git.openjdk.java.net/valhalla/pull/362
More information about the valhalla-dev
mailing list