ELENA-LANG / elena-lang

ELENA is a general-purpose language with late binding. It is multi-paradigm, combining features of functional and object-oriented programming. Rich set of tools are provided to deal with message dispatching : multi-methods, message qualifying, generic message handlers, run-time interfaces
https://elena-lang.github.io/
MIT License
227 stars 23 forks source link

optimization : arithmetic operations #586

Open arakov opened 1 year ago

arakov commented 1 year ago

Optimize the following bytecode snip:

       set dp   :-8
       store sp :0
       set dp   :-4
       store sp :1
       copy dp  :-16, :4
       xmov sp  :0, :1            
       iadd dp  :-16, :4
       set dp   :-16
       load     
       save dp  :-12

rearrange the operation, to get rid of xmov sp:0, :1