review request (URGENT): 7051206: JSR 292 method name SwitchPoint.isValid is misleading to unwary users; should be hasBeenInvalidated

Y. Srinivas Ramakrishna y.s.ramakrishna at oracle.com
Fri Jun 3 10:22:52 PDT 2011


Looks good. Thanks for caring for the unwary user (which i unwittingly
represented when i previously pointed out the admittedly somewhat
subjective naturalness of the stable negative sense compared with
the unstable positive sense).

-- ramki

On 6/3/2011 12:48 AM, John Rose wrote:
> http://cr.openjdk.java.net/~jrose/7051206
>
> This is a changed method name (and inverted sense), replacing SwitchPoint.isValid.  Here's the updated javadoc:
>
> hasBeenInvalidated
> public boolean hasBeenInvalidated()
> Determines if this switch point has been invalidated yet.
> Discussion: Because of the one-way nature of invalidation, once a switch point begins to return true for hasBeenInvalidated, it will always do so in the future. On the other hand, a valid switch point visible to other threads may invalidated at any moment, due to a request by another thread.
>
> Since invalidation is a global and immediate operation, the execution of this query, on a valid switchpoint, must be internally sequenced with any other threads that could cause invalidation. This query may therefore be expensive. The recommended way to build a boolean-valued method handle which queries the invalidation state of a switch point s is to call s.guardWithTest on constant true and false method handles.
>
> Returns:
> true if this switch point has been invalidated
>
>
>
>
>
> _______________________________________________
> mlvm-dev mailing list
> mlvm-dev at openjdk.java.net
> http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev



More information about the mlvm-dev mailing list