<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<br>
<div class="moz-cite-prefix">On 07/17/2015 01:16 PM, Juergen
Ributzka wrote:<br>
</div>
<blockquote
cite="mid:4ED89B6C-A48B-4FE6-BB77-28AB8DEA7730@apple.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Jul 14, 2015, at 11:02 PM, Philip Reames <<a
moz-do-not-send="true"
href="mailto:listmail@philipreames.com" class="">listmail@philipreames.com</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="moz-cite-prefix" style="font-family: Helvetica;
font-size: 12px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
14px; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);">Comments inline. I
tried to reply to particular points of discussion
downthread, so this is probably best read last. <span
class="Apple-converted-space"> </span><br class="">
<br class="">
On 07/09/2015 02:04 PM, Juergen Ributzka wrote:<br
class="">
</div>
<blockquote
cite="mid:BDBBE029-F849-4816-B35D-A975B845B978@apple.com"
type="cite" style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
14px; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">Hi @ll,
<div class=""><br class="">
</div>
<div class="">over the past year we gained more experience
with the patchpoint/stackmap/statepoint intrinsics and
it exposed limitations in the stackmap format.</div>
<div class="">The following proposal includes feedback and
request from several interested parties and I would like
to hear your feedback.</div>
<div class=""><br class="">
</div>
<div class="">Missing correlation between functions and
stackmap records:</div>
<div class="">Originally the client had to keep track of
the ID to know which stackmap record belongs to which
function, but this would stop working once functions are
inlined.</div>
<div class="">The new format fixes that by adding a direct
reference from the function to the stackmap records.</div>
</blockquote>
<span style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 14px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); float: none;
display: inline !important;" class="">+1</span><br
style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 14px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<blockquote
cite="mid:BDBBE029-F849-4816-B35D-A975B845B978@apple.com"
type="cite" style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
14px; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<div class=""><br class="">
</div>
<div class="">Call Size and Function Size:</div>
<div class="">These are additional information that are of
interest and have been added to the format.</div>
<div class="">@Swaroop: Could you please provide a little
more detailed explanation on the "Call Size" field and
what exactly is there recorded. Is it just the call
instruction</div>
<div class="">or also the materialization code for the
address? For what is this used for?</div>
</blockquote>
<span style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 14px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); float: none;
display: inline !important;" class="">+1 subject to
details being settled</span><br style="font-family:
Helvetica; font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: 14px; orphans: auto; text-align:
start; text-indent: 0px; text-transform: none;
white-space: normal; widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255,
255, 255);" class="">
<blockquote
cite="mid:BDBBE029-F849-4816-B35D-A975B845B978@apple.com"
type="cite" style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
14px; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<div class=""><br class="">
</div>
<div class="">Flat format:</div>
<div class="">We think moving to a flat form will make
parsing easier, because every record has a fixed size
and offsets can be calculated easily.<span
class="Apple-converted-space"> </span></div>
</blockquote>
<span style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 14px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); float: none;
display: inline !important;" class="">I'm still not
convinced this is actually a good idea, but I have no
strong objection either. </span>
<blockquote
cite="mid:BDBBE029-F849-4816-B35D-A975B845B978@apple.com"
type="cite" style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
14px; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<div class="">The plan is to also</div>
<div class="">provide parsers for both stackmap versions
(there is already one for the first format in tree) and
a corresponding C-API to make it easier for clients to</div>
<div class="">adopt the new format. There is no plan to
drop the original format and we will continue to support
both formats. I will ask for feedback on the C API in a</div>
<div class="">separate RFC.<span
class="Apple-converted-space"> </span><br class="">
</div>
</blockquote>
<span style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 14px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); float: none;
display: inline !important;" class="">I strongly feel that
trying to support multiple versions of the file format in
tree is a bad idea. It's a distraction, support burden,
and provides extremely little value. What's the value in
supporting a parser for a format that ToT will no longer
be able to emit? Anyone who is actually consuming the old
format would have to be using the old version in process
anyways.</span></div>
</blockquote>
<div><br class="">
</div>
<div>I don’t think supporting multiple version will be that hard
and I don’t plan to keep all current and future version in
tree forever. But we should provide a reasonable long
transition period that allows clients to transition from one
version to another - basically one release cycle.</div>
</div>
</blockquote>
I would be perfectly okay with this proposal. I just want there to
be a documented point at which we can remove complexity. Would you
mind posting a patch for the StackMaps docs which mentions the
existence of the parser and explicitly states this policy? Having
it documented will cut down on future confusion. <br>
<blockquote
cite="mid:4ED89B6C-A48B-4FE6-BB77-28AB8DEA7730@apple.com"
type="cite">
<div><br class="">
<blockquote type="cite" class="">
<div class=""><span style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
14px; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); float: none;
display: inline !important;" class=""> <span
class="Apple-converted-space"> </span></span><br
style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 14px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<br style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 14px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<span style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 14px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); float: none;
display: inline !important;" class="">(Possible exception:
Is this intended to simplify the object caching model? If
so, have we ever given any guarantees about object caching
in the JIT across versions? That seems risky at best..)</span><br
style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 14px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<br style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 14px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<span style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 14px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); float: none;
display: inline !important;" class="">I'm also opposed to
the complexity of C API, but I'll defer that until the
separate RFC is actually posted. <span
class="Apple-converted-space"> </span></span><br
style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 14px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<blockquote
cite="mid:BDBBE029-F849-4816-B35D-A975B845B978@apple.com"
type="cite" style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
14px; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<div class=""><br class="">
</div>
<div class="">Another benefit we hope to achieve from this
format is to optimize for size by uniquing entries - but
that is independent optimization and not required.</div>
<div class=""><br class="">
</div>
<div class="">More detailed frame record:</div>
<div class="">Clients require more information about the
function frame, such as spilled registers, etc. The
frame base register i.e. might change when dynamic stack</div>
<div class="">realignment is performed on X86.</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">If there is anything missing please let me
know.</div>
<div class=""><br class="">
</div>
<div class="">Thanks</div>
<div class=""><br class="">
</div>
<div class="">Cheers,</div>
<div class="">Juergen</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
</blockquote>
<span style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 14px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); float: none;
display: inline !important;" class="">Is the format<span
class="Apple-converted-space"> </span></span><font
style="font-size: 12px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal;
line-height: 14px; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none; white-space:
normal; widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255,
255, 255);" class="" face="Courier New">Little endian, bit
endian? native endian?<br class="">
</font></div>
</blockquote>
<div><br class="">
</div>
<div>I would say whatever the object file format is.</div>
</div>
</blockquote>
That's perfectly workable. Can you make sure that gets into the
docs?<br>
<blockquote
cite="mid:4ED89B6C-A48B-4FE6-BB77-28AB8DEA7730@apple.com"
type="cite">
<div><br class="">
<blockquote type="cite" class="">
<div class=""><span style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
14px; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); float: none;
display: inline !important;" class=""></span>
<blockquote
cite="mid:BDBBE029-F849-4816-B35D-A975B845B978@apple.com"
type="cite" style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
14px; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<div class="">
<div class=""><font class="" face="Courier New">Header
v2 {<br class="">
<span class="Apple-converted-space"> </span>uint8 :
Stack Map Version (2)<br class="">
<span class="Apple-converted-space"> </span>uint8 :
Reserved [3] (0)<br class="">
<span class="Apple-converted-space"> </span>uint32
: Constants Offset (bytes)<br class="">
<span class="Apple-converted-space"> </span>uint32
: Frame Records Offset (bytes)<br class="">
<span class="Apple-converted-space"> </span>uint32
: Frame Registers Offset (bytes)<br class="">
<span class="Apple-converted-space"> </span>uint32
: StackMap Records Offset (bytes)<br class="">
<span class="Apple-converted-space"> </span>uint32
: Locations Offset (bytes)<br class="">
<span class="Apple-converted-space"> </span>uint32
: LiveOuts Offset (bytes)</font></div>
</div>
</blockquote>
<font style="font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: 14px; orphans: auto; text-align:
start; text-indent: 0px; text-transform: none;
white-space: normal; widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255,
255, 255);" class="" face="Courier New">Let's reserve at
least two uint32s for future field groups so that we can
extend in a backwards compatible way. Another option
would be to steal one of the reserved bytes and require
parsers to ignore sections they don't understand. <span
class="Apple-converted-space"> </span></font><br
style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 14px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<br style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 14px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<span style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 14px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); float: none;
display: inline !important;" class="">Actually, so long as
we document that there might be unknown bytes between
Header.end and Constants.begin we should be fine. It just
needs to be *clearly* documented.</span><br
style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 14px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
</div>
</blockquote>
<div><br class="">
</div>
<div>That was the idea. That way we could add new sections and
old parsers would still work. They would just ignore those
sections. Although with the addition of official parser in
trees I am not sure how important this is anymore.</div>
<br class="">
<blockquote type="cite" class="">
<div class=""><br style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
14px; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<span style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 14px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); float: none;
display: inline !important;" class="">As an example, if we
need to add the SymbolConstants section mentioned down
thread, that shouldn't require an version change.</span></div>
</blockquote>
<div><br class="">
</div>
<div>Once we release a LLVM version any change should require a
version change.</div>
</div>
</blockquote>
Unless existing systems will continue to work without needing the
new optional information, yes. Thinking about it, my particular
example doesn't actually meet this requirement. :) But adding a
purely informational section without a version change would be fine.<br>
<blockquote
cite="mid:4ED89B6C-A48B-4FE6-BB77-28AB8DEA7730@apple.com"
type="cite">
<div><br class="">
<blockquote type="cite" class="">
<div class=""><span style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
14px; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); float: none;
display: inline !important;" class=""> <span
class="Apple-converted-space"> </span></span><br
style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 14px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<blockquote
cite="mid:BDBBE029-F849-4816-B35D-A975B845B978@apple.com"
type="cite" style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
14px; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<div class="">
<div class=""><font class="" face="Courier New">}<br
class="">
<br class="">
align to 8 bytes<br class="">
Constants[] {<br class="">
<span class="Apple-converted-space"> </span>uint64
: LargeConstant<br class="">
}<br class="">
<br class="">
align to 8 bytes<br class="">
FrameRecord[] {<br class="">
<span class="Apple-converted-space"> </span>uint64
: Function Address<br class="">
<span class="Apple-converted-space"> </span>uint32
: Function Size<br class="">
<span class="Apple-converted-space"> </span>uint32
: Stack Size<br class="">
<span class="Apple-converted-space"> </span>uint16
: Flags {<br class="">
bool : HasFrame<br class="">
</font></div>
</div>
</blockquote>
<font style="font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: 14px; orphans: auto; text-align:
start; text-indent: 0px; text-transform: none;
white-space: normal; widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255,
255, 255);" class="" face="Courier New">What does this
mean?</font></div>
</blockquote>
<div><br class="">
</div>
<div>If the function has a frame pointer.</div>
</div>
</blockquote>
So a name like hasFramePointerRegister might be more clear? Given
that different registers can be used as frame pointers (i.e. not
just RBP), maybe this should be a Dwarf register number instead?<br>
<blockquote
cite="mid:4ED89B6C-A48B-4FE6-BB77-28AB8DEA7730@apple.com"
type="cite">
<div><br class="">
<blockquote type="cite" class="">
<div class=""><font style="font-size: 12px; font-style:
normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: 14px; orphans: auto;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255,
255, 255);" class="" face="Courier New"> <span
class="Apple-converted-space"> </span></font><br
style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 14px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<blockquote
cite="mid:BDBBE029-F849-4816-B35D-A975B845B978@apple.com"
type="cite" style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
14px; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<div class="">
<div class=""><font class="" face="Courier New"> <span
class="Apple-converted-space"> </span>bool :
HasVariableSizeAlloca<br class="">
<span class="Apple-converted-space"> </span>bool
: HasStackRealignment<br class="">
<span class="Apple-converted-space"> </span>bool
: HasLiveOutInfo<br class="">
<span class="Apple-converted-space"> </span>bool
: Reserved [12]<br class="">
</font></div>
</div>
</blockquote>
<br style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 14px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<blockquote
cite="mid:BDBBE029-F849-4816-B35D-A975B845B978@apple.com"
type="cite" style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
14px; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<div class="">
<div class=""><font class="" face="Courier New"> <span
class="Apple-converted-space"> </span>}<br
class="">
<span class="Apple-converted-space"> </span>uint16
: Frame Base Register Dwarf RegNum<br class="">
</font></div>
</div>
</blockquote>
<font style="font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: 14px; orphans: auto; text-align:
start; text-indent: 0px; text-transform: none;
white-space: normal; widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255,
255, 255);" class="" face="Courier New">I don't think this
is actually sufficient for dynamic stack realignment.
Don't you end up with some things indexed off RSP and
others indexed off RBP?</font><span style="font-family:
Helvetica; font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: 14px; orphans: auto; text-align:
start; text-indent: 0px; text-transform: none;
white-space: normal; widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255,
255, 255); float: none; display: inline !important;"
class=""> Actually, wait.. that's entirely handled within
the record format. What does tracking the Frame Base
Register give us? I think I'm missing a use case here.</span><br
style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 14px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<blockquote
cite="mid:BDBBE029-F849-4816-B35D-A975B845B978@apple.com"
type="cite" style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
14px; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<div class="">
<div class=""><font class="" face="Courier New"> <span
class="Apple-converted-space"> </span>uint16 : Num
Frame Registers<br class="">
<span class="Apple-converted-space"> </span>uint16
: Frame Register Index<br class="">
</font></div>
</div>
</blockquote>
<font style="font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: 14px; orphans: auto; text-align:
start; text-indent: 0px; text-transform: none;
white-space: normal; widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255,
255, 255);" class="" face="Courier New">Are these (begin,
begin+length) offsets into the Frame Registers table? If
so, should we swap them?</font><br style="font-family:
Helvetica; font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: 14px; orphans: auto; text-align:
start; text-indent: 0px; text-transform: none;
white-space: normal; widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255,
255, 255);" class="">
</div>
</blockquote>
<div><br class="">
</div>
<div>Sure</div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<blockquote
cite="mid:BDBBE029-F849-4816-B35D-A975B845B978@apple.com"
type="cite" style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
14px; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<div class="">
<div class=""><font class="" face="Courier New"> <span
class="Apple-converted-space"> </span>uint16 : Num
StackMap Records<br class="">
<span class="Apple-converted-space"> </span>uint16
: StackMap Record Index</font></div>
<div class=""><font class="" face="Courier New">}<br
class="">
<br class="">
align to 4 bytes<br class="">
FrameRegister[] {<br class="">
<span class="Apple-converted-space"> </span>uint16
: Dwarf RegNum<br class="">
<span class="Apple-converted-space"> </span>int16 :
Offset<br class="">
<span class="Apple-converted-space"> </span>uint8 :
Size in Bytes<br class="">
<span class="Apple-converted-space"> </span>uint8 :
Flags {<br class="">
bool : IsSpilled<br class="">
<span class="Apple-converted-space"> </span>bool
: Reserved [7]<br class="">
<span class="Apple-converted-space"> </span>}<br
class="">
}<br class="">
</font></div>
</div>
</blockquote>
<font style="font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: 14px; orphans: auto; text-align:
start; text-indent: 0px; text-transform: none;
white-space: normal; widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255,
255, 255);" class="" face="Courier New">This seems tied
specifically to the assumption that registers are spilled
on entry. Given the recent work towards shrink wrapping,
is that something we want to do?<br class="">
<br class="">
p.s. What's with the IsSpilled bit? Why would you have a
record for an unspilled register?<br class="">
</font></div>
</blockquote>
<div><br class="">
</div>
<div>This was done before shrink wrapping and pristine register
support. The original problem was that the live-out set didn’t
contain pristine registers and we have to add all callee-saved
register to the live-out set too to make sure we didn’t miss
anything. We could do better by recording which callee-save
registers actually got spilled and which not.</div>
</div>
</blockquote>
Makes sense, but isn't this still per call site information, not per
function? The format seems to imply per-function.<br>
<blockquote
cite="mid:4ED89B6C-A48B-4FE6-BB77-28AB8DEA7730@apple.com"
type="cite">
<div><br class="">
<blockquote type="cite" class="">
<div class=""><span style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
14px; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); float: none;
display: inline !important;" class=""></span>
<blockquote
cite="mid:BDBBE029-F849-4816-B35D-A975B845B978@apple.com"
type="cite" style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
14px; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<div class="">
<div class=""><font class="" face="Courier New"><br
class="">
align to 8 bytes<br class="">
StackMapRecord[] {<br class="">
<span class="Apple-converted-space"> </span>uint64
: PatchPoint ID<br class="">
</font></div>
</div>
</blockquote>
<font style="font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: 14px; orphans: auto; text-align:
start; text-indent: 0px; text-transform: none;
white-space: normal; widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255,
255, 255);" class="" face="Courier New">"ID" (remove the
patchpoint since statepoint now has one too)</font><br
style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 14px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
</div>
</blockquote>
sure</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">
<blockquote
cite="mid:BDBBE029-F849-4816-B35D-A975B845B978@apple.com"
type="cite" style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
14px; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<div class="">
<div class=""><font class="" face="Courier New"> <span
class="Apple-converted-space"> </span>uint32 :
Instruction Offset<br class="">
<span class="Apple-converted-space"> </span>uint8 :
Call size (bytes)<br class="">
</font></div>
</div>
</blockquote>
<font style="font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: 14px; orphans: auto; text-align:
start; text-indent: 0px; text-transform: none;
white-space: normal; widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255,
255, 255);" class="" face="Courier New">"Patchable size"
per down thread discussion</font><br style="font-family:
Helvetica; font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: 14px; orphans: auto; text-align:
start; text-indent: 0px; text-transform: none;
white-space: normal; widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255,
255, 255);" class="">
<blockquote
cite="mid:BDBBE029-F849-4816-B35D-A975B845B978@apple.com"
type="cite" style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
14px; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<div class="">
<div class=""><font class="" face="Courier New"> <span
class="Apple-converted-space"> </span>uint8 :
Flags {<br class="">
bool : HasLiveOutInfo<br class="">
<span class="Apple-converted-space"> </span>bool
: Reserved [7]<br class="">
<span class="Apple-converted-space"> </span>}<br
class="">
</font></div>
</div>
</blockquote>
<font style="font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: 14px; orphans: auto; text-align:
start; text-indent: 0px; text-transform: none;
white-space: normal; widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255,
255, 255);" class="" face="Courier New">Why do we need
these flags? Isn't this Num LiveOuts == 0?</font><br
style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 14px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
</div>
</blockquote>
<div><br class="">
</div>
<div>A verification that the information was actually computed -
we might have 0 live-outs too. We could also change this in
the future to attach this information only to call-sites that
have an attribute that request this information.</div>
</div>
</blockquote>
Ok.<br>
<blockquote
cite="mid:4ED89B6C-A48B-4FE6-BB77-28AB8DEA7730@apple.com"
type="cite">
<div><br class="">
<blockquote type="cite" class="">
<div class="">
<blockquote
cite="mid:BDBBE029-F849-4816-B35D-A975B845B978@apple.com"
type="cite" style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
14px; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<div class="">
<div class=""><font class="" face="Courier New"> <span
class="Apple-converted-space"> </span>uint16 : Num
Locations<br class="">
<span class="Apple-converted-space"> </span>uint16
: Location Index<br class="">
<span class="Apple-converted-space"> </span>uint16
: Num LiveOuts<br class="">
<span class="Apple-converted-space"> </span>uint16
: LiveOut Index<br class="">
}</font></div>
<div class=""><span class="" style="font-family:
'Courier New';"><br class="">
</span></div>
<div class=""><span class="" style="font-family:
'Courier New';">align to 4 bytes</span></div>
<div class=""><font class="" face="Courier New">Location[]
{<br class="">
<span class="Apple-converted-space"> </span>uint8 :
Register | Direct | Indirect | Constant |
ConstantIndex<br class="">
<span class="Apple-converted-space"> </span>uint8 :
Reserved (location flags)<br class="">
<span class="Apple-converted-space"> </span>uint16
: Dwarf RegNum<br class="">
<span class="Apple-converted-space"> </span>int32 :
Offset or SmallConstant<br class="">
}<br class="">
<br class="">
align to 2 bytes<br class="">
LiveOuts[] {<br class="">
<span class="Apple-converted-space"> </span>uint16
: Dwarf RegNum<br class="">
<span class="Apple-converted-space"> </span>uint8 :
Reserved<br class="">
<span class="Apple-converted-space"> </span>uint8 :
Size in Bytes<br class="">
}</font></div>
<div class=""><br class="">
</div>
</div>
</blockquote>
<br style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 14px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="">
<br class="Apple-interchange-newline">
</div>
</blockquote>
</div>
<br class="">
</blockquote>
<br>
</body>
</html>