A by-reference parameter that a subfield store proves a structure is written as one; one template name per layout (touches rpg_source.zig) #785
Loading…
Reference in a new issue
No description provided.
Delete branch "lparm"
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?
Lane Lparm. Three shapes of parameter text were written wrong with no failure line. Measured on the stripped objects of
lsel-for-arr-if-*, the six public Async captures and the batterycaptures/lparm-param-shapes(24 cases, all compiled; six are adopted as probes:lpar-ar-const-varsize,lpar-ar-plain,lpar-lk-set-static,lpar-lk-set-both,lpar-pv-val-int,lpar-pv-ref-int).likedsparameter (snap.handle = task;). The store is29 P 0 T; 29 V 0 T; 75 8; 75 4; 75 4; 42 F 0 T': F is the 15-byte character field at the pointer P of the parameter, T' the 4-byte integer type. A store of 4 bytes at byte 0 of a 15-byte field is a subfield, not the field.narrowPlaces(29 P 0 Tdirectly before32|42 F 0 T') misses it because75conversions stand between, so the assignment was written to the whole parameter, declaredchar(15)(X = V;, RNF7416). The rule reads the store itself (parts_mod.narrowStoreAtZero: the one typed42 F 0 T'of the statement on the character field F, not a padded store, narrower than F) and takes the lv-pds-likeds-set route: byte 0 is a part typed by the store, the parameter islikeds(TMPL15)and the templateF0 int(10); G4 char(11)is written before the first procedure. A byte 0 with two types is a failure line. A packed or zoned parameter is not read this way (its symbol length is in digits). Battery: lk-set-static, lk-set-local and lk-set-expr now emit free of failure lines exceptcompiler statement 2100000001 is partial.declare, site s07). Proof: lk-set-both (snap.handle = task; snap.state = 1;, the caller's structure static) was writtenV00258 = V00259; V00258.F4 = 1;before, the first store to the whole parameter; it now has two failure lines and no wrong text. The template is named by the length of its parameter, and the six Async captures wrote fivedcl-ds TMPL2182 qualified templatewith five layouts (the same name five times, no failure line). Two parameters of one length with one layout now share one declaration, another layout is namedTMPLn_symbol(paramTemplateName); the Async emits have the same failure counts and statements. No committed object has two such parameters, so no test pins it; lk-two-same takes the existing structure route for its second parameter.29 P 0 T; ...; 27 K; 138; 78 4; 65 W; [loads and conversions of the other operand]; 32|42 F 0 TE: operation 138 holds the largest zero-based index and operation 65 the element width, as for an array of the module (rpg_array_element.zig). One K, W and TE on every access, TE W bytes wide and (K + 1) * W the length of F proveTE dim(K + 1)for the parameter. The first ship of this branch wrote that text; on the hostlpar-ar-plainandlpar-ar-const-varsizewent fromdifferenttofailed(RNF7535 at the call: the argument field of the caller keeps its own declaration, here a qualified structure with a store at byte 0, beside a parameter of the array type). A half-applied type is worse than the consistent character field, so the array rule is taken out: the parameter stayschar(40), the same as before this branch, and the test pins that both sides keep one declaration. Writing the array needs the argument field declared as the array too, with its statements as element accesses (ids(1) = 1), proved from the call; that is the next change. Doesconstoroptions(*varsize)leave a trace?options(*varsize): none. lpar-ar-const-varsize and lpar-ar-const have the same operations, operands (symbol numbers aside) and entry symbols in both procedures, caller and callee.const: the callee is the same as plainint(10) dim(10); the caller of the const case has five more operations (6 1; 27 C; 35 T; 15 L 2; 6 2) before the statement that calls it, a temporary that I did not tie to the parameter, so it is not used. A parameter that the procedure only passes on (ar-passouter, Async_WaitAny and the like) keeps its character field, and one read at a constant index (ar-first) its structure route; the character array (ar-char) is not a field-typed access.arg pointer valueis the same 32 bytes as that of a by-referencelikeds,varchar constordim() const options(*varsize)parameter: kind 9, class 5, length 16, word 2880100000, word 24f0008000when the body uses it ande0008000when it does not. Pairs of the battery, stripped objects, statement numbers and symbol numbers aside: pv-ref-int/pv-val-int, pv-copy-ref/pv-copy-val and pv-nop-ref/pv-nop-val have the same operations in the callee (take), the same entry symbols and the same symbol table apart from the length of the module procedure symbol and one unused field symbol; pv-ref-based/pv-val-var likewise (the callee is the same, the caller differs in the same one operation). So the callee object does not hold the form, and the emitter writes for both sources the by-reference text (x int(10),x int(10) options(*nopass)), which recompiles to the callee of the by-reference source, the same object as that of the by-value source. The callers differ in one operation in all four pairs (a based variable passed by reference included): the address that is passed by reference is followed by113 T 2(take(n),take(bx)), the pointer value oftake(%addr(n))andtake(q)has none. The emitter writes the by-reference call (TAKE(A_00254)) for both, so the caller of a by-value source recompiles with the extra operation: that is one byte-level difference, and it is not used, because the condition "an address argument without113" is not general: written as a failure line of the call (also with calls to imported procedures left out) it made 39 committed twins worse in the emit gate, among them d7-params, where the structureris passed with a bare33 Rand no113: the tag is on the scalar arguments of the battery, not on every by-reference argument. A rule needs the exact condition of the tag (the argument kinds that carry it) first; that is the open question for the next lane, with this battery as its evidence.Tests:
rpg_param_shape_test.zig(six). Counter (parm-count.sh, 54 public captures: 24 lparm, 24 lsel, six Async; 535 parameter declarations): see the ship report; the array rule no longer changes any count.Release gate (coordinator, build of
c5a18c35against v0.1.501)c5a18c35(the head adds only the corrected heading of this fragment): all gates passed (census 645/0, twins regressions none, emit worse none).emit-bytes-diff.sh): onlylsel-for-arr-if-ifchanges.capture-emit-diff.sh): 13 change.lpar-lk-set-bothgoes from 8 to 6 emitted statements: the two lines it loses were a store to the whole parameter where the source stores to a subfield, now failure lines. The six public Async captures change only in template names (the same name was written for five layouts).lpar-lk-set-static,lpar-lk-set-local,lpar-lk-set-exprfailed (compile), now different;lpar-ar-plain,lpar-ar-const-varsizedifferent in both.T dim(N). The host refused it (RNF7535: the caller's argument field kept its old declaration), so that rule is not in this change; both sides of the call have to change together.c5a18c357a01f0fd77fcA by-reference parameter that a store or an index proves a structure or an array is written as one (touches rpg_source.zig)to A by-reference parameter that a subfield store proves a structure is written as one; one template name per layout (touches rpg_source.zig)