<div dir="ltr"><div>Now I am finally able to build the Swift runtime with an extended object header and run some benchmarks.  For future reference, in addition to making changes similar to the commits which Greg pointed to, I needed to change the Foundation library&#39;s CFRuntimeBase class which mirrors the Swift&#39;s object header layout.<div><br><div class="gmail_quote"><div dir="ltr">On Thu, Sep 28, 2017 at 11:52 PM Greg Parker &lt;<a href="mailto:gparker@apple.com">gparker@apple.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><br><div><blockquote type="cite"><div>On Sep 27, 2017, at 10:39 AM, John McCall via swift-dev &lt;<a href="mailto:swift-dev@swift.org" target="_blank">swift-dev@swift.org</a>&gt; wrote:</div><br class="m_-6151553826626617063Apple-interchange-newline"><div><div style="word-wrap:break-word"><div><blockquote type="cite"><div>On Sep 27, 2017, at 1:24 PM, Jiho Choi &lt;<a href="mailto:jray319@gmail.com" target="_blank">jray319@gmail.com</a>&gt; wrote:</div><br class="m_-6151553826626617063Apple-interchange-newline"><div><div dir="ltr">Thanks for the explanation.  I modified those two locations you mentioned but the build failed during tests.  I&#39;ve been browsing the source code to figure out other dependences but didn&#39;t succeed yet.  Could you please give me some pointers on where to look at?</div></div></blockquote><div><br></div><div>You&#39;ll have to look at the test failures individually.  If they&#39;re just IRGen tests failing because the IR no longer matches the current output, then you need to either fix the tests or just ignore them for the purposes of your experiment.  If they&#39;re IRGen tests failing because the compiler is crashing, or execution tests failing because the running code is crashing, it&#39;s likely that I just forgot something that depends on the output.  We&#39;re not going to be able to debug this problem for you in the abstract, though.</div></div></div></div></blockquote><br></div></div><div style="word-wrap:break-word;line-break:after-white-space"><div>You should look at pull requests #7837 and #9214:</div><div><a href="https://github.com/apple/swift/pull/7837" target="_blank">https://github.com/apple/swift/pull/7837</a></div><a href="https://github.com/apple/swift/pull/9214" target="_blank">https://github.com/apple/swift/pull/9214</a><div><br><div>#7837 the object header size on 32-bit architectures. The PR is not currently up-to-date, but should give you an idea of the scope of changes that would be necessary for your experiment. #9214 is an addition after #7837 that would also be affected by a header size change.</div><div><br></div><div><br></div><div>Another approach for experimental purposes is to modify StrongRefCount without changing its size. That struct is designed to store some data inline, and if necessary can transform into an out-of-line form that stores data of any size. </div><div><br></div><div>You could change the arrangement of bits in the StrongRefCount inline form if you only need a few bits for your storage. </div><div><br></div><div>Or you could force StrongRefCount to always use the out-of-line form and store whatever data you want there. This would be slower but probably fine for experimentation.</div></div></div><div style="word-wrap:break-word;line-break:after-white-space"><div><div><br></div><div><br></div><div>-- </div><div>Greg Parker     <a href="mailto:gparker@apple.com" target="_blank">gparker@apple.com</a>     Runtime Wrangler</div><div><br></div><div><br></div></div></div></blockquote></div></div></div></div>