Re: Review Request: JDK-8157464: StackWalker.getCallerClass() is not

2016-09-14 Thread Brent Christian
Thanks, Mandy - sounds fine. webrev.03 all looks good to me. -Brent On 09/13/2016 05:04 PM, Mandy Chung wrote: Yes that’s one option. JVM_STACKWALK_FILL_CLASS_REFS_ONLY is not necessarily used to get caller class. For example, AccessControlContext is interested in protection domains. We coul

Re: Review Request: JDK-8157464: StackWalker.getCallerClass() is not

2016-09-14 Thread Daniel Fuchs
Hi Mandy, webrev.03 looks good to me! best regards, -- daniel On 14/09/16 01:04, Mandy Chung wrote: Yes that’s one option. JVM_STACKWALK_FILL_CLASS_REFS_ONLY is not necessarily used to get caller class. For example, AccessControlContext is interested in protection domains. We could build

Re: Review Request: JDK-8157464: StackWalker.getCallerClass() is not

2016-09-13 Thread Mandy Chung
Yes that’s one option. JVM_STACKWALK_FILL_CLASS_REFS_ONLY is not necessarily used to get caller class. For example, AccessControlContext is interested in protection domains. We could build a specialized impl class to walk the stack fetching Class only whereas getCallerClass will stop walking

Re: Review Request: JDK-8157464: StackWalker.getCallerClass() is not

2016-09-13 Thread Brent Christian
Hi, Mandy Is a new JVM_STACKWALK_GET_CALLER_CLASS bit needed in jvm.h? AFAICT, JVM_STACKWALK_FILL_CLASS_REFS_ONLY is already only set for the getCallerClass() case. Could the new get_caller_class() instead check if JVM_STACKWALK_FILL_CLASS_REFS_ONLY is set? (Yes, this would be a third fun

Re: Review Request: JDK-8157464: StackWalker.getCallerClass() is not

2016-09-13 Thread Mandy Chung
Hi Daniel, StackWalker::getCallerClass is a convenient method to find the caller class and is specified to skip the hidden frames (that’s the caller we are interested in). Since StackWalker only asks VM to fill in classes, the library can’t tell if it’s an anonymous class or not. Your questi

Re: Review Request: JDK-8157464: StackWalker.getCallerClass() is not

2016-09-13 Thread Daniel Fuchs
Hi Mandy, This looks good to me. But I wonder about these 5 lines - isn't this introducing a change of behavior if the caller is an anonymous class? 149 InstanceKlass* ik = method->method_holder(); 150 if (ik->is_anonymous()) { 151 // use the host class as the caller class

Review Request: JDK-8157464: StackWalker.getCallerClass() is not

2016-09-13 Thread Mandy Chung
Webrev: http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8157464/webrev.01 This revises the proposal posted some time ago [1]. StackWalker::getCallerClass is a convenient method to find the caller class. It will return the invoker of the MethodHandle and java.lang.reflect.Method for the method