RFR(XXS): 8151100: Test java/lang/instrument/NativeMethodPrefixAgent.java can't attempt to do CheckIntrinsics

Dmitry Dmitriev dmitry.dmitriev at oracle.com
Thu Mar 3 11:23:28 UTC 2016


Hello Markus,

CheckIntrinsics is a diagnostic flag. I think you need to add 
-XX:+UnlockDiagnosticVMOptions before it because otherwise test will 
fail on product build.

Thanks,
Dmitry

On 03.03.2016 3:15, Markus Gronlund wrote:
>
> Greetings,
>
> Could a please ask for reviews for the following simple fix to resolve 
> a test issue associated with 
> test/java/lang/instrument/NativeMethodPrefixAgent.java
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8151100
>
> Webrev/diff:
>
> diff --git a/test/java/lang/instrument/NativeMethodPrefixAgent.java 
> b/test/java/lang/instrument/NativeMethodPrefixAgent.java
>
> --- a/test/java/lang/instrument/NativeMethodPrefixAgent.java
>
> +++ b/test/java/lang/instrument/NativeMethodPrefixAgent.java
>
> @@ -31,7 +31,7 @@
>
>   * java.management
>
>   * java.instrument
>
>   * @run shell/timeout=240 MakeJAR2.sh NativeMethodPrefixAgent 
> NativeMethodPrefixApp 'Can-Retransform-Classes: true' 
> 'Can-Set-Native-Method-Prefix: true'
>
> - * @run main/othervm -javaagent:NativeMethodPrefixAgent.jar 
> NativeMethodPrefixApp
>
> + * @run main/othervm -XX:-CheckIntrinsics 
> -javaagent:NativeMethodPrefixAgent.jar NativeMethodPrefixApp
>
> */
>
>  import java.lang.instrument.*;
>
> Description:
>
> The java/lang/instrument/NativeMethodPrefixAgent.java modifies (wraps) 
> the names of native methods.
>
> If a class is loaded that contain the @HotSpotIntrinsicCandidate 
> annotation on a native method, one step of the class file parser is an 
> attempt to validate the method name against a registered intrinsic in 
> the VM.
>
> By default, the flag CheckIntrinsics is true, which will yield:
>
> “Method 
> [<class>.wrapped_tr0_wrapped_tr1_wrapped_tr2_<original_method_name>()<return>] 
> is annotated with @HotSpotIntrinsicCandidate, but no compiler 
> intrinsic is defined for the method. Exiting.”
>
> This "wrapped" prepending to the method name invalidates the intrinsic 
> check.
>
> In order for the test to pass even when loading a class with a native 
> method containing the @HotSpotIntrinsicCandidate annotation, the test 
> should explicitly disable the CheckIntrinsics flag:
>
> -XX:-CheckIntrinsics
>
> Thanks in advance
>
> Markus
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20160303/f0c93509/attachment.html>


More information about the serviceability-dev mailing list