8283001: windows-x86-cmp-baseline fails in some jvmti native libs

Reviewed-by: sspitsyn, amenkov
This commit is contained in:
Leonid Mesnik 2022-05-12 02:30:17 +00:00
parent e9f45bb270
commit 82d257006d
41 changed files with 83 additions and 44 deletions

View File

@ -205,7 +205,8 @@ VMDeath(jvmtiEnv *jvmti, JNIEnv *jni) {
callbacksEnabled = NSK_FALSE;
}
JNIEXPORT jint JNICALL Java_breakpoint01_check(JNIEnv *jni, jobject obj) {
JNIEXPORT jint JNICALL
Java_breakpoint01_check(JNIEnv *jni, jobject obj) {
for (int i = 0; i < METH_NUM; i++) {
if (bpEvents[i] != 1) {
result = STATUS_FAILED;
@ -222,7 +223,8 @@ JNIEXPORT jint JNICALL Java_breakpoint01_check(JNIEnv *jni, jobject obj) {
return result;
}
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiCapabilities caps;
jvmtiError err;
jint res;

View File

@ -232,7 +232,8 @@ void JNICALL FramePop(jvmtiEnv *jvmti, JNIEnv *jni,
}
}
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiCapabilities caps;
jvmtiError err;

View File

@ -30,7 +30,8 @@ extern "C" {
static jvmtiEnv *jvmti_env = NULL;
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jint res = jvm->GetEnv((void **) &jvmti_env, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti_env == NULL) {
LOG("Wrong test_passed of a valid call to GetEnv!\n");

View File

@ -35,7 +35,8 @@ extern "C" {
static jvmtiEnv *jvmti = NULL;
static jint result = PASSED;
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jint res;
jvmtiError err;
jvmtiCapabilities caps;

View File

@ -35,7 +35,8 @@ extern "C" {
static jvmtiEnv *jvmti = NULL;
static jint result = PASSED;
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jint res;
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);

View File

@ -35,7 +35,8 @@ extern "C" {
static jvmtiEnv *jvmti = NULL;
static jint result = PASSED;
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jint res;
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);

View File

@ -38,7 +38,8 @@ static jint result = PASSED;
static jboolean printdump = JNI_FALSE;
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiError err;
jint res;

View File

@ -36,7 +36,8 @@ static jvmtiEnv *jvmti = NULL;
static jint result = PASSED;
static jboolean printdump = JNI_FALSE;
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jint res;
if (options != NULL && strcmp(options, "printdump") == 0) {

View File

@ -36,7 +36,8 @@ static jvmtiEnv *jvmti = NULL;
static jint result = PASSED;
static jboolean printdump = JNI_FALSE;
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jint res;
if (options != NULL && strcmp(options, "printdump") == 0) {

View File

@ -36,7 +36,8 @@ static jvmtiEnv *jvmti = NULL;
static jint result = PASSED;
static jboolean printdump = JNI_FALSE;
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jint res;
if (options != NULL && strcmp(options, "printdump") == 0) {

View File

@ -36,7 +36,8 @@ static jvmtiEnv *jvmti = NULL;
static jint result = PASSED;
static jboolean printdump = JNI_FALSE;
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jint res;
if (options != NULL && strcmp(options, "printdump") == 0) {

View File

@ -203,7 +203,8 @@ VirtualThreadEnd(jvmtiEnv *jvmti, JNIEnv *jni, jthread vthread) {
/* ============================================================================= */
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiEnv * jvmti = NULL;
jvmtiEventCallbacks callbacks;
@ -266,4 +267,3 @@ jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
}
return JNI_OK;
}

View File

@ -70,7 +70,8 @@ sys_thread(jvmtiEnv *jvmti, JNIEnv *jni, void *p) {
rml2.wait();
}
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiCapabilities caps;
jvmtiError err;
jint res;

View File

@ -31,7 +31,8 @@ extern "C" {
static jvmtiEnv *jvmti = NULL;
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jint res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
@ -67,4 +68,3 @@ Java_contmon01_checkMonitor(JNIEnv *jni, jclass cls, jint point, jthread thread,
}
}

View File

@ -30,7 +30,8 @@ extern "C" {
static jvmtiEnv *jvmti;
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jint res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {

View File

@ -29,7 +29,8 @@ extern "C" {
static jvmtiEnv *jvmti_env = NULL;
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiCapabilities caps;
jint res;

View File

@ -81,7 +81,8 @@ ExceptionCatch(jvmtiEnv *jvmti_env, JNIEnv *env, jthread thr,
}
}
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiCapabilities caps;
jvmtiEventCallbacks callbacks;
jvmtiError err;

View File

@ -44,7 +44,8 @@ static frame_info fi =
{"Lframeloc02;", "check",
"(Ljava/lang/Thread;)I", -1};
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jint res = jvm->GetEnv((void **) &jvmti_env, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti_env == NULL) {
LOG("Wrong result of a valid call to GetEnv!\n");

View File

@ -47,7 +47,8 @@ static frame_info expected_platform_frames[] = {
{"Ljava/lang/Thread;", "run", "()V"}
};
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jint res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");

View File

@ -50,7 +50,8 @@ static frame_info expected_virtual_frames[] = {
{"Ljdk/internal/vm/Continuation;", "enter", "(Ljdk/internal/vm/Continuation;Z)V"}
};
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiError err;
jint res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {

View File

@ -74,7 +74,8 @@ void JNICALL Breakpoint(jvmtiEnv *jvmti_env, JNIEnv *jni,
}
}
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiError err;
jint res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {

View File

@ -97,7 +97,8 @@ SingleStep(jvmtiEnv *jvmti_env, JNIEnv *jni, jthread thread, jmethodID method, j
}
}
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiError err;
jint res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {

View File

@ -86,7 +86,8 @@ void JNICALL SingleStep(jvmtiEnv *jvmti_env, JNIEnv *jni, jthread thread, jmetho
}
}
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiError err;
jint res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {

View File

@ -99,7 +99,8 @@ void JNICALL Breakpoint(jvmtiEnv *jvmti_env, JNIEnv *jni, jthread thread, jmetho
}
}
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiError err;
jint res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {

View File

@ -134,7 +134,8 @@ void JNICALL SingleStep(jvmtiEnv *jvmti_env, JNIEnv *jni,
}
}
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiError err;
jint res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {

View File

@ -43,7 +43,8 @@ static info expected_info_array[] = {
{"vthread", JNI_FALSE,JVMTI_THREAD_NORM_PRIORITY, JNI_TRUE}
};
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jint res;
jvmtiCapabilities caps;

View File

@ -64,7 +64,8 @@ ThreadStart(jvmtiEnv *jvmti_env, JNIEnv *jni, jthread thread) {
}
}
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jint res;
jvmtiError err;

View File

@ -69,7 +69,8 @@ ThreadStart(jvmtiEnv *jvmti_env, JNIEnv *jni, jthread thread) {
}
}
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiCapabilities caps;
jvmtiEventCallbacks callbacks;
jint res;

View File

@ -43,7 +43,8 @@ Java_thrstat03_init(JNIEnv *env, jclass cls, jint waitTime) {
wait_time = waitTime * 60000;
}
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jint res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
LOG("Wrong result of a valid call to GetEnv!\n");

View File

@ -71,7 +71,8 @@ static int g_wait_time = 1000;
jrawMonitorID wait_lock; /* Monitor is used just for sleeping */
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jint res = jvm->GetEnv((void **) &jvmti_env, JVMTI_VERSION_1_1);
if (res != JNI_OK || !jvmti_env) {
LOG("Agent_OnLoad: Error: GetEnv returned error or NULL\n");

View File

@ -98,7 +98,8 @@ agentProc(jvmtiEnv *jvmti, JNIEnv *jni, void *arg) {
return;
}
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiEnv *jvmti = NULL;
timeout = 60 * 1000;

View File

@ -134,7 +134,8 @@ callbackThreadEnd(jvmtiEnv* jvmti, JNIEnv* jni, jthread thread) {
/* ============================================================================= */
/** Agent library initialization. */
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiEnv* jvmti = NULL;
timeout = 60 * 1000;

View File

@ -192,7 +192,8 @@ static int find_threads_by_name(jvmtiEnv* jvmti, JNIEnv* jni,
return NSK_TRUE;
}
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiEnv* jvmti = NULL;
timeout = 60 * 1000;

View File

@ -232,7 +232,8 @@ callbackThreadEnd(jvmtiEnv* jvmti, JNIEnv* jni, jthread thread) {
LOG(" ... received THREAD_END event for unknown thread: %p\n", (void*)thread);
}
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiEnv* jvmti = NULL;
timeout = 60 * 1000;

View File

@ -95,7 +95,8 @@ agentProc(jvmtiEnv *jvmti, JNIEnv *jni, void *arg) {
/* ============================================================================= */
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiEnv *jvmti = NULL;
timeout = 60 * 1000;

View File

@ -130,7 +130,8 @@ callbackThreadEnd(jvmtiEnv *jvmti, JNIEnv *jni, jthread thread) {
}
}
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiEnv *jvmti = NULL;
timeout = 60 * 1000;

View File

@ -143,7 +143,8 @@ agentProc(jvmtiEnv *jvmti, JNIEnv *jni, void *arg) {
/* Second part of original agentProc test block ends here. */
}
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiEnv *jvmti = NULL;
timeout = 60 * 1000;

View File

@ -192,7 +192,8 @@ static int find_threads_by_name(jvmtiEnv *jvmti, JNIEnv *jni, const char *name,
return NSK_TRUE;
}
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiEnv *jvmti = NULL;
timeout = 60 * 1000;

View File

@ -222,7 +222,8 @@ callbackThreadEnd(jvmtiEnv* jvmti, JNIEnv* jni, jthread thread) {
LOG(" ... received THREAD_END event for unknown thread: %p\n", (void*)thread);
}
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiEnv* jvmti = NULL;
timeout = 60 * 1000;

View File

@ -61,7 +61,8 @@ Java_SelfSuspendDisablerTest_resumeAllVirtualThreads(JNIEnv* jni, jclass cls) {
}
jint Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiError err;
LOG("Agent init started\n");

View File

@ -126,7 +126,7 @@ Breakpoint(jvmtiEnv *jvmti, JNIEnv* jni, jthread thread,
/* ============================================================================= */
jint
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiEnv * jvmti = NULL;