aboutsummaryrefslogtreecommitdiffhomepage
path: root/compileopts/target.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2020-09-25 15:31:50 +0200
committerRon Evans <[email protected]>2021-05-09 17:40:13 +0200
commit9f5066aa6f1d67f161bc0d7520dc2f1bfa1f2b0d (patch)
tree69510a8f373164fdbe92c330f9e11a674447e15f /compileopts/target.go
parent3b24fedf922549297ae42c2da7e9292741334d76 (diff)
downloadtinygo-9f5066aa6f1d67f161bc0d7520dc2f1bfa1f2b0d.tar.gz
tinygo-9f5066aa6f1d67f161bc0d7520dc2f1bfa1f2b0d.zip
runtime: use the tasks scheduler instead of coroutines
This results in smaller and likely more efficient code. It does require some architecture specific code for each architecture, but I've kept the amount of code as small as possible.
Diffstat (limited to 'compileopts/target.go')
-rw-r--r--compileopts/target.go19
1 files changed, 11 insertions, 8 deletions
diff --git a/compileopts/target.go b/compileopts/target.go
index ad72252c3..81de4ed07 100644
--- a/compileopts/target.go
+++ b/compileopts/target.go
@@ -239,14 +239,16 @@ func defaultTarget(goos, goarch, triple string) (*TargetSpec, error) {
// No target spec available. Use the default one, useful on most systems
// with a regular OS.
spec := TargetSpec{
- Triple: triple,
- GOOS: goos,
- GOARCH: goarch,
- BuildTags: []string{goos, goarch},
- Linker: "cc",
- CFlags: []string{"--target=" + triple},
- GDB: []string{"gdb"},
- PortReset: "false",
+ Triple: triple,
+ GOOS: goos,
+ GOARCH: goarch,
+ BuildTags: []string{goos, goarch},
+ Scheduler: "tasks",
+ Linker: "cc",
+ DefaultStackSize: 1024 * 64, // 64kB
+ CFlags: []string{"--target=" + triple},
+ GDB: []string{"gdb"},
+ PortReset: "false",
}
if goos == "darwin" {
spec.CFlags = append(spec.CFlags, "-isysroot", "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk")
@@ -256,6 +258,7 @@ func defaultTarget(goos, goarch, triple string) (*TargetSpec, error) {
}
if goarch != "wasm" {
spec.ExtraFiles = append(spec.ExtraFiles, "src/runtime/gc_"+goarch+".S")
+ spec.ExtraFiles = append(spec.ExtraFiles, "src/internal/task/task_stack_"+goarch+".S")
}
if goarch != runtime.GOARCH {
// Some educated guesses as to how to invoke helper programs.