RFR: JDK-8322648: Improve class initialization barrier in TemplateTable::_new for PPC [v3]
Martin Doerr
mdoerr at openjdk.org
Mon Jan 29 15:43:45 UTC 2024
On Mon, 29 Jan 2024 15:07:23 GMT, Varada M <varadam at openjdk.org> wrote:
>> ppc port implementation of https://github.com/openjdk/jdk/pull/17006
>>
>> Fastdebug and Release : build and tier1 testing successful.
>>
>> JBS Issue : [JDK-8322648](https://bugs.openjdk.org/browse/JDK-8322648)
>
> Varada M has updated the pull request incrementally with one additional commit since the last revision:
>
> 8322648: Improve class initialization barrier in TemplateTable::_new for PPC
Ok, the difference is probably below noise. Maybe we can try jvm98 with -Xint. I think the patch should look like this:
diff --git a/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp b/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp
index 84ecfc4f934..74bea6ac9ac 100644
--- a/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp
+++ b/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp
@@ -3803,16 +3803,15 @@ void TemplateTable::_new() {
__ sldi(Roffset, Rindex, LogBytesPerWord);
__ load_resolved_klass_at_offset(Rcpool, Roffset, RinstanceKlass);
- // Make sure klass is fully initialized and get instance_size.
- __ lbz(Rscratch, in_bytes(InstanceKlass::init_state_offset()), RinstanceKlass);
+ // Make sure klass is initialized.
+ assert(VM_Version::supports_fast_class_init_checks(), "Optimization requires support for fast class initialization checks");
+ __ clinit_barrier(RinstanceKlass, R16_thread, nullptr /*L_fast_path*/, &Lslow_case);
+
__ lwz(Rinstance_size, in_bytes(Klass::layout_helper_offset()), RinstanceKlass);
- __ cmpdi(CCR1, Rscratch, InstanceKlass::fully_initialized);
// Make sure klass does not have has_finalizer, or is abstract, or interface or java/lang/Class.
__ andi_(R0, Rinstance_size, Klass::_lh_instance_slow_path_bit); // slow path bit equals 0?
-
- __ crnand(CCR0, Assembler::equal, CCR1, Assembler::equal); // slow path bit set or not fully initialized?
- __ beq(CCR0, Lslow_case);
+ __ bne(CCR0, Lslow_case);
// --------------------------------------------------------------------------
// Fast case:
-------------
PR Comment: https://git.openjdk.org/jdk/pull/17518#issuecomment-1914963023
More information about the hotspot-compiler-dev
mailing list