[vectorIntrinsics] RFR: Optimize mem barriers for ByteBuffer cases [v9]
Radoslaw Smogura
github.com+7535718+rsmogura at openjdk.java.net
Wed Aug 4 22:44:13 UTC 2021
On Wed, 4 Aug 2021 21:16:19 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:
>> Radoslaw Smogura has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Code review changes:
>> * make specied final static in test
>> * use Unsafe to check if ByteBuffer is readOnly
>> * remove if in X-ScopedMemory when loading / storing vectors,
>> stay with byte[] cast
>> * inline copyMemory in micro benchmark
>
> src/hotspot/share/opto/vectorIntrinsics.cpp line 837:
>
>> 835: const TypeInstPtr* vbox_type = TypeInstPtr::make_exact(TypePtr::NotNull, vbox_klass);
>> 836:
>> 837: if (mixed_access) {
>
> I suggest the following shapes for the checks:
>
> const bool in_native = (TypePtr::NULL_PTR == base_type); // base always null
> const bool in_heap = !TypePtr::NULL_PTR->higher_equal(base_type); // base never null
>
> const bool is_mixed_access = !in_heap && !in_native;
>
> const bool is_mismatched_access = in_heap && (addr_type->isa_aryptr() == NULL);
>
> const bool needs_cpu_membar = is_mixed_access || is_mismatched_access;
Thank you, fixed, we were not sure if mismatched access should be there.
-------------
PR: https://git.openjdk.java.net/panama-vector/pull/104
More information about the panama-dev
mailing list