Review request: 8000459: assert(java_lang_String::is_instance(entry)) failure with various mlvm tests

serguei.spitsyn at oracle.com serguei.spitsyn at oracle.com
Tue Oct 9 19:42:07 PDT 2012


Got it. Thanks, David.
It means, pseudo string is not a java_lang_String.

Jiangli,
Thumbs up.

Thanks,
Serguei


On 10/9/12 6:46 PM, David Holmes wrote:
> On 10/10/2012 11:05 AM, serguei.spitsyn at oracle.com wrote:
>> Hi Jiangli,
>>
>> I'm not very familiar with the pseudo strings, and so, just have a
>> question:
>>
>> *src/share/vm/prims/jvmtiTagMap.cpp*
>>
>> 2927 entry = pool->resolved_string_at(i);
>> 2928 assert(java_lang_String::is_instance(entry) ||
>> 2929 pool->is_pseudo_string_at(i), "must be string");
>>
>> I have a little of doubt the above is correct.
>>
>> What value the "entry" will have in a case of pseudo string cp entry?
>> Just want to understand what constant pool reference will be reported.
>
> The pool stores strings and pseudo-strings in the same way. So 
> pool->resolved_string_at(i) and pool->pseudo_string_at(i, 
> cp_to_object_index(i)) return the same thing.
>
> So entry is either a real string or a pseudo-string - hence the assert 
> checks for either one.
>
> There were a number of ways this code could have been modified to 
> handle this, but augmenting the assert was simplest.
>
>> Do you see all related failing tests passed?
>>
>> Would something like the following be more accurate ?
>> entry = pool->is_pseudo_string_at(i) ?
>> pool->pseudo_string_at(i, cp_to_object_index(i)) :
>> pool->resolved_string_at(i);
>
> entry is the same no matter which path is taken.
>
>> assert(java_lang_String::is_instance(entry));
>
> That assert fails if entry was a pseudo-string.
>
> David
> -----
>
>> In this case, a reference from CP to string is reported regardless it is
>> pseudo string or not.
>>
>>
>> Thanks,
>> Serguei
>>
>> On 10/9/12 4:26 PM, Jiangli Zhou wrote:
>>> Please review following fix for 8000459:
>>>
>>> http://cr.openjdk.java.net/~jiangli/8000459/webrev/
>>>
>>> With JSR292, a constant pool String entry could be patched to a
>>> non-string oop. The assert in
>>> VM_HeapWalkOperation::iterate_over_class() needs to be adjusted to
>>> reflect that.
>>>
>>> Thanks,
>>>
>>> Jiangli
>>



More information about the hotspot-dev mailing list