<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <tt>This looks okay to me.<br>
      <br>
      Mandy<br>
    </tt><br>
    <div class="moz-cite-prefix">On 12/14/18 4:59 PM,
      <a class="moz-txt-link-abbreviated" href="mailto:dean.long@oracle.com">dean.long@oracle.com</a> wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:83fe9df6-14eb-1d3a-1f70-120e95f08024@oracle.com"><a class="moz-txt-link-freetext" href="https://bugs.openjdk.java.net/browse/JDK-8214583">https://bugs.openjdk.java.net/browse/JDK-8214583</a>
      <br>
      <a class="moz-txt-link-freetext" href="http://cr.openjdk.java.net/~dlong/8214583/webrev">http://cr.openjdk.java.net/~dlong/8214583/webrev</a>
      <br>
      <br>
      This change includes two new regression test that demonstrate the
      problem, and a fix that allows the tests
      <br>
      to pass.
      <br>
      <br>
      The problem happens when the JIT compiler's escape analysis
      eliminates the allocation of the AccessControlContext object
      passed to doPrivileged.  The compiler thinks this is safe because
      it does not see that the object "escapes".  However, getContext
      needs to be able to find the object using a stack walk, so we need
      a way to tell the compiler that it does indeed escape.  To do this
      we pass the value to a native method that does nothing.
      <br>
      <br>
      Microbenchmark results:
      <br>
      <br>
      jdk12-b18:
      <br>
      <br>
      Benchmark                Mode  Cnt    Score   Error  Units
      <br>
      DoPrivileged.test        avgt   25  255.626 ± 6.446  ns/op
      <br>
      DoPrivileged.testInline  avgt   25  250.968 ± 4.975  ns/op
      <br>
      <br>
      <br>
      jdk12-b19:
      <br>
      <br>
      Benchmark                Mode  Cnt  Score    Error  Units
      <br>
      DoPrivileged.test        avgt   25  5.689 ±  0.001  ns/op
      <br>
      DoPrivileged.testInline  avgt   25  2.765 ±  0.001  ns/op
      <br>
      <br>
      this fix:
      <br>
      <br>
      Benchmark                Mode  Cnt  Score    Error  Units
      <br>
      DoPrivileged.test        avgt   25  5.020 ±  0.001  ns/op
      <br>
      DoPrivileged.testInline  avgt   25  2.774 ±  0.025  ns/op
      <br>
      <br>
      <br>
      dl
      <br>
    </blockquote>
    <br>
  </body>
</html>