summaryrefslogtreecommitdiff
path: root/chapter33/src/main/java
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-12-04 14:52:23 -0800
committerCliff Click <cliffc@acm.org>2026-12-04 14:52:23 -0800
commit58ede6e92922602a4b4f1b46cdcb8b6082e931e7 (patch)
treee28e74afa62233d7ca9b890ccfddf731145a164b /chapter33/src/main/java
parent29db300e59821b0b9c1abf478aade5f6d36bf408 (diff)
downloadSimple-58ede6e92922602a4b4f1b46cdcb8b6082e931e7.tar.gz
Simple-58ede6e92922602a4b4f1b46cdcb8b6082e931e7.zip
Publish escapes from the selected field value
Keep prior public escapes and derive new escapes from the field value bounded by its declaration. Do not import unrelated aggregate-private escapes or broaden them when selecting a weaker alias slice. Cover callback publication, alias selection, borrows, and opaque referents. Full make -k -j8 tests passes.
Diffstat (limited to 'chapter33/src/main/java')
-rw-r--r--chapter33/src/main/java/com/seaofnodes/simple/node/EscapeNode.java15
1 files changed, 7 insertions, 8 deletions
diff --git a/chapter33/src/main/java/com/seaofnodes/simple/node/EscapeNode.java b/chapter33/src/main/java/com/seaofnodes/simple/node/EscapeNode.java
index 3c759c48..cc1b3b58 100644
--- a/chapter33/src/main/java/com/seaofnodes/simple/node/EscapeNode.java
+++ b/chapter33/src/main/java/com/seaofnodes/simple/node/EscapeNode.java
@@ -93,14 +93,13 @@ public class EscapeNode extends TypeNode {
// edge, not publication to unknown callers. Keep the public escape sets.
if( _borrow )
return TypeMem.make(fld._alias,t,false,false,false,mpub._escFs,mpub._escAs);
- TypeSet fidxes = mpriv._escFs.meet(mpub._escFs);
- TypeSet aliases = mpriv._escAs.meet(mpub._escAs);
- // Keep escapes from the actual private value before narrowing it to
- // the declaration. Selecting its Store from a MemMerge must preserve
- // this result, including Scalar.BOT's unknown pointer escapes.
- TypeMem defaults = CodeGen.CODE._phase.ordinal()<CodeGen.Phase.Opto.ordinal() ? TypeMem.BOT : mpub;
- return TypeMem.make(fld._alias, t, false, false, fld._final, fidxes, aliases)
- .escapesFrom(tpriv,defaults).escapesFrom(t,defaults);
+ // Publish this field's value, bounded by its declaration. The private
+ // aggregate's escapes include other fields, and selecting an alias
+ // from it can expose a weaker scalar/escape bound. Neither changes
+ // which values this field can hold. Opaque referents contribute the
+ // identities already available in public memory.
+ return TypeMem.make(fld._alias,t,false,false,fld._final,mpub._escFs,mpub._escAs)
+ .escapesFrom(t,mpub);
}
@Override public Node idealize() {