stevehalliwell / ulox

A bytecode interpreted scripting language for games in Unity.
MIT License
23 stars 0 forks source link

Multivar optimise #239

Closed stevehalliwell closed 6 months ago

stevehalliwell commented 6 months ago

functions know their return arity, multivar knows how many things it is assigning, we shouldn't need to do as much marking and validating as we are right now.

The outlier is assigning to a grouping.

var (a,b,c) = (1,2,3);

the grouping doesn't have return arity, so stack marking is what allows this to function. We should be able to desugar to 3 assigns in a row though.