Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If one is debugging, not all optimizations need to be turned on unless you are debugging the optimization itself. So tail recursion optimization (TRO) doesn't have to disable backtraces during debugging unless the development environment is braindead (eg., doesn't have a "disable optimizations" option). </p> <p>The <em>space</em> occupied by the metadata if you did record it is pretty small; basically its says, "a recursive call was made". A linked list with elements of a small number of bytes would do the trick. But I don't think it would make sense to record backtrace metadata in the face of TRO; if you are optimizing, you probabaly don't want to pay the extra time cost of recording the metadata, either, just because somebody <em>might</em> want to debug later. </p> <p>I'm not sure what <em>you</em> mean by "minimize the size of stack frame" since you ask in the context of TRO. In general, a good compiler will minimize the size by automatically by only assigning enough space to do the the entire computation of the (sub)routine which the stack frame instance represents. One standard optimization is letting variables with non-overlapping lifetimes share the same space in the stack frame. One can do this a couple of different ways: a) nested scopes inside the body of the subroutine which don't overlap can trivially share their space in a stack-like discipline, and b) treating the "stack frame" not so much as a stack, but as a bunch of registers for storing spilled values; a register coloring algorthim can handle this pretty nicely.</p> <p>Sometimes stack frame minimization is damaged by the (lack of) support by the OS. See <a href="https://stackoverflow.com/q/994555/120163">this</a> for a discussion of how Windows traps damage stack frame size considerably.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload