mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 04:23:41 +00:00
compiler,runtime: implement stack-based scheduler
This scheduler is intended to live along the (stackless) coroutine based scheduler which is needed for WebAssembly and unsupported platforms. The stack based scheduler is somewhat simpler in implementation as it does not require full program transform passes and supports things like function pointers and interface methods out of the box with no changes. Code size is reduced in most cases, even in the case where no scheduler scheduler is used at all. I'm not exactly sure why but these changes likely allowed some further optimizations somewhere. Even RAM is slightly reduced, perhaps some global was elminated in the process as well.
This commit is contained in:
committed by
Ron Evans
parent
61f711ef26
commit
542135c357
@@ -79,11 +79,6 @@ func memequal(x, y unsafe.Pointer, n uintptr) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
//go:linkname sleep time.Sleep
|
||||
func sleep(d int64) {
|
||||
sleepTicks(timeUnit(d / tickMicros))
|
||||
}
|
||||
|
||||
func nanotime() int64 {
|
||||
return int64(ticks()) * tickMicros
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user