Re: RFR (12): 8191053: Provide a mechanism to make system's security manager immutable

2018-10-05 Thread dean . long
On 10/5/18 6:34 AM, Alan Bateman wrote: On 05/10/2018 13:59, Sean Mullan wrote: On 10/5/18 6:40 AM, Alan Bateman wrote: The only issue I see is the statement "The class is loaded by the system class loader ..." as it's actually the built-in application class loader. Is the "built-in applic

RFR(M) 8212605: Pure-Java implementation of AccessController.doPrivileged

2018-10-31 Thread dean . long
https://bugs.openjdk.java.net/browse/JDK-8212605 http://cr.openjdk.java.net/~dlong/8212605/webrev.1 This change implements AccessController.doPrivileged in Java.  This gives a performance improvement while also being useful to Project Loom by removing the Java --> native --> Java transition.  O

Re: RFR(M) 8212605: Pure-Java implementation of AccessController.doPrivileged

2018-10-31 Thread dean . long
On 10/31/18 4:06 PM, David Holmes wrote: Hi Dean, Looking only at the hotspot changes. The removal of the DoPrivileged and related privileged_stack code seems okay. I have a few related comments: src/hotspot/share/classfile/systemDictionary.hpp You added the java_security_AccessController c

Re: RFR(M) 8212605: Pure-Java implementation of AccessController.doPrivileged

2018-10-31 Thread dean . long
Thanks David. dl On 10/31/18 5:54 PM, David Holmes wrote: Hi Dean, On 1/11/2018 10:13 AM, dean.l...@oracle.com wrote: On 10/31/18 4:06 PM, David Holmes wrote: Hi Dean, Looking only at the hotspot changes. The removal of the DoPrivileged and related privileged_stack code seems okay. I have

Re: RFR(M) 8212605: Pure-Java implementation of AccessController.doPrivileged

2018-10-31 Thread dean . long
Thanks Ioi. dl On 10/31/18 6:01 PM, Ioi Lam wrote: On 10/31/18 5:13 PM, dean.l...@oracle.com wrote: On 10/31/18 4:06 PM, David Holmes wrote: Hi Dean, Looking only at the hotspot changes. The removal of the DoPrivileged and related privileged_stack code seems okay. I have a few related co

Re: RFR(M) 8212605: Pure-Java implementation of AccessController.doPrivileged

2018-10-31 Thread dean . long
I think it's a good idea, but I believe it would require a CSR request.  Do you mind if I file a separate issue for jdk.internal.vm.annotation.Hidden? dl On 10/31/18 6:11 PM, Vladimir Ivanov wrote: Dean, src/java.base/share/classes/java/security/AccessController.java: +    /** + * Intern

Re: RFR(M) 8212605: Pure-Java implementation of AccessController.doPrivileged

2018-10-31 Thread dean . long
Hi Bernd, On 10/31/18 9:39 PM, Bernd Eckenfels wrote: http://cr.openjdk.java.net/~dlong/8212605/webrev.1/src/java.base/share/classes/java/security/AccessController.java.udiff.html In checkContext should the security manager be null checked first instead of last to optimize for the typical case

Re: RFR(M) 8212605: Pure-Java implementation of AccessController.doPrivileged

2018-11-01 Thread dean . long
Hi Peter.  Thanks for the input.  I don't know about DomainCombiner, but perhaps someone else on this list does. dl On 10/31/18 6:15 PM, Peter wrote: Hello Dean & David, Interesting reading.   Is DomainCombiner still being considered for deprecation? Our code makes heavy use of AccessContr

Re: RFR(M) 8212605: Pure-Java implementation of AccessController.doPrivileged

2018-11-01 Thread dean . long
On 11/1/18 10:01 AM, Sean Mullan wrote: Some of the copyrights need to be updated to 2018. Fixed. All else looks good to me as I had reviewed an earlier version of this before. We have talked about doing this for a while now, so I am finally glad we and are able to pretty much eliminate one

Re: RFR(M) 8212605: Pure-Java implementation of AccessController.doPrivileged

2018-11-01 Thread dean . long
On 11/1/18 9:48 AM, Sean Mullan wrote: On 11/1/18 1:29 AM, dean.l...@oracle.com wrote: On 10/31/18 9:39 PM, Bernd Eckenfels wrote: http://cr.openjdk.java.net/~dlong/8212605/webrev.1/src/java.base/share/classes/java/security/AccessController.java.udiff.html In checkContext should the security

Re: RFR(M) 8212605: Pure-Java implementation of AccessController.doPrivileged

