equal
deleted
inserted
replaced
250 // No clever things for the guard -- it is still identically filtered. |
250 // No clever things for the guard -- it is still identically filtered. |
251 filterGuard(link, WITHEXPRESSIONFILTER)); |
251 filterGuard(link, WITHEXPRESSIONFILTER)); |
252 } |
252 } |
253 |
253 |
254 private static GuardedInvocation fixScopeCallSite(final GuardedInvocation link) { |
254 private static GuardedInvocation fixScopeCallSite(final GuardedInvocation link) { |
255 return link.replaceMethods(filter(link.getInvocation(), WITHSCOPEFILTER), filterGuard(link, WITHSCOPEFILTER)); |
255 // The receiver may be an object or a ScriptObject. |
|
256 final MethodType invType = link.getInvocation().type(); |
|
257 final MethodType newInvType = invType.changeParameterType(0, WITHSCOPEFILTER.type().returnType()); |
|
258 final GuardedInvocation newLink = link.asType(newInvType); |
|
259 return link.replaceMethods(filter(newLink.getInvocation(), WITHSCOPEFILTER), filterGuard(newLink, WITHSCOPEFILTER)); |
256 } |
260 } |
257 |
261 |
258 private static MethodHandle filterGuard(final GuardedInvocation link, final MethodHandle filter) { |
262 private static MethodHandle filterGuard(final GuardedInvocation link, final MethodHandle filter) { |
259 final MethodHandle test = link.getGuard(); |
263 final MethodHandle test = link.getGuard(); |
260 return test == null ? null : filter(test, filter); |
264 return test == null ? null : filter(test, filter); |