mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8161379: Force inline methods calling Reflection.getCallerClass
Reviewed-by: shade, mchung
This commit is contained in:
parent
f154b67d33
commit
8cf37c5448
6 changed files with 29 additions and 1 deletions
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue