Leonardo2718 / lua-vermelha

A Lua implementation with an Eclipse OMR based JIT compiler
89 stars 8 forks source link

Create a common do_math helper #10

Closed charliegracie closed 7 years ago

charliegracie commented 7 years ago

Almost 100% of the code for OP_ADD, OP_SUB and OP_MUL is identical. This means that there are 3 functions with exactly the same code except for the actual math operation.

This change creates a do_math helper which handles all 3 of the opcodes above.

Signed-off-by: Charlie Gracie charlie.gracie@gmail.com