8388439: [s390x] LoadNKlass rule doesn't kill CC

Reviewed-by: aph, stuefe
This commit is contained in:
Amit Kumar 2026-07-20 12:20:09 +00:00
parent 1f064af63e
commit 857df83728
2 changed files with 7 additions and 7 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2026, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -42,10 +42,12 @@ void C2_MacroAssembler::fast_unlock(Register obj, Register box, Register temp1,
}
void C2_MacroAssembler::load_narrow_klass_compact_c2(Register dst, Address src) {
BLOCK_COMMENT("load_narrow_klass_compact_c2 {");
// The incoming address is pointing into obj-start + klass_offset_in_bytes. We need to extract
// obj-start, so that we can load from the object's mark-word instead.
z_lg(dst, src.plus_disp(-oopDesc::klass_offset_in_bytes()));
z_srlg(dst, dst, markWord::klass_shift); // TODO: could be z_sra
z_srlg(dst, dst, markWord::klass_shift);
BLOCK_COMMENT("} load_narrow_klass_compact_c2");
}
//------------------------------------------------------

View File

@ -4816,17 +4816,15 @@ instruct loadNKlass(iRegN dst, memory mem) %{
ins_pipe(pipe_class_dummy);
%}
instruct loadNKlassCompactHeaders(iRegN dst, memory mem, flagsReg cr) %{
instruct loadNKlassCompactHeaders(iRegN dst, memory mem) %{
match(Set dst (LoadNKlass mem));
predicate(UseCompactObjectHeaders);
effect(KILL cr);
ins_cost(MEMORY_REF_COST);
format %{ "load_narrow_klass_compact $dst,$mem \t# compressed class ptr" %}
// TODO: size()
// z_lg (6 bytes) + z_srlg (6 bytes); neither instruction modifies the CC.
size(12);
ins_encode %{
__ block_comment("load_narrow_klass_compact_c2 {");
__ load_narrow_klass_compact_c2($dst$$Register, $mem$$Address);
__ block_comment("} load_narrow_klass_compact");
%}
ins_pipe(pipe_class_dummy);
%}