Mercurial > hg > truffle
comparison src/share/vm/prims/jni.cpp @ 1034:08780c8a9f04
6893483: DTrace probe return values for a couple JNI methods are wrong
Summary: Fix the shadowing and incorrect macro usages
Reviewed-by: coleenp
author | kamg |
---|---|
date | Tue, 20 Oct 2009 16:34:08 -0400 |
parents | ad6585fd4087 |
children | 8e7adf982378 |
comparison
equal
deleted
inserted
replaced
1017:e715b51789d8 | 1034:08780c8a9f04 |
---|---|
2114 DTRACE_PROBE3(hotspot_jni, GetObjectArrayElement__entry, env, array, index); | 2114 DTRACE_PROBE3(hotspot_jni, GetObjectArrayElement__entry, env, array, index); |
2115 jobject ret = NULL; | 2115 jobject ret = NULL; |
2116 DT_RETURN_MARK(GetObjectArrayElement, jobject, (const jobject&)ret); | 2116 DT_RETURN_MARK(GetObjectArrayElement, jobject, (const jobject&)ret); |
2117 objArrayOop a = objArrayOop(JNIHandles::resolve_non_null(array)); | 2117 objArrayOop a = objArrayOop(JNIHandles::resolve_non_null(array)); |
2118 if (a->is_within_bounds(index)) { | 2118 if (a->is_within_bounds(index)) { |
2119 jobject ret = JNIHandles::make_local(env, a->obj_at(index)); | 2119 ret = JNIHandles::make_local(env, a->obj_at(index)); |
2120 return ret; | 2120 return ret; |
2121 } else { | 2121 } else { |
2122 char buf[jintAsStringSize]; | 2122 char buf[jintAsStringSize]; |
2123 sprintf(buf, "%d", index); | 2123 sprintf(buf, "%d", index); |
2124 THROW_MSG_0(vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), buf); | 2124 THROW_MSG_0(vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), buf); |
2148 JNI_END | 2148 JNI_END |
2149 | 2149 |
2150 | 2150 |
2151 #define DEFINE_NEWSCALARARRAY(Return,Allocator,Result) \ | 2151 #define DEFINE_NEWSCALARARRAY(Return,Allocator,Result) \ |
2152 \ | 2152 \ |
2153 DT_RETURN_MARK_DECL_FOR(Result, New##Result##Array, Return);\ | 2153 DT_RETURN_MARK_DECL(New##Result##Array, Return);\ |
2154 \ | 2154 \ |
2155 JNI_ENTRY(Return, \ | 2155 JNI_ENTRY(Return, \ |
2156 jni_New##Result##Array(JNIEnv *env, jsize len)) \ | 2156 jni_New##Result##Array(JNIEnv *env, jsize len)) \ |
2157 JNIWrapper("New" XSTR(Result) "Array"); \ | 2157 JNIWrapper("New" XSTR(Result) "Array"); \ |
2158 DTRACE_PROBE2(hotspot_jni, New##Result##Array__entry, env, len);\ | 2158 DTRACE_PROBE2(hotspot_jni, New##Result##Array__entry, env, len);\ |
2159 Return ret = NULL;\ | 2159 Return ret = NULL;\ |
2160 DT_RETURN_MARK_FOR(Result, New##Result##Array, Return, (const Return&)ret);\ | 2160 DT_RETURN_MARK(New##Result##Array, Return, (const Return&)ret);\ |
2161 \ | 2161 \ |
2162 oop obj= oopFactory::Allocator(len, CHECK_0); \ | 2162 oop obj= oopFactory::Allocator(len, CHECK_0); \ |
2163 ret = (Return) JNIHandles::make_local(env, obj); \ | 2163 ret = (Return) JNIHandles::make_local(env, obj); \ |
2164 return ret;\ | 2164 return ret;\ |
2165 JNI_END | 2165 JNI_END |