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

2016-03-02 Thread Markus Gronlund
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 
[.wrapped_tr0_wrapped_tr1_wrapped_tr2_()] 
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


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

2016-03-02 Thread Erik Gahlin

Looks good!

Erik

Den 03/03/16 kl. 01:15, skrev Markus Gronlund:


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 
[.wrapped_tr0_wrapped_tr1_wrapped_tr2_()] 
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





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

2016-03-03 Thread serguei.spit...@oracle.com

Hi Markus,

The fix looks good.

Thanks,
Serguei


On 3/2/16 16: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 
[.wrapped_tr0_wrapped_tr1_wrapped_tr2_()] 
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





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

2016-03-03 Thread Markus Gronlund
Thank you Serguei!

 

Markus

 

From: Serguei Spitsyn 
Sent: den 3 mars 2016 10:18
To: Markus Gronlund; serviceability-dev@openjdk.java.net
Subject: Re: RFR(XXS): 8151100: Test 
java/lang/instrument/NativeMethodPrefixAgent.java can't attempt to do 
CheckIntrinsics

 

Hi Markus,

The fix looks good.

Thanks,
Serguei


On 3/2/16 16: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 
[.wrapped_tr0_wrapped_tr1_wrapped_tr2_()] 
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

 


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

2016-03-03 Thread Dmitry Dmitriev

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 
[.wrapped_tr0_wrapped_tr1_wrapped_tr2_()] 
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





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

2016-03-03 Thread Markus Gronlund
Thanks Dmitry  for noticing this - I am running slowdebug so I didn't see that.

 

Thanks again.

Markus

 

 

From: Dmitry Dmitriev 
Sent: den 3 mars 2016 12:23
To: Markus Gronlund; serviceability-dev@openjdk.java.net
Subject: Re: RFR(XXS): 8151100: Test 
java/lang/instrument/NativeMethodPrefixAgent.java can't attempt to do 
CheckIntrinsics

 

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 
[.wrapped_tr0_wrapped_tr1_wrapped_tr2_()] 
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