< prev index next >
src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JSObjectLinker.java
Print this page
*** 69,78 ****
--- 69,81 ----
@Override
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) {
inv = lookup(desc, request, linkerServices);
inv = inv.replaceMethods(linkerServices.filterInternalObjects(inv.getInvocation()), inv.getGuard());
*** 80,90 ****
// guard to make sure the Map or Bindings does not turn into JSObject later!
final GuardedInvocation beanInv = nashornBeansLinker.getGuardedInvocation(request, linkerServices);
inv = new GuardedInvocation(beanInv.getInvocation(),
NashornGuards.combineGuards(beanInv.getGuard(), NashornGuards.getNotJSObjectGuard()));
} else {
! throw new AssertionError(); // Should never reach here.
}
return Bootstrap.asTypeSafeReturn(inv, linkerServices, desc);
}
--- 83,93 ----
// guard to make sure the Map or Bindings does not turn into JSObject later!
final GuardedInvocation beanInv = nashornBeansLinker.getGuardedInvocation(request, linkerServices);
inv = new GuardedInvocation(beanInv.getInvocation(),
NashornGuards.combineGuards(beanInv.getGuard(), NashornGuards.getNotJSObjectGuard()));
} else {
! throw new AssertionError("got instanceof: " + self.getClass()); // Should never reach here.
}
return Bootstrap.asTypeSafeReturn(inv, linkerServices, desc);
}
< prev index next >