2018-11-01 Thread dean . long
On 11/1/18 1:45 PM, Mandy Chung wrote: On 11/1/18 1:18 AM, Vladimir Ivanov wrote: I think it's a good idea, but I believe it would require a CSR request. Do you mind if I file a separate issue for jdk.internal.vm.annotation.Hidden? Sure. Most of the annotations in jdk.internal.vm.annotat

Re: RFR(M) 8212605: Pure-Java implementation of AccessController.doPrivileged

2018-11-01 Thread dean . long
On 11/1/18 12:39 PM, Sean Mullan wrote: I also replaced getCallerPD with the faster getProtectionDomain and removed a stale comment about impliesCreateAccessControlContext being called by the VM. It should be safe to remove now, but I left it in to minimize changes. I would just remove it, so

Re: RFR(M) 8212605: Pure-Java implementation of AccessController.doPrivileged

2018-11-02 Thread dean . long
Thanks Mandy.  I also appreciate you noticing (off-list) that I can remove the extra space in "Class " in several places.  I have updated webrev.4 in place. dl On 11/2/18 1:55 PM, Mandy Chung wrote: Hi Dean, I reviewed webrev.4 version.  It looks good.  Happy to see moving the doPrivileged

Re: RFR(M) 8212605: Pure-Java implementation of AccessController.doPrivileged

2018-11-03 Thread dean . long
I made a pass at improving the comments based on feedback I've received.  I updated webrev.4 in place, along with an incremental diff: http://cr.openjdk.java.net/~dlong/8212605/webrev.4.update/ dl On 10/31/18 9:39 PM, Bernd Eckenfels wrote: I find the tail call optimization comment in wrapExce

Re: RFR(M) 8212605: Pure-Java implementation of AccessController.doPrivileged

2018-11-05 Thread dean . long
Thanks Alan. dl On 11/4/18 1:03 AM, Alan Bateman wrote: On 03/11/2018 20:00, dean.l...@oracle.com wrote: I made a pass at improving the comments based on feedback I've received.  I updated webrev.4 in place, along with an incremental diff: I looked through the updated webrev.4, mostly studying

Re: RFR(M) 8212605: Pure-Java implementation of AccessController.doPrivileged

2018-11-05 Thread dean . long
Hi Roger.  Thanks for looking at this. On 11/5/18 7:21 AM, Roger Riggs wrote: Hi Dean, typo AccessController line788: "annocations" Fixed. The implementations of doPrivileged(PrivilegedExceptionAction action) and doPrivileged(PrivilegedAction action) Could be a bit more similar since exc

Re: RFR(M) 8212605: Pure-Java implementation of AccessController.doPrivileged

2018-11-05 Thread dean . long
Thanks Roger. dl On 11/5/18 2:00 PM, Roger Riggs wrote: Hi Dean, Looks ok, I have no better suggestion. Roger On 11/05/2018 01:51 PM, dean.l...@oracle.com wrote: Hi Roger.  Thanks for looking at this. On 11/5/18 7:21 AM, Roger Riggs wrote: Hi Dean, typo AccessController line788: "annoca

12 RFR(M) 8214583: AccessController.getContext may return wrong value after JDK-8212605

2018-12-14 Thread dean . long
https://bugs.openjdk.java.net/browse/JDK-8214583 http://cr.openjdk.java.net/~dlong/8214583/webrev This change includes two new regression test that demonstrate the problem, and a fix that allows the tests to pass. The problem happens when the JIT compiler's escape analysis eliminates the allo

Re: 12 RFR(M) 8214583: AccessController.getContext may return wrong value after JDK-8212605

2018-12-16 Thread dean . long
On 12/16/18 4:06 PM, David Holmes wrote: On 15/12/2018 10:59 am, dean.l...@oracle.com wrote: https://bugs.openjdk.java.net/browse/JDK-8214583 http://cr.openjdk.java.net/~dlong/8214583/webrev This change includes two new regression test that demonstrate the problem, and a fix that allows the te

Re: 12 RFR(M) 8214583: AccessController.getContext may return wrong value after JDK-8212605

2018-12-16 Thread dean . long
On 12/16/18 7:03 PM, David Holmes wrote: On 17/12/2018 12:49 pm, dean.l...@oracle.com wrote: On 12/16/18 4:06 PM, David Holmes wrote: On 15/12/2018 10:59 am, dean.l...@oracle.com wrote: https://bugs.openjdk.java.net/browse/JDK-8214583 http://cr.openjdk.java.net/~dlong/8214583/webrev This chan

Re: 12 RFR(M) 8214583: AccessController.getContext may return wrong value after JDK-8212605

