mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-12 15:03:41 +00:00
compiler: skip context parameter when starting regular goroutine
Do not store the context parameter (which is used for closures and function pointers) in the goroutine start parameter bundle for direct functions that don't need a context parameter. This avoids storing the (undef) context parameter and thus makes the IR to start a new goroutine simpler in most cases. This reduces code size in the channel.go and goroutines.go tests. Surprisingly, all test cases (when compiled with -target=microbit) have a changed binary, I haven't investigated why but I suppose the codegen is slightly different for the runtime.run function (which starts the main goroutine).
This commit is contained in:
committed by
Ron Evans
parent
3edcdb5f0d
commit
c93ddb630b
@@ -23,7 +23,7 @@ import (
|
||||
// Version of the compiler pacakge. Must be incremented each time the compiler
|
||||
// package changes in a way that affects the generated LLVM module.
|
||||
// This version is independent of the TinyGo version number.
|
||||
const Version = 9 // last change: implement reflect.New()
|
||||
const Version = 10 // last change: context parameter in go wrapper
|
||||
|
||||
func init() {
|
||||
llvm.InitializeAllTargets()
|
||||
|
||||
Reference in New Issue
Block a user