提交 fbf892c1 编写于 作者: A andrew

8246223: Windows build fails after JDK-8227269

Summary: MSVC 2013 uses a modified variant of C90 and requires all declarations before statements
Reviewed-by: andrew
Contributed-by: NAlex Kashchenko <akashche@redhat.com>
上级 df49872c
......@@ -81,13 +81,14 @@ cbTrackingObjectFree(jvmtiEnv* jvmti_env, jlong tag)
struct bag *
classTrack_processUnloads(JNIEnv *env)
{
struct bag* deleted;
debugMonitorEnter(classTrackLock);
if (deletedSignatures == NULL) {
// Class tracking not initialized, nobody's interested.
debugMonitorExit(classTrackLock);
return NULL;
}
struct bag* deleted = deletedSignatures;
deleted = deletedSignatures;
deletedSignatures = bagCreateBag(sizeof(char*), 10);
debugMonitorExit(classTrackLock);
return deleted;
......@@ -101,6 +102,7 @@ classTrack_addPreparedClass(JNIEnv *env_unused, jclass klass)
{
jvmtiError error;
jvmtiEnv* env = trackingEnv;
char* signature;
if (gdata && gdata->assertOn) {
// Check this is not already tagged.
......@@ -112,7 +114,6 @@ classTrack_addPreparedClass(JNIEnv *env_unused, jclass klass)
JDI_ASSERT(tag == NOT_TAGGED);
}
char* signature;
error = classSignature(klass, &signature, NULL);
if (error != JVMTI_ERROR_NONE) {
EXIT_ERROR(error,"signature");
......@@ -127,14 +128,15 @@ classTrack_addPreparedClass(JNIEnv *env_unused, jclass klass)
static jboolean
setupEvents()
{
jvmtiError error;
jvmtiEventCallbacks cb;
jvmtiCapabilities caps;
memset(&caps, 0, sizeof(caps));
caps.can_generate_object_free_events = 1;
jvmtiError error = JVMTI_FUNC_PTR(trackingEnv, AddCapabilities)(trackingEnv, &caps);
error = JVMTI_FUNC_PTR(trackingEnv, AddCapabilities)(trackingEnv, &caps);
if (error != JVMTI_ERROR_NONE) {
return JNI_FALSE;
}
jvmtiEventCallbacks cb;
memset(&cb, 0, sizeof(cb));
cb.ObjectFree = cbTrackingObjectFree;
error = JVMTI_FUNC_PTR(trackingEnv, SetEventCallbacks)(trackingEnv, &cb, sizeof(cb));
......@@ -154,6 +156,11 @@ setupEvents()
void
classTrack_initialize(JNIEnv *env)
{
jint classCount;
jclass *classes;
jvmtiError error;
jint i;
deletedSignatures = NULL;
classTrackLock = debugMonitorCreate("Deleted class tag lock");
trackingEnv = getSpecialJvmti();
......@@ -166,11 +173,6 @@ classTrack_initialize(JNIEnv *env)
EXIT_ERROR(AGENT_ERROR_INTERNAL, "Unable to setup ObjectFree tracking");
}
jint classCount;
jclass *classes;
jvmtiError error;
jint i;
error = allLoadedClasses(&classes, &classCount);
if ( error == JVMTI_ERROR_NONE ) {
for (i = 0; i < classCount; i++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册