collections: element steps and --explain-copies through the ArrayList record (follow-up of #526) #565
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Follow-up of #526 (PR #529, step 3 of #55). Since
ArrayListis a TorbScript record overBuffer<Item>(items,start,count, COLLECTION-STORAGE.md decision 1), two passes no longer see the list through that record:ir/elements.trb:isListSetteraccepts asetthat forwards toitems.set index, value(the wrapper shape of #468), butArrayList.setrebases a windowed or shared list first and writes atstart + index. Soa[i].f = von anArrayListtakes the round trip (read the item, write the field,setit back) instead of onePathStep.Element.--explain-copies(torb build --explain-copies) reports no copy for a nested write into anArrayListrow another value still holds.PR #529 moved the compiler tests that pin these shapes (
elements.test.trb,explain-copies.test.trb,lower-natives.test.trb,lower-places.test.trb,crossing.test.trb,partial.test.trb) andtests/command-line/copiesto the harness/stdTrieList, which is still the runtime's list, so they keep testing the passes. The harness prelude (compiler/tests/harness.trb) still declaresnative type ArrayListwithout manifest rows; only the debugger tests andlower-collectionsuse the std shape (windowedList,declaredListFiles).Goal
A write through an element of an
ArrayListis one element step again,--explain-copiesnames its copy, and the tests run over theArrayListof the std shape.Acceptance criteria
ir/elements.trbsees through thesetof theArrayListrecord (the rebase, then the storage'ssetatstart + index):a[i].f = v,grid[i][j] = v, a method and a closure on an element are element steps on anArrayList, aselements.test.trbpins for the runtime's list.--explain-copiesreports the copy of a nested write into a sharedArrayListrow (explain-copies.test.trb,tests/command-line/copiesoverArrayListagain).ArrayListin the std shape (nonative type ArrayList), and the tests moved toTrieListin #529 go back toArrayListwhere they are about it.Dependencies
#526 / PR #529 (lands first). Epic #55.
[loop:orion] labelled
loop: live-design follow-up of #526 / PR #529 (epic #55), filed by an interactive session without the label. Not superseded; no retirement.[loop:torbscript] intake: in scope (author orion, label loop), no duplicate, no collision with a design record; dependency #526 / PR #529 is merged. Compiler pass work (ir/elements, --explain-copies), no owner question, no seed change known (to be confirmed in refine). next: refine