dplassgit / d2lang

D2 is a strongly-typed, statically-typed, (mostly) inferred-type compiled language.
MIT License
6 stars 0 forks source link

Allow for temps that are read more than once before being "deallocated". #248

Closed dplassgit closed 9 months ago

dplassgit commented 10 months ago

Thoughts:

  1. temps can be converted to long-lived temps
  2. long-lived temps aren't deallocated in resolver.deallocate
  3. A new opcode that deallocates a long-lived temp when the IL code generator knows it's done

OR

  1. By default NO temps are deallocated automatically
  2. A new opcode that deallocates a temp
  3. IL code generator inserts deallocate ops when temps are known to be no longer used (this seems more difficult)