Changes between Version 10 and Version 11 of Commentary/Compiler/CPS


Ignore:
Timestamp:
May 22, 2007 10:34:59 AM (8 years ago)
Author:
guest
Comment:

Added note about GC

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/CPS

    v10 v11  
    100100   * {{{CmmFormals}}} are {{{[(CmmReg,MachHint)]}}}
    101101   * This field seems to not have been being used; it only require a type change
     102 * GC can be cleaned up b/c of the CPS
     103   * Before
     104{{{
     105f (x, y) {
     106  if (Hp + 5 > HpLim) {
     107    jump do_gc;
     108    // do_gc looks up the function type in it's info table
     109    // and saves a "RET_FUN" frame on the stack
     110    // RET_FUN fames are different than every other frame
     111    // in that the info table isn't on the RET_FUN code
     112    // but on the slot under RET_FUN which is filled with 'f'
     113  }
     114}
     115g (a, b, c, d, e) {
     116  if (Hp + 5 > HpLim) {
     117    jump do_gc;
     118    // Gen-calls have a special tag
     119  }
     120}
     121}}}
     122   * After
     123{{{
     124f (f, x, y) {
     125  if (Hp + 5 > HpLim) {
     126    jump do_gc_pp(f, x, y); // becomes jump do_gc_pp;
     127    // Tail call, note that arguments are in same order
     128    // as the arguments to 'f'
     129    // Also can skip the table lookup and
     130    // do_gc_pp can be high-level C-- and save us the
     131    // work of saving f, x, and y
     132  }
     133}
     134g (g, a, b, c, d, e) {
     135  if (Hp + 5 > HpLim) {
     136    call do_gc(g, a, b, c, d, e);
     137    jump g(g, a, b, c, d, e);
     138    // The general form will generate
     139    // a custom continuation
     140  }
     141}
     142}}}