--- old/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JSObjectLinker.java 2016-02-29 10:05:08.203148800 +0530 +++ new/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JSObjectLinker.java 2016-02-29 10:05:07.763148200 +0530 @@ -71,6 +71,9 @@ public GuardedInvocation getGuardedInvocation(final LinkRequest request, final LinkerServices linkerServices) throws Exception { final Object self = request.getReceiver(); final CallSiteDescriptor desc = request.getCallSiteDescriptor(); + if (self == null || !canLinkTypeStatic(self.getClass())) { + return null; + } GuardedInvocation inv; if (self instanceof JSObject) { @@ -82,7 +85,7 @@ inv = new GuardedInvocation(beanInv.getInvocation(), NashornGuards.combineGuards(beanInv.getGuard(), NashornGuards.getNotJSObjectGuard())); } else { - throw new AssertionError(); // Should never reach here. + throw new AssertionError("got instanceof: " + self.getClass()); // Should never reach here. } return Bootstrap.asTypeSafeReturn(inv, linkerServices, desc);