RFR(XXS) [10] 8183038 Minimal vm slowdebug build fails with undefined reference to MetaspaceShared::is_valid_shared_method

Ioi Lam ioi.lam at oracle.com
Tue Jul 25 00:09:24 UTC 2017


Hi Jiangli,

Thansk for the review.

I think in fastdebug builds, MetaspaceShared::is_in_shared_space() is 
inlined and the C++ compiler elides the call to is_valid_shared_method.

bool Method::is_valid_method() const {
   if (this == NULL) {
     return false;
   } else if ((intptr_t(this) & (wordSize-1)) != 0) {
     // Quick sanity check on pointer.
     return false;
   } else if (MetaspaceShared::is_in_shared_space(this)) {
     return MetaspaceShared::is_valid_shared_method(this);

- Ioi

On 7/24/17 4:40 PM, Jiangli Zhou wrote:
> Looks good. Any idea why it only fails with slowdebug build?
>
> Thanks,
> Jiangli
>
>> On Jul 24, 2017, at 3:57 PM, Ioi Lam <ioi.lam at oracle.com> wrote:
>>
>> Hi, please review this very simple fix. We need to add NOT_CDS_RETURN_(false).
>>
>> https://bugs.openjdk.java.net/browse/JDK-8183038
>>
>> diff -r 5d56055dcb81 src/share/vm/memory/metaspaceShared.hpp
>> --- a/src/share/vm/memory/metaspaceShared.hpp    Sat Jul 22 10:03:15 2017 +0200
>> +++ b/src/share/vm/memory/metaspaceShared.hpp    Mon Jul 24 15:54:39 2017 -0700
>> @@ -181,7 +181,7 @@
>>    static intptr_t* clone_cpp_vtables(intptr_t* p);
>>    static void zero_cpp_vtable_clones_for_writing();
>>    static void patch_cpp_vtable_pointers();
>> -  static bool is_valid_shared_method(const Method* m);
>> +  static bool is_valid_shared_method(const Method* m) NOT_CDS_RETURN_(false);
>>
>>    static void serialize(SerializeClosure* sc, GrowableArray<MemRegion> *string_space,
>>                          size_t* space_size);
>>
>>
>>
>> Thanks
>> - Ioi



More information about the hotspot-runtime-dev mailing list