提交 ca99d298 编写于 作者: J jbachorik

8030115: [parfait] warnings from b119 for...

8030115: [parfait] warnings from b119 for jdk.src.share.native.sun.tracing.dtrace: JNI exception pending
Reviewed-by: dholmes, dsamersoff, sspitsyn
上级 fce237f4
......@@ -144,32 +144,34 @@ static void readInterfaceAttributes(
env, provider, &(jvm_provider->argsAttributes));
}
static void readProviderData(
static int readProviderData(
JNIEnv* env, jobject provider, JVM_DTraceProvider* jvm_provider) {
jmethodID mid;
jobjectArray probes;
jsize i;
jclass clazz = (*env)->GetObjectClass(env, provider); CHECK
jclass clazz = (*env)->GetObjectClass(env, provider); CHECK_(0)
mid = (*env)->GetMethodID(
env, clazz, "getProbes", "()[Lsun/tracing/dtrace/DTraceProbe;"); CHECK
env, clazz, "getProbes", "()[Lsun/tracing/dtrace/DTraceProbe;"); CHECK_(0)
probes = (jobjectArray)(*env)->CallObjectMethod(
env, provider, mid); CHECK
env, provider, mid); CHECK_(0)
// Fill JVM structure, describing provider
jvm_provider->probe_count = (*env)->GetArrayLength(env, probes); CHECK
jvm_provider->probe_count = (*env)->GetArrayLength(env, probes); CHECK_(0)
jvm_provider->probes = (JVM_DTraceProbe*)calloc(
jvm_provider->probe_count, sizeof(*jvm_provider->probes));
mid = (*env)->GetMethodID(
env, clazz, "getProviderName", "()Ljava/lang/String;"); CHECK
env, clazz, "getProviderName", "()Ljava/lang/String;"); CHECK_(0)
jvm_provider->name = (jstring)(*env)->CallObjectMethod(
env, provider, mid); CHECK
env, provider, mid); CHECK_(0)
readInterfaceAttributes(env, provider, jvm_provider); CHECK
readInterfaceAttributes(env, provider, jvm_provider); CHECK_(0)
for (i = 0; i < jvm_provider->probe_count; ++i) {
jobject probe = (*env)->GetObjectArrayElement(env, probes, i); CHECK
readProbeData(env, probe, &jvm_provider->probes[i]); CHECK
jobject probe = (*env)->GetObjectArrayElement(env, probes, i); CHECK_(0)
readProbeData(env, probe, &jvm_provider->probes[i]); CHECK_(0)
}
return 1;
}
/*
......@@ -195,16 +197,24 @@ JNIEXPORT jlong JNICALL Java_sun_tracing_dtrace_JVM_activate0(
jvm_providers = (JVM_DTraceProvider*)calloc(
num_providers, sizeof(*jvm_providers));
for (i = 0; i < num_providers; ++i) {
JVM_DTraceProvider* p = &(jvm_providers[i]);
int count = 0;
for (; count < num_providers; ++count) {
JVM_DTraceProvider* p = &(jvm_providers[count]);
jobject provider = (*env)->GetObjectArrayElement(
env, providers, i);
readProviderData(env, provider, p);
env, providers, count);
if ((*env)->ExceptionOccurred(env) ||
! readProviderData(env, provider, p)) {
// got an error, bail out!
break;
}
}
handle = jvm_symbols->Activate(
env, JVM_TRACING_DTRACE_VERSION, moduleName,
num_providers, jvm_providers);
if (count == num_providers) {
// all providers successfully loaded - get the handle
handle = jvm_symbols->Activate(
env, JVM_TRACING_DTRACE_VERSION, moduleName,
num_providers, jvm_providers);
}
for (i = 0; i < num_providers; ++i) {
JVM_DTraceProvider* p = &(jvm_providers[i]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册