8161379: Force inline methods calling Reflection.getCallerClass

Reviewed-by: shade, mchung
This commit is contained in:
Claes Redestad 2016-08-06 00:34:50 +02:00
parent f154b67d33
commit 8cf37c5448
6 changed files with 29 additions and 1 deletions

View file

@ -29,6 +29,7 @@ import jdk.internal.org.objectweb.asm.ClassWriter;
import jdk.internal.org.objectweb.asm.Opcodes;
import jdk.internal.reflect.CallerSensitive;
import jdk.internal.reflect.Reflection;
import jdk.internal.vm.annotation.ForceInline;
import sun.invoke.util.ValueConversions;
import sun.invoke.util.VerifyAccess;
import sun.invoke.util.Wrapper;
@ -104,6 +105,7 @@ public class MethodHandles {
* @return a lookup object for the caller of this method, with private access
*/
@CallerSensitive
@ForceInline // to ensure Reflection.getCallerClass optimization
public static Lookup lookup() {
return new Lookup(Reflection.getCallerClass());
}