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

John Rose john.r.rose at
Fri Jun 3 00:48:23 PDT 2011

This is a changed method name (and inverted sense), replacing SwitchPoint.isValid.  Here's the updated javadoc:

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.

true if this switch point has been invalidated

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the hotspot-compiler-dev mailing list