compiler: refactor starting new goroutines

This commit is contained in:
Ayke van Laethem
2019-12-09 17:50:58 +01:00
committed by Ron Evans
parent 405ec2a563
commit c1521fe12e
2 changed files with 25 additions and 28 deletions
+2 -2
View File
@@ -1071,7 +1071,7 @@ func (c *Compiler) parseInstr(frame *Frame, instr ssa.Instruction) {
panic("StaticCallee returned an unexpected value")
}
params = append(params, context) // context parameter
c.emitStartGoroutine(calleeFn.LLVMFn, params)
frame.createGoInstruction(calleeFn.LLVMFn, params)
} else if !instr.Call.IsInvoke() {
// This is a function pointer.
// At the moment, two extra params are passed to the newly started
@@ -1089,7 +1089,7 @@ func (c *Compiler) parseInstr(frame *Frame, instr ssa.Instruction) {
default:
panic("unknown scheduler type")
}
c.emitStartGoroutine(funcPtr, params)
frame.createGoInstruction(funcPtr, params)
} else {
c.addError(instr.Pos(), "todo: go on interface call")
}