A procedure keeps its constant-area binding through reloads and exit paths #660
Loading…
Reference in a new issue
No description provided.
Delete branch "rpg-9-ay-binding-reload-20261029"
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?
A procedure keeps its constant-area binding through reloads and exit paths
constant_references.bindingLoadproves that r28 holds the constant area ina procedure: loaded from the activation's slot in the prologue, and written
again only by the final stack restore near the end. A procedure that writes r28
anywhere else proved no pointer at all, and the constant area of its twin
differed in every relocated code pointer.
Three writes now keep the binding:
ld r28, slot(r2));blrorblrl, with the fixed LIC calls of an epilogue allowed(multi-exit-full: a
returnin the middle of a procedure has an epilogue ofits own that restores r28; the register may also be reused after its last
use on the way out);
that decode as any instruction (the end of a procedure).
The pointer matchers skip an exit path up to the next instruction that a
branch or a constant-area pointer enters. A unit test of
bindingLoadpins thefour shapes (an exit-path reuse, a write followed by a branch back into the
body, refused, an epilogue in the middle, dead words after a branch);
multi-exit-full shows the middle epilogue, but its linear main is outside the
comparison (creation-data procedures differ from the procedure table).
Diagnostics in
sourcerer --json comparecounts, per side:constant_area_unbound_procedures(procedures that load the constant area butwhose binding is refused),
constant_area_unbound_reason(the refusal of thefirst: 1 entry, 2 late, 3 prologue_flow, 4 early_write, 5 overwritten,
6 tail_branch, 7 entered, 8 no_load) and
constant_area_unbound_detail(itsinstruction's primary and extended opcode and distance from the procedure end).
The held-out exam had two refused procedures (5, an
lwa r2828 bytes beforethe end); with this change its constant area is equal and the verdict is
match_except_file_identity(local build).Gates