[9] RFR(XS): 8176513 Poor code quality for ByteBuffers

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Wed Mar 15 17:00:42 UTC 2017


The following one is being tested:

diff --git a/src/share/vm/opto/library_call.cpp 
b/src/share/vm/opto/library_call.cpp
--- a/src/share/vm/opto/library_call.cpp
+++ b/src/share/vm/opto/library_call.cpp
@@ -2375,7 +2375,7 @@
    bool need_mem_bar;
    switch (kind) {
        case Relaxed:
-          need_mem_bar = mismatched || can_access_non_heap;
+          need_mem_bar = mismatched && !adr_type->isa_aryptr();
            break;
        case Opaque:
            // Opaque uses CPUOrder membars for protection against code 
movement.

Best regards,
Vladimir Ivanov

On 3/15/17 7:54 PM, Vladimir Kozlov wrote:
> So what is final fix looks like?
>
> Vladimir K
>
>
> Sent from my iPhone
>> On Mar 15, 2017, at 8:50 AM, Vladimir Ivanov <vladimir.x.ivanov at oracle.com> wrote:
>>
>> Good point, Roland. Missed those checks.
>>
>> What is missing is TypeInstPtr::MARK, but I'm fine with fixing that later.
>>
>> Best regards,
>> Vladimir Ivanov
>>
>>> On 3/15/17 6:34 PM, Roland Westrelin wrote:
>>>
>>>> I think alias_type->adr_type() should be used instead, because
>>>> adr_type->isa_aryptr() is true for pointers into array header as well,
>>>> but we care about array body here. Alias analysis should flatten them to
>>>> InstPtr.
>>>
>>> Aren't those forbidden anyway?
>>>
>>>  if (alias_type->adr_type() == TypeInstPtr::KLASS ||
>>>      alias_type->adr_type() == TypeAryPtr::RANGE) {
>>>    return false; // not supported
>>>  }
>>>
>>> Roland.
>>>
>


More information about the hotspot-compiler-dev mailing list