# HG changeset patch # User redestad # Date 1468876386 -7200 # Mon Jul 18 23:13:06 2016 +0200 # Node ID b3c43c0dcd4cfcf74b5881bca02935b9c14eb423 # Parent c1ee9fefb768323046fdc4d130017b1ff7d4b576 8161379: @CallerSensitive methods should be forcefully inlined to get Reflection.getCallerClass optimization Reviewed-by: twisti Contributed-by: claes.redestad@oracle.com, aleksey.shipilev@oracle.com diff --git a/src/share/vm/classfile/classFileParser.cpp b/src/share/vm/classfile/classFileParser.cpp --- a/src/share/vm/classfile/classFileParser.cpp +++ b/src/share/vm/classfile/classFileParser.cpp @@ -2044,8 +2044,11 @@ } void MethodAnnotationCollector::apply_to(methodHandle m) { - if (has_annotation(_method_CallerSensitive)) + if (has_annotation(_method_CallerSensitive)) { m->set_caller_sensitive(true); + // implicitly set force inline to force better usage of Reflection.getCallerClass intrinsic + m->set_force_inline(true); + } if (has_annotation(_method_ForceInline)) m->set_force_inline(true); if (has_annotation(_method_DontInline))