<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    Here is an updated webrev with the added assert:<br>
    <a class="moz-txt-link-freetext" href="http://cr.openjdk.java.net/~brutisso/7131791/webrev.05">http://cr.openjdk.java.net/~brutisso/7131791/webrev.05</a><br>
    <br>
    Bengt<br>
    <br>
    On 2012-01-20 17:56, Bengt Rutisson wrote:
    <blockquote cite="mid:4F199CA0.1090606@oracle.com" type="cite">
      <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
      <br>
      Stefan, are you OK with adding the assert that Tony suggested?<br>
      <br>
      Bengt<br>
      <br>
      On 2012-01-20 17:44, Stefan Karlsson wrote:
      <blockquote cite="mid:4F1999FD.6020009@oracle.com" type="cite">
        <meta content="text/html; charset=UTF-8"
          http-equiv="Content-Type">
        On 2012-01-20 17:46, Bengt Rutisson wrote:
        <blockquote cite="mid:4F199A60.6070506@oracle.com" type="cite">
          <meta content="text/html; charset=UTF-8"
            http-equiv="Content-Type">
          <br>
          Stefan,<br>
          <br>
          Thanks for the prompt review!<br>
          <br>
          Comments inline.<br>
          <br>
          On 2012-01-20 17:21, Stefan Karlsson wrote:
          <blockquote
            cite="mid:8C7CE33B-1215-4828-836B-EC0860F5D5CF@oracle.com"
            type="cite">
            <div><span class="Apple-style-span"
                style="-webkit-tap-highlight-color: rgba(26, 26, 26,
                0.296875); -webkit-composition-fill-color: rgba(175,
                192, 227, 0.230469); -webkit-composition-frame-color:
                rgba(77, 128, 180, 0.230469); ">On 20 jan 2012, at
                17:06, Bengt Rutisson <<a moz-do-not-send="true"
                  href="mailto:bengt.rutisson@oracle.com">bengt.rutisson@oracle.com</a>>



                wrote:</span><br>
            </div>
            <div><br>
            </div>
            <blockquote type="cite">
              <div><span></span><br>
                <span>Hi all,</span><br>
                <span></span><br>
                <span>Can I have a couple of quick reviews for this
                  small change:</span><br>
                <span><a moz-do-not-send="true"
                    href="http://cr.openjdk.java.net/%7Ebrutisso/7131791/webrev.02">http://cr.openjdk.java.net/~brutisso/7131791/webrev.02</a></span><br>
                <span></span><br>
                <span>This should hopefully fix the 500+ failures in the
                  G1 nightlies. So, I would like to get it in before the
                  nightlies tonight.</span><br>
                <span></span><br>
                <span>The issue is that we call collect() which will
                  trigger a collection without protecting the memory
                  that we just allocated for a humongous object. The fix
                  (thanks Tony for helping me out!!!) is to fake an
                  object and create a handle to it before we call
                  collect.</span><br>
              </div>
            </blockquote>
            <div><br>
            </div>
            <pre><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;"><span class="changed">1067         Handle h((oop)result);</span> </span></font></pre>
            <pre><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">1068         collect(GCCause::_g1_humongous_allocation); </span></font></pre>
            <pre><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">1069       } </span></font></pre>
            <pre><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">1070       return result; </span></font></pre>
            <pre><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">1071     }</span></font></pre>
            <pre><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">Can we really have a handle to uninitialized memory?</span></font></pre>
          </blockquote>
          <br>
          The memory is not uninitialized since I fake an object there
          with the call to CollectedHeap::fill_with_object(result,
          word_size, false); just before the code you have above.<br>
        </blockquote>
        <br>
        I missed that.<br>
        <br>
        <blockquote cite="mid:4F199A60.6070506@oracle.com" type="cite">
          <br>
          <blockquote
            cite="mid:8C7CE33B-1215-4828-836B-EC0860F5D5CF@oracle.com"
            type="cite">
            <pre><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">Are you sure that the humongous object will not be moved by a full collection. You should probably return h() instead of result.</span></font></pre>
          </blockquote>
          <br>
          Humongous objects will not be moved by G1 collections so I
          think we are ok.<br>
        </blockquote>
        <br>
        OK. But maybe we should be a bit defensive and return h() here.<br>
        <br>
        StefanK<br>
        <br>
        <blockquote cite="mid:4F199A60.6070506@oracle.com" type="cite">
          <br>
          Thanks for the prompt review!<br>
          <br>
          Bengt<br>
          <blockquote
            cite="mid:8C7CE33B-1215-4828-836B-EC0860F5D5CF@oracle.com"
            type="cite">
            <pre><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">
</span></font></pre>
            <pre><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">StefanK</span></font></pre>
            <br>
            <blockquote type="cite">
              <div><span></span><br>
                <span>Bengt</span><br>
              </div>
            </blockquote>
          </blockquote>
          <br>
        </blockquote>
        <br>
      </blockquote>
      <br>
    </blockquote>
    <br>
  </body>
</html>