Question About MethodHandles.findSpecial
fredrik.ohrstrom at oracle.com
Tue May 5 22:48:24 PDT 2009
John Rose skrev:
> On May 5, 2009, at 12:25 PM, Fredrik Öhrström wrote:
>>> or invocation of private methods, see section 7.7 of the JVM spec.
>> Thanks! A MethodHandle pointing to a private method makes sense.
>> Still the javadoc for findSpecial explicitly mentions the
>> constructor so
>> is there any reason for executing a constructor through a
> Well, there is a strong reason for method invocation via
> invokespecial. To avoid burdensome workarounds, you need it if your
> dynamic language is going to extend Java classes. The topic was
> discussed on jvm-languages:
I do not doubt that findSpecial is useful for a lot of reasons,
but I was asking about the constructor call. The javadoc says:
Produce an early-bound method handle for
a virtual method, or a handle for a constructor,
as if called from an |invokespecial| instruction from |caller|.
So my question was, and still is, :-) , why would you
call a constructor through a MethodHandle?
More information about the mlvm-dev