Skip to content

Commit 0d0f3fa

Browse files
committed
fix typoes in asyncify stubs
1 parent 6121f72 commit 0d0f3fa

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

builder/build.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ func Build(pkgName, outpath string, config *compileopts.Config, action func(Buil
626626
// Run wasm-opt if necessary.
627627
if config.Scheduler() == "asyncify" {
628628
var optLevel, shrinkLevel int
629-
/*switch config.Options.Opt {
629+
switch config.Options.Opt {
630630
case "none", "0":
631631
case "1":
632632
optLevel = 1
@@ -640,7 +640,7 @@ func Build(pkgName, outpath string, config *compileopts.Config, action func(Buil
640640
shrinkLevel = 2
641641
default:
642642
return fmt.Errorf("unknown opt level: %q", config.Options.Opt)
643-
}*/
643+
}
644644
cmd := exec.Command("wasm-opt", "--asyncify",
645645
"--optimize-level", strconv.Itoa(optLevel),
646646
"--shrink-level", strconv.Itoa(shrinkLevel),

src/internal/task/task_asyncify.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ func Current() *Task {
7777
// Pause suspends the current task and returns to the scheduler.
7878
// This function may only be called when running on a goroutine stack, not when running on the system stack.
7979
func Pause() {
80-
println("pausing", currentTask)
8180
currentTask.state.unwind()
82-
println("unpaused", currentTask)
8381
}
8482

8583
//export tinygo_unwind
@@ -91,7 +89,6 @@ func (t *Task) Resume() {
9189
if currentTask != nil {
9290
runtimePanic("resume inside goroutine")
9391
}
94-
println("resume", t)
9592
currentTask = t
9693
if !t.state.launched {
9794
t.state.launch()
@@ -100,7 +97,6 @@ func (t *Task) Resume() {
10097
t.state.rewind()
10198
}
10299
currentTask = nil
103-
println("rewound", t, t.state.asyncifysp, t.state.csp)
104100
if t.state.asyncifysp > t.state.csp {
105101
runtimePanic("stack overflow")
106102
}

src/internal/task/task_asyncify_wasm.S

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
.type tinygo_unwind,@function
55
tinygo_unwind: // func (state *stackState) unwind()
66
.functype tinygo_unwind (i32) -> ()
7-
.local i32
87
// Check if we are rewinding.
98
i32.const 0
109
i32.load8_u tinygo_rewinding
@@ -13,7 +12,7 @@ tinygo_unwind: // func (state *stackState) unwind()
1312
call stop_rewind
1413
i32.const 0
1514
i32.const 0
16-
i32.store8 rewinding // tinygo_rewinding = false;
15+
i32.store8 tinygo_rewinding // tinygo_rewinding = false;
1716
else
1817
// Save the C stack pointer (destination structure pointer is in local 0).
1918
local.get 0
@@ -31,7 +30,6 @@ tinygo_unwind: // func (state *stackState) unwind()
3130
.type tinygo_launch,@function
3231
tinygo_launch: // func (state *state) launch()
3332
.functype tinygo_launch (i32) -> ()
34-
.local i32
3533
// Switch to the goroutine's C stack.
3634
global.get __stack_pointer // prev := getCurrentStackPointer()
3735
local.get 0
@@ -55,7 +53,6 @@ tinygo_launch: // func (state *state) launch()
5553
.type tinygo_rewind,@function
5654
tinygo_rewind: // func (state *state) rewind()
5755
.functype tinygo_rewind (i32) -> ()
58-
.local i32
5956
// Switch to the goroutine's C stack.
6057
global.get __stack_pointer // prev := getCurrentStackPointer()
6158
local.get 0

0 commit comments

Comments
 (0)