nashorn/src/jdk/nashorn/internal/runtime/WithObject.java
changeset 17234 7eda96a52c27
parent 16780 f23743ec1a93
child 17236 75779a53c6a9
equal deleted inserted replaced
17233:72ccf78a8216 17234:7eda96a52c27
   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);