Skip to content

Commit

Permalink
[Backport] 8305895: Fix a -UseTLAB crash of original 8305895 backport
Browse files Browse the repository at this point in the history
Summary: Fix a -UseTLAB crash from backport of 8305895

Testing : CI pipeline

Reviewers: yulei, ddh

Issue: #747
  • Loading branch information
mmyxym authored and Accelerator1996 committed Dec 27, 2023
1 parent 0662c7f commit 35874c1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,10 @@ void C1_MacroAssembler::initialize_object(Register obj, Register klass, Register
} else if (con_size_in_bytes <= threshold) {
// use explicit null stores
int i = hdr_size_in_bytes;
if (i < con_size_in_bytes && (con_size_in_bytes % (2 * BytesPerWord))) {
// Here assumes hdr_size_in_bytes is 2 words aligned but it's not with compact object header
// We have to check the rest of object space is 2 words aligned or not
// It's benign with UseTLAB but will corrupt next object with inline_contig_alloc with PSGC
if (i < con_size_in_bytes && ((con_size_in_bytes - (UseCompactObjectHeaders ? hdr_size_in_bytes : 0)) % (2 * BytesPerWord))) {
str(zr, Address(obj, i));
i += BytesPerWord;
}
Expand Down

0 comments on commit 35874c1

Please sign in to comment.