[M3commit] [modula3/cm3] 5aaf69: Fix p035, p062, p088, p137, and p180. Regress p06...

Rodney Bates rodney.m.bates at acm.org
Sat Sep 19 18:11:13 CEST 2015


  Branch: refs/heads/master
  Home:   https://github.com/modula3/cm3
  Commit: 5aaf69f2c64e7c1870c03109913954445f3e8110
      https://github.com/modula3/cm3/commit/5aaf69f2c64e7c1870c03109913954445f3e8110
  Author: Rodney Bates <rodney.m.bates at acm.org>
  Date:   2015-09-19 (Sat, 19 Sep 2015)

  Changed paths:
    M m3-sys/llvm3.6.1/src/M3CG_LLVM.m3

  Log Message:
  -----------
  Fix p035, p062, p088, p137, and p180.  Regress p064 and p116b.

Changes to handling of up-level addressing, motivated by p035, but
affecting the others.  p116b developed a new compile failure, and p064
had changed RT output.  The p116b problem is very likely the result of
a known leftover loose end.

I am calling the arrays of pointers used in uplevel addressing
"displays".  This are not the traditional display, which is an array
of pointers to activation records, but rather an array of pointers to
individual variables, possibly in multiple activation records.

Reverse the order of variables in a display to outside-in.  This
allows a procedure to have a single display for all its calls on
nested procedures.  For callees no deeper than the caller, the same
display is passed, but only a prefix of the display will be used by
the callee.

Keep the compile-time info about the display in the caller, rather
than the callee.

Postpone emitting code to build the display to end_procedure.  There
can be locals of blocks nested inside the procedure that are flattened
into its activation record, but not seen until after calls referencing
the display have been compiled.  Previously, up-level references to
these were missed.  The display building code is emitted at
end_procedure, but inserted in the entry block, so at runtime, it is
executed before any calls.

The leftover loose end is in call_direct.  There was a preexisting
special case intended detect and provide special handling for a
try-finally compiler-generated procedure being called with no
frontend-supplied static link.  This was being spoofed by a
programmer-coded procedure. This case is currently disabled, pending a
reliable way of detecting its occurrence.




More information about the M3commit mailing list