JNI DEFINE_NEWSCALARARRAY uses DT_RETURN_MARK_DECL_FOR
Keith McGuigan
Keith.McGuigan at Sun.COM
Thu Oct 22 08:17:33 PDT 2009
Thank you for these fixes, Mark, I've integrated them into
http://hg.openjdk.java.net/jdk7/hotspot-rt/hotspot and they'll bubble up
to the other repos (hotspot/hotspot and jdk7/hotspot) soon.
Please refer to CR 6893483 to track these fixes.
--
- Keith
Mark Wielaard wrote:
> Hi,
>
> In jni.cpp the DEFINE_NEWSCALARARRAY macro uses DT_RETURN_MARK_DECL_FOR
> instead of the normal DT_RETURN_MARK_DECL. The DT_RETURN_MARK_DECL_FOR
> macro should only be used for mark probes that could return a primitive
> jfloat or jdouble. But DEFINE_NEWSCALARARRAY creates the functions for
> New<Type>Array which return primitiveTypeArrays. This means that for
> NewFloatArray and NewDoubleArray you cannot get the return value in the
> return mark probe.
>
> According to hotspot_jni.d the intention is to return these values in
> those cases:
>
> probe NewDoubleArray__entry(void*, uintptr_t);
> probe NewDoubleArray__return(void*);
> probe NewFloatArray__entry(void*, uintptr_t);
> probe NewFloatArray__return(void*);
>
> The attached trivial patch fixes it and makes the actual return value in
> those cases available.
>
> Tested against Systemtap, but the same should work for DTrace also.
> I don't have access to a system with solaris/dtrace on it, so it would
> be nice of someone who does could double check the above on such a
> system.
>
> Please let me know if I should create a bug also on
> https://bugs.openjdk.java.net/ and/or if I should report/post this patch
> on some other mailing-list.
>
> Thanks,
>
> Mark
>
More information about the serviceability-dev
mailing list