On 12/28/2010 07:32 PM, Mark Roos wrote:
Thanks Remi,  the extra comments really helped

You also mentioned
>
> There is another way to do something similar,
> you can call invokedynamic, use the bootstrap arguments to send
> the primitive values composing the object value and when the
> BSM is called returns a ConstantCallSite with as target a method handle
> created by MethodHandles.constant().

At first glance this seems like adding a lot of overhead ( a method send ) as a replacement for a simple ldc bytecode. Are you thinking that hotspot will be
efficient in optimizing this?

We, the JSR292 EG, think that most of the VMs will be able to optimize this.


I like it theoretically, as I don't have to mess with the class loader, but will
the overhead be acceptable?

In fact for hotspot, this kind of constant can be even more optimized
than a static final field containing a non-primitive values which is not a real constant
(it can be modified by reflection).


happy new year
mark roos

Rémi
_______________________________________________
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev

Reply via email to