RFR: 8262881: port JVM/DI tests from JDK-4413752 to JVM/TI [v2]

Daniel D.Daugherty dcubed at openjdk.java.net
Mon Mar 22 14:25:39 UTC 2021


On Mon, 22 Mar 2021 09:02:02 GMT, Robbin Ehn <rehn at openjdk.org> wrote:

>> @sspitsyn - Thanks for the review! I figured you would enjoy this 20 year old
>> blast from the past! I'm tempted to ping @karenkinnear just to see if she'll
>> remember these tests!
>> 
>> I'll fix the indents in the .cpp files. Right now I'm using these tests to shake
>> out @robehn's work on "JDK-8257831 Suspend with handshakes".
>
> Hi Dan,
> 
> If you change the native methods, e.g. :
> native static void RawMonitorEnter(int id);
> To something like:
> native static int RawMonitorEnter();
> 
> You can then handle the jvmti error in the Java code, so you don't need to pass down the 'id' of the thread.
> You then remove all debug code from the C-code agent, which removes some native methods also.
> Which also leads to that you don't need  the thread 'id', instead you can just use the thread name, which removes some Java code.
> 
> Also you shouldn't catch the UnsatisfiedLinkError, as docs also says: "An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch."
> 
> You also have a lot of code for argument parsing which is not used by the test inside the test methods.
> Can you either remove that or if you want it put it in a separate class/method, so e.g. "doWork()" takes parsed arguments instead.
> 
> Thanks, Robbin

@robehn - Thanks for the review and for the suggested improvements to the tests.
It will take me a bit of time to make and test these suggestions.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2899


More information about the hotspot-runtime-dev mailing list