This is posted as an issue because it needs further thinking.
If we have a function like:
fun add(a: int, b: int): int {
return a + b;
}
The compiler will output the following instructions:
istore 0
istore 4
iload 4
iload 0
iadd
iret
ret
More efficient way would be:
Should such edge cases be addressed? For some operators (-, /) this optimization would just work when the arguments have the correct order (for others we need swapping)
This is posted as an issue because it needs further thinking.
If we have a function like:
The compiler will output the following instructions:
More efficient way would be:
Should such edge cases be addressed? For some operators (-, /) this optimization would just work when the arguments have the correct order (for others we need swapping)