Repository navigation
Conversation
…result), unique or not, and a field move's region safety
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
--memnow lists every move of a value and says whether moving it is safe for its regions.moves[]={kind, def, from, to, unique, fromRegions, toRegions, safe, why}. Kinds:bind(val, var),assign,pattern,field(into a new box),ret(into its def's result),arg(into a callee's param),result(a callee's result into its call).from/toare node ids (a var's id is itsvarsid).unique: the source is unshared, so the value moves and nothing else reads it.fieldmove stores a box into memory. It is safe when every region of the stored value outlives (or is) the new box's own region (why: outlives), elsesafe: false, why: shorter, fromRegion, intoRegion. Every other move stores nothing (why: noStore).outl(R1, R2): R2 is handled inside R1 (the innermost handle around it in its def), or at the top of a def that runs in R1, and on through outl.own(N, R): the region of the box made at site N itself.marg/mres: the moves across a call.f{r}(..)runs f in r (before, it always ran in the innermost handle).Mem.Atkeeps the handles in scope by name.New test
tests/s2/mem/moves.srs: a box of r stored into a box of t inside r (safe);MW.into{r}stores a box of t into a box of r (unsafe: shorter);MW.localstores a box of r into a box of its own region q, two outl steps away (safe); bind, arg and pattern moves. Checked by hand; the program runs and prints 6.On s2c: 47,565 moves (arg 15,978, pattern 13,776, result 6,698, field 5,701, ret 4,506, bind 903, assign 3), 0 unsafe.
Checks:
movesand compares).--mem1.715 G -> 1.894 G (+10.4%).Mutants (each builds):
ownruleoutlrule for lexical nestingoutlrule for a def's top regionMW.local)outltransitivityMW.local)MW.into{r})bind, notfieldmargrule