nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/beans/SingleDynamicMethod.java
changeset 33331 273e6a10de22
parent 33007 03119bfefbbf
child 33337 af3fea63e008
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/beans/SingleDynamicMethod.java	Mon Oct 19 08:23:03 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/beans/SingleDynamicMethod.java	Mon Oct 19 08:30:03 2015 +0200
@@ -119,15 +119,17 @@
     abstract MethodType getMethodType();
 
     /**
-     * Given a specified lookup, returns a method handle to this method's target.
-     * @param lookup the lookup to use.
+     * Given a specified call site descriptor, returns a method handle to this method's target. The target
+     * should only depend on the descriptor's lookup, and it should only retrieve it (as a privileged
+     * operation) when it is absolutely needed.
+     * @param desc the call site descriptor to use.
      * @return the handle to this method's target method.
      */
-    abstract MethodHandle getTarget(MethodHandles.Lookup lookup);
+    abstract MethodHandle getTarget(CallSiteDescriptor desc);
 
     @Override
     MethodHandle getInvocation(final CallSiteDescriptor callSiteDescriptor, final LinkerServices linkerServices) {
-        return getInvocation(getTarget(callSiteDescriptor.getLookup()), callSiteDescriptor.getMethodType(),
+        return getInvocation(getTarget(callSiteDescriptor), callSiteDescriptor.getMethodType(),
                 linkerServices);
     }