Граф коммитов

6 коммитов

Автор SHA1 Сообщение Дата
Ayke van Laethem
cb0a148cd7
compiler: fix map optimization
Not all uses of a map are call instructions. Don't assume they are.
TODO: investigate these uses and see whether they might be eliminated?
2018-10-24 12:37:47 +02:00
Ayke van Laethem
52199f4a14
compiler: eliminate created but never used maps 2018-10-12 17:00:39 +02:00
Ayke van Laethem
25e73a5439
compiler: align and zero-initialize stack allocated values 2018-10-12 16:57:17 +02:00
Ayke van Laethem
ec73bd6a26
compiler: optimize runtime.stringToBytes calls
This optimization makes sure the following pattern doesn't do a heap
allocation (assuming Write doesn't modify the slice):

    var w *machine.UART = ...
    w.Write([]byte("foo"))

As long as Write doesn't modify the slice and LLVM can detect this, a
call to runtime.stringToBytes with the necessary allocation + copy is
avoided.
2018-10-09 14:18:12 +02:00
Ayke van Laethem
4219652535
compiler: add basic heap-to-stack optimization 2018-10-09 14:14:52 +02:00
Ayke van Laethem
5db43e8d04
compiler: move Optimize() function to a separate file
In the future, there will be more optimizations. Let's keep them in a
separate file for separation of concerns.
2018-10-06 19:57:41 +02:00