summaryrefslogtreecommitdiff
path: root/chapter28a/README.md
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-11-06 16:06:02 -0800
committerCliff Click <cliffc@acm.org>2026-11-06 16:06:02 -0800
commitce3b04603d7af995004291d9a7eb668f313e6772 (patch)
tree45d3b45026c54e0a35aa3bd37069c7cccb0729bf /chapter28a/README.md
parent8f460340cfe01a4945635251bcd33b257b699bf7 (diff)
downloadSimple-ce3b04603d7af995004291d9a7eb668f313e6772.tar.gz
Simple-ce3b04603d7af995004291d9a7eb668f313e6772.zip
Cleanup public escapes
Drop "frozen" public escapes, and recompute in Start/Stop so Opto gets a precise escape set. Rename XInt.free -> XInt.alloc Fix some String tests to not escape by default
Diffstat (limited to 'chapter28a/README.md')
-rw-r--r--chapter28a/README.md27
1 files changed, 25 insertions, 2 deletions
diff --git a/chapter28a/README.md b/chapter28a/README.md
index d46a24d7..3dec4c4f 100644
--- a/chapter28a/README.md
+++ b/chapter28a/README.md
@@ -145,8 +145,8 @@ that private fields are visible only inside their declaring class, not to
siblings or parents. A private enclosing class also keeps its children out of
the public interface.
-The current compiler uses these names to choose the public interface and seed
-escape analysis, but does not yet enforce the source access rule. For example,
+The current compiler uses these names to select public fields and initializer
+roots for escape discovery, but does not yet enforce the source access rule. For example,
a sibling can currently read `A._secret`. Rejecting that access is still needed;
the underscore alone is not an enforced boundary in this snapshot.
@@ -236,6 +236,29 @@ sets the flag. Generated calls have conservative memory effects and do not
reopen SCCP's analysis of the optimized bodies.
+### Escaping or the Start/Stop Cycle
+
+The semantics of Stop/CU are that execution has left the current compilation,
+and proceeded out into the unknown World. The reverse happens at Start/CU: we
+enter the known code from the outside World. This endless cycle, Start ->
+known code -> Stop -> Start, lets us model escaping local functions and aliases
+into the outside, and then seeing them again coming in as callbacks, or
+arguments or side-effects. Tracking this exactly lets us know when we have
+"escaped" a otherwise private function to the World, which might then call it
+directly, or pass it back to us as an argument, or store it for later.
+
+`LocalIds` tracks foreign identities, excluding the local IDs. Calls and
+escaping values add local identities as SCCP converges. Unknown callback
+parameters and results read this state. A class function's hidden receiver
+defaults to its class singleton, while its signature keeps the generic hidden
+slot used by the calling convention.
+
+Public constructor fields expose the allocator. Initializers and constructor
+helpers that accept private memory stay internal. Class-init checks read their
+initializer's memory effects, and unknown callbacks participate in class-init
+cycle detection through the functions that have escaped.
+
+
## Emitting code and data
After cleanup by `FinishCalls`, the live code and data from the discovered