[9] RFR JDK-8141616: Add new methods to the java Whitebox API

Konstantin Shefov konstantin.shefov at oracle.com
Wed Feb 24 09:25:06 UTC 2016


Hi Christian

Thanks for reviewing

On 02/22/2016 10:33 PM, Christian Thalinger wrote:
> +WB_ENTRY(jint, WB_GetConstantPoolCacheLength(JNIEnv* env, jobject wb, jclass klass))
> +  instanceKlassHandle ikh(java_lang_Class::as_Klass(JNIHandles::resolve(klass)));
> +  ConstantPool* cp = ikh->constants();
> +  if (cp->cache() == NULL) {
> +      return -1;
> +  }
>
> Shouldn’t this throw an exception like in the other methods?

Half of the tests from JDK-8141618 and JDK-8141619 have "cp->cache() == 
NULL", so I think it is better to compare the length of cpcache with 0 
than to catch an exception every time.

-Konstantin
>
>> On Feb 17, 2016, at 3:53 AM, Konstantin Shefov <konstantin.shefov at oracle.com> wrote:
>>
>> Hello
>>
>> Please review some new methods added to the sun.hotspot.WhiteBox API.
>> These methods are needed to test JVMCI CompilerToVM methods, see https://bugs.openjdk.java.net/browse/JDK-8138708 for more info.
>>
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8141616
>> Webrev for java part: http://cr.openjdk.java.net/~kshefov/8141616/root/webrev.00/
>> Webrev for native part: http://cr.openjdk.java.net/~kshefov/8141616/hotspot/webrev.00/
>>
>> Thanks
>> -Konstantin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20160224/46b4d7ba/attachment.html>


More information about the hotspot-compiler-dev mailing list