Skip to content

Commit

Permalink
8253899: Make IsClassUnloadingEnabled signature match specification
Browse files Browse the repository at this point in the history
Reviewed-by: sspitsyn, dholmes
  • Loading branch information
Vladimir Kempik committed Oct 12, 2020
1 parent aad3cf4 commit c7f0064
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/hotspot/share/prims/jvmti.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9949,9 +9949,11 @@ myInit() {
there is a <code>jint</code> parameter, the event handler should be
declared:
<example>
void JNICALL myHandler(jvmtiEnv* jvmti_env, jint myInt, ...)
void JNICALL myHandler(jvmtiEnv* jvmti_env, ...)
</example>
Note the terminal "<code>...</code>" which indicates varargs.
The <code>jint</code> argument inside <code>myHandler</code> needs to be extracted using
the <code>va_*</code> syntax of the C programming language.
</description>
<parameters>
<param id="jvmti_env">
Expand Down
9 changes: 8 additions & 1 deletion src/hotspot/share/prims/jvmtiExtensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,14 @@ GrowableArray<jvmtiExtensionEventInfo*>* JvmtiExtensions::_ext_events;


// extension function
static jvmtiError JNICALL IsClassUnloadingEnabled(const jvmtiEnv* env, jboolean* enabled, ...) {
static jvmtiError JNICALL IsClassUnloadingEnabled(const jvmtiEnv* env, ...) {
jboolean* enabled = NULL;
va_list ap;

va_start(ap, env);
enabled = va_arg(ap, jboolean *);
va_end(ap);

if (enabled == NULL) {
return JVMTI_ERROR_NULL_POINTER;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,15 @@ static jrawMonitorID eventMon;
/* ============================================================================= */

static void JNICALL
ClassUnload(jvmtiEnv* jvmti_env, JNIEnv* jni_env, const char* name, ...) {
ClassUnload(jvmtiEnv* jvmti_env, ...) {
JNIEnv *jni_env = NULL;
va_list ap;

va_start(ap, jvmti_env);
jni_env = va_arg(ap, JNIEnv *);
const char * name = va_arg(ap, const char *);
va_end(ap);

// The name argument should never be null
if (name == NULL) {
nsk_jvmti_setFailStatus();
Expand Down

5 comments on commit c7f0064

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on c7f0064 Oct 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VladimirKempik
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk15u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on c7f0064 Jul 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VladimirKempik the backport was successfully created on the branch VladimirKempik-backport-c7f00640 in my personal fork of openjdk/jdk15u-dev. To create a pull request with this backport targeting openjdk/jdk15u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

this pull request contains a backport of commit c7f00640 from the openjdk/jdk repository.

The commit being backported was authored by Vladimir Kempik on 12 Oct 2020 and was reviewed by Serguei Spitsyn and David Holmes.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk15u-dev:

$ git fetch https://github.com/openjdk-bots/jdk15u-dev VladimirKempik-backport-c7f00640:VladimirKempik-backport-c7f00640
$ git checkout VladimirKempik-backport-c7f00640
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk15u-dev VladimirKempik-backport-c7f00640

@VladimirKempik
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk13u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on c7f0064 Jul 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VladimirKempik could not automatically backport c7f00640 to openjdk/jdk13u-dev due to conflicts in the following files:

  • src/hotspot/share/prims/jvmti.xml

To manually resolve these conflicts run the following commands in your personal fork of openjdk/jdk13u-dev:

$ git checkout -b VladimirKempik-backport-c7f00640
$ git fetch --no-tags https://git.openjdk.java.net/jdk c7f00640627eab38b77d23d07876cf0247fa18f3
$ git cherry-pick --no-commit c7f00640627eab38b77d23d07876cf0247fa18f3
$ # Resolve conflicts
$ git add files/with/resolved/conflicts
$ git commit -m 'Backport c7f00640627eab38b77d23d07876cf0247fa18f3'

Once you have resolved the conflicts as explained above continue with creating a pull request towards the openjdk/jdk13u-dev with the title Backport c7f00640627eab38b77d23d07876cf0247fa18f3.

Please sign in to comment.