Vladimir,

Adding the Serviceability Team to the thread also.

Dan


On 4/30/13 7:17 AM, Vladimir Ivanov wrote:
Hi,

I stumbled upon a fact that some of Math.* functions, though they are written in Java, can't be instrumented/redefined (using j.l.i.Instrumentation or JVMTI RedefineClasses).

Looking at the code, I see that the interpreter handles such functions specially:
src/share/vm/interpreter/interpreter.cpp:
...
184 AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(methodHandle m) {
...
228   switch (m->intrinsic_id()) {
229     case vmIntrinsics::_dsin  : return java_lang_math_sin  ;
...

but

src/share/classes/java/lang/Math.java:
...
138    public static double sin(double a) {
139 return StrictMath.sin(a); // default impl. delegates to StrictMath
140    }
...

and

src/share/classes/java/lang/StrictMath.java:
...
110     public static native double sin(double a);
...

Shouldn't StrictMath counterparts be intrinsified instead? At least, when class redefinition is allowed.
Best regards,
Vladimir Ivanov

Reply via email to