compiler: always use fat function pointers with context

This reduces complexity in the compiler without affecting binary sizes
too much.

Cortex-M0:   no changes
Linux x64:   no changes
WebAssembly: some testcases (calls, coroutines, map) are slightly bigger
This commit is contained in:
Ayke van Laethem
2018-12-09 18:10:04 +01:00
parent 3fec22e819
commit 564b1b3312
12 changed files with 125 additions and 246 deletions
+6 -6
View File
@@ -8,16 +8,16 @@ const tickMicros = 1
var timestamp timeUnit
// CommonWA: io_get_stdout
func _Cfunc_io_get_stdout() int32
//go:export io_get_stdout
func io_get_stdout() int32
// CommonWA: resource_write
func _Cfunc_resource_write(id int32, ptr *uint8, len int32) int32
//go:export resource_write
func resource_write(id int32, ptr *uint8, len int32) int32
var stdout int32
func init() {
stdout = _Cfunc_io_get_stdout()
stdout = io_get_stdout()
}
//go:export _start
@@ -32,7 +32,7 @@ func cwa_main() {
}
func putchar(c byte) {
_Cfunc_resource_write(stdout, &c, 1)
resource_write(stdout, &c, 1)
}
func sleepTicks(d timeUnit) {