86 import java.lang.invoke.MethodHandle; |
86 import java.lang.invoke.MethodHandle; |
87 import java.lang.invoke.MethodHandles; |
87 import java.lang.invoke.MethodHandles; |
88 import java.lang.invoke.MethodType; |
88 import java.lang.invoke.MethodType; |
89 import java.lang.invoke.MutableCallSite; |
89 import java.lang.invoke.MutableCallSite; |
90 import java.util.List; |
90 import java.util.List; |
|
91 import java.util.Objects; |
91 import jdk.internal.dynalink.linker.GuardedInvocation; |
92 import jdk.internal.dynalink.linker.GuardedInvocation; |
92 import jdk.internal.dynalink.linker.GuardingDynamicLinker; |
93 import jdk.internal.dynalink.linker.GuardingDynamicLinker; |
93 import jdk.internal.dynalink.linker.LinkRequest; |
94 import jdk.internal.dynalink.linker.LinkRequest; |
94 import jdk.internal.dynalink.linker.LinkerServices; |
95 import jdk.internal.dynalink.linker.LinkerServices; |
95 import jdk.internal.dynalink.support.CallSiteDescriptorFactory; |
96 import jdk.internal.dynalink.support.CallSiteDescriptorFactory; |
250 } |
251 } |
251 |
252 |
252 // Make sure we filter the invocation before linking it into the call site. This is typically used to match the |
253 // Make sure we filter the invocation before linking it into the call site. This is typically used to match the |
253 // return type of the invocation to the call site. |
254 // return type of the invocation to the call site. |
254 guardedInvocation = prelinkFilter.filter(guardedInvocation, linkRequest, linkerServices); |
255 guardedInvocation = prelinkFilter.filter(guardedInvocation, linkRequest, linkerServices); |
255 guardedInvocation.getClass(); // null pointer check |
256 Objects.requireNonNull(guardedInvocation); |
256 |
257 |
257 int newRelinkCount = relinkCount; |
258 int newRelinkCount = relinkCount; |
258 // Note that the short-circuited "&&" evaluation below ensures we'll increment the relinkCount until |
259 // Note that the short-circuited "&&" evaluation below ensures we'll increment the relinkCount until |
259 // threshold + 1 but not beyond that. Threshold + 1 is treated as a special value to signal that resetAndRelink |
260 // threshold + 1 but not beyond that. Threshold + 1 is treated as a special value to signal that resetAndRelink |
260 // has already executed once for the unstable call site; we only want the call site to throw away its current |
261 // has already executed once for the unstable call site; we only want the call site to throw away its current |