Proto/Michelson: reduce elaborator garbage

Merged Mehdi Bouaziz requested to merge mehdi@reduce_elaborator_garbage into master


Reuse stack whenever possible.

Thanks to the removal of annotations in types and the injectivity of types, we now have a = b => a ty = b ty, which allows this change with no risks.

I looked at all places where Item_t was used in a construction place (not a pattern) and checked whether part or all of it was already present in the preceeding pattern.

Why? Less pressure on the GC, less code to maintain.

Very unlikely that we'll see any difference in gas benchmarks.

MR based on !4506 (merged)

Manually testing the MR



  • [ ] Document the interface of any function added or modified (see the coding guidelines)
  • [ ] Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • [ ] For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Mehdi Bouaziz