2018-12-16 Thread dean . long
Unfortunately, I don't think @DontInline on an empty method is sufficient here.  If other code is relying on @DontInline for the same purpose then we might need to reexamine that code.  My understanding from discussing with other compiler engineers is that using a native method is the safest techn

Re: 12 RFR(M) 8214583: AccessController.getContext may return wrong value after JDK-8212605

2018-12-16 Thread dean . long
On 12/16/18 7:39 PM, dean.l...@oracle.com wrote: On 12/16/18 7:03 PM, David Holmes wrote: On 17/12/2018 12:49 pm, dean.l...@oracle.com wrote: On 12/16/18 4:06 PM, David Holmes wrote: On 15/12/2018 10:59 am, dean.l...@oracle.com wrote: https://bugs.openjdk.java.net/browse/JDK-8214583 http://cr

Re: 12 RFR(M) 8214583: AccessController.getContext may return wrong value after JDK-8212605

2018-12-16 Thread dean . long
On 12/16/18 9:52 PM, Claes Redestad wrote: Either way, it might be nice to have a more explicit facility for this in a future release, as David suggested. Say an @Escaping local variable/parameter annotation. I agree.  I suggested @Escapes or @StackWalkable in JDK-8214585. @Escaping or @Sta

Re: 12 RFR(M) 8214583: AccessController.getContext may return wrong value after JDK-8212605

2018-12-16 Thread dean . long
On 12/16/18 9:52 PM, Claes Redestad wrote: Fair enough, I wasn't aware EA was looking beyond the inlined code like this (which means it can't be "dead" or the JIT might see through the trick at some point). I've skimmed the existing usages in the JDK and can't find anything that seems to be depen

12 RFR(XS) 8214329: SwingMark SubMenus 9% regression in 12-b19 on Linux client

2018-12-17 Thread dean . long
https://bugs.openjdk.java.net/browse/JDK-8214329 http://cr.openjdk.java.net/~dlong/8214329/webrev/ In "8212605: Pure-Java implementation of AccessController.doPrivileged", the stackwalk in JVM_GetStackAccessControlContext was changed from using a vframeStream to using a javaVFrame, so that it c

Re: 12 RFR(M) 8214583: AccessController.getContext may return wrong value after JDK-8212605

2018-12-17 Thread dean . long
Thanks Mandy. dl On 12/17/18 2:55 PM, Mandy Chung wrote: This looks okay to me. Mandy On 12/14/18 4:59 PM, dean.l...@oracle.com wrote: https://bugs.openjdk.java.net/browse/JDK-8214583 http://cr.openjdk.java.net/~dlong/8214583/webrev This change includes two new regression test that demonstr

Re: 12 RFR(XS) 8214329: SwingMark SubMenus 9% regression in 12-b19 on Linux client

2018-12-18 Thread dean . long
Thanks Tobias. dl On 12/18/18 4:08 AM, Tobias Hartmann wrote: Hi Dean, this looks good to me. Best regards, Tobias On 17.12.18 23:49, dean.l...@oracle.com wrote: https://bugs.openjdk.java.net/browse/JDK-8214329 http://cr.openjdk.java.net/~dlong/8214329/webrev/ In "8212605: Pure-Java implem

Re: 12 RFR(XS) 8214329: SwingMark SubMenus 9% regression in 12-b19 on Linux client

2018-12-18 Thread dean . long
On 12/18/18 7:12 AM, Sean Mullan wrote: Looks good, although I think someone from the HotSpot Group should also review it. Thanks Sean.  Tobias reviewed it. On the bug, can you add the details below into the Description? Sure. Also, since you have no regression test, you will need a nore

Re: 12 RFR(M) 8214583: AccessController.getContext may return wrong value after JDK-8212605

2018-12-18 Thread dean . long
David, can I list you as a reviewer? dl On 12/16/18 8:47 PM, dean.l...@oracle.com wrote: On 12/16/18 7:39 PM, dean.l...@oracle.com wrote: On 12/16/18 7:03 PM, David Holmes wrote: On 17/12/2018 12:49 pm, dean.l...@oracle.com wrote: On 12/16/18 4:06 PM, David Holmes wrote: On 15/12/2018 10:59

Re: 12 RFR(M) 8214583: AccessController.getContext may return wrong value after JDK-8212605

2018-12-18 Thread dean . long
Claes, can I list you as a reviewer? dl On 12/16/18 9:52 PM, Claes Redestad wrote: Fair enough, I wasn't aware EA was looking beyond the inlined code like this (which means it can't be "dead" or the JIT might see through the trick at some point). I've skimmed the existing usages in the JDK and