Skip to content

Commit

Permalink
8336842: [lworld] Return value buffering in TLAB does not work with -…
Browse files Browse the repository at this point in the history
…XX:FastAllocateSizeLimit=0
  • Loading branch information
TobiHartmann committed Aug 14, 2024
1 parent 24b25b6 commit 5ccdcef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
12 changes: 7 additions & 5 deletions src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6457,18 +6457,20 @@ int MacroAssembler::store_inline_type_fields_to_buf(ciInlineKlass* vk, bool from
if (vk != nullptr) {
// Called from C1, where the return type is statically known.
movptr(klass, (intptr_t)vk->get_InlineKlass());
jint obj_size = vk->layout_helper();
assert(obj_size != Klass::_lh_neutral_value, "inline class in return type must have been resolved");
if (UseTLAB) {
tlab_allocate(r0, noreg, obj_size, tmp1, tmp2, slow_case);
jint lh = vk->layout_helper();
assert(lh != Klass::_lh_neutral_value, "inline class in return type must have been resolved");
if (UseTLAB && !Klass::layout_helper_needs_slow_path(lh)) {
tlab_allocate(r0, noreg, lh, tmp1, tmp2, slow_case);
} else {
b(slow_case);
}
} else {
// Call from interpreter. R0 contains ((the InlineKlass* of the return type) | 0x01)
andr(klass, r0, -2);
ldrw(tmp2, Address(klass, Klass::layout_helper_offset()));
if (UseTLAB) {
ldrw(tmp2, Address(klass, Klass::layout_helper_offset()));
tst(tmp2, Klass::_lh_instance_slow_path_bit);
br(Assembler::NE, slow_case);
tlab_allocate(r0, tmp2, 0, tmp1, tmp2, slow_case);
} else {
b(slow_case);
Expand Down
12 changes: 7 additions & 5 deletions src/hotspot/cpu/x86/macroAssembler_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6162,19 +6162,21 @@ int MacroAssembler::store_inline_type_fields_to_buf(ciInlineKlass* vk, bool from
if (vk != nullptr) {
// Called from C1, where the return type is statically known.
movptr(rbx, (intptr_t)vk->get_InlineKlass());
jint obj_size = vk->layout_helper();
assert(obj_size != Klass::_lh_neutral_value, "inline class in return type must have been resolved");
if (UseTLAB) {
tlab_allocate(r15_thread, rax, noreg, obj_size, r13, r14, slow_case);
jint lh = vk->layout_helper();
assert(lh != Klass::_lh_neutral_value, "inline class in return type must have been resolved");
if (UseTLAB && !Klass::layout_helper_needs_slow_path(lh)) {
tlab_allocate(r15_thread, rax, noreg, lh, r13, r14, slow_case);
} else {
jmp(slow_case);
}
} else {
// Call from interpreter. RAX contains ((the InlineKlass* of the return type) | 0x01)
mov(rbx, rax);
andptr(rbx, -2);
movl(r14, Address(rbx, Klass::layout_helper_offset()));
if (UseTLAB) {
movl(r14, Address(rbx, Klass::layout_helper_offset()));
testl(r14, Klass::_lh_instance_slow_path_bit);
jcc(Assembler::notZero, slow_case);
tlab_allocate(r15_thread, rax, r14, 0, r13, r14, slow_case);
} else {
jmp(slow_case);
Expand Down

0 comments on commit 5ccdcef

Please sign in to comment.