[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Re: Some of j.l.Math::* functions can't be redefined (dynamically instrumented): is it expected?
From:       "Daniel D. Daugherty" <daniel.daugherty () oracle ! com>
Date:       2013-04-30 14:00:33
Message-ID: 517FCE81.60507 () oracle ! com
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic