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
+4 -4
View File
@@ -31,16 +31,16 @@ const schedulerDebug = false
// must not be used directly, it is meant to be used as an opaque *i8 in LLVM.
type coroutine uint8
//go:linkname resume llvm.coro.resume
//go:export llvm.coro.resume
func (t *coroutine) resume()
//go:linkname destroy llvm.coro.destroy
//go:export llvm.coro.destroy
func (t *coroutine) destroy()
//go:linkname done llvm.coro.done
//go:export llvm.coro.done
func (t *coroutine) done() bool
//go:linkname _promise llvm.coro.promise
//go:export llvm.coro.promise
func (t *coroutine) _promise(alignment int32, from bool) unsafe.Pointer
// Get the promise belonging to a task.