97 * @param linkRequest the object describing the request for linking a particular invocation |
97 * @param linkRequest the object describing the request for linking a particular invocation |
98 * @param linkerServices linker services |
98 * @param linkerServices linker services |
99 * @return a guarded invocation with a method handle suitable for the arguments, as well as a guard condition that |
99 * @return a guarded invocation with a method handle suitable for the arguments, as well as a guard condition that |
100 * if fails should trigger relinking. Must return null if it can't resolve the invocation. If the returned |
100 * if fails should trigger relinking. Must return null if it can't resolve the invocation. If the returned |
101 * invocation is unconditional (which is actually quite rare), the guard in the return value can be null. The |
101 * invocation is unconditional (which is actually quite rare), the guard in the return value can be null. The |
102 * invocation can also have a switch point for asynchronous invalidation of the linkage, as well as a |
102 * invocation can also have any number of switch points for asynchronous invalidation of the linkage, as well as a |
103 * {@link Throwable} subclass that describes an expected exception condition that also triggers relinking (often it |
103 * {@link Throwable} subclass that describes an expected exception condition that also triggers relinking (often it |
104 * is faster to rely on an infrequent but expected {@link ClassCastException} than on an always evaluated |
104 * is faster to rely on an infrequent but expected {@link ClassCastException} than on an always evaluated |
105 * {@code instanceof} guard). While the linker must produce an |
105 * {@code instanceof} guard). While the linker must produce an |
106 * invocation with parameter types matching those in the call site descriptor of the link request, it should not try |
106 * invocation with parameter types matching those in the call site descriptor of the link request, it should not try |
107 * to match the return type expected at the call site except when it can do it with only the conversions that lose |
107 * to match the return type expected at the call site except when it can do it with only the conversions that lose |
108 * neither precision nor magnitude, see {@link LinkerServices#asTypeLosslessReturn(java.lang.invoke.MethodHandle, |
108 * neither precision nor magnitude, see {@link LinkerServices#asTypeLosslessReturn(java.lang.invoke.MethodHandle, |
109 * java.lang.invoke.MethodType)}. |
109 * java.lang.invoke.MethodType)} for further explanation. |
110 * @throws Exception if the operation fails for whatever reason |
110 * @throws Exception if the operation fails for whatever reason |
111 */ |
111 */ |
112 public GuardedInvocation getGuardedInvocation(LinkRequest linkRequest, LinkerServices linkerServices) |
112 public GuardedInvocation getGuardedInvocation(LinkRequest linkRequest, LinkerServices linkerServices) |
113 throws Exception; |
113 throws Exception; |
114 } |
114 } |