request for advice: safepoints in the JSR 292 spec
Rémi Forax
forax at univ-mlv.fr
Sat Dec 11 12:38:19 PST 2010
On 12/11/2010 05:31 PM, Jim Laskey wrote:
>> public static void syncTargets(MutableCallSite[] sites, MethodHandle[] newTargets)
> +1
>
> I think this provides the most flexibility, performance and ease. If a developer wants to use a wrapper method to do one up 'set and sync', they have the flexibility to do so.
>
> Naive question: If setTarget is removed and set is done either by constructor or by syncTargets, do we still need both these flavours of CallSite?
>
> Cheers,
>
> -- Jim
I think it's possible to use a synchronized block enclosing the
setTargets and the corresponding syncs
instead of syncTargets. From my experience, changing something on a
metaclass
often require to propagate changes on subclasses. This can't be done
using atomics
so you already need such synchronized block.
The CallSite's constructor that takes a target is not that useful
because usually you bind
the CallSite object to the method handle chain. Otherwise, you have no
CallSite to call sync on it.
Moreover, depending on the runtime language you know some invariants, by
example,
some languages doesn't allow to change the operator +, in that case calling
sync to update a callsite that uses + is an unnecessary cost.
Rémi
More information about the mlvm-dev
mailing list