pr7.3
This commit is contained in:
@@ -1,43 +1,3 @@
|
||||
# PR-7.3 — SPAWN Instruction
|
||||
|
||||
## Briefing
|
||||
|
||||
SPAWN creates a new coroutine and schedules it.
|
||||
|
||||
## Target
|
||||
|
||||
Introduce opcode:
|
||||
|
||||
`SPAWN fn_id, arg_count`
|
||||
|
||||
Semantics:
|
||||
|
||||
* Pop `arg_count` args.
|
||||
* Create new coroutine object.
|
||||
* Initialize its stack/frame with entry fn.
|
||||
* Push coroutine handle onto ready queue.
|
||||
|
||||
Current coroutine continues execution.
|
||||
|
||||
## Checklist
|
||||
|
||||
* [ ] SPAWN opcode exists.
|
||||
* [ ] Coroutine created.
|
||||
* [ ] Scheduled in ready queue.
|
||||
* [ ] No immediate context switch.
|
||||
|
||||
## Tests
|
||||
|
||||
* Spawn coroutine and verify it appears in ready queue.
|
||||
|
||||
## Junie Rules
|
||||
|
||||
You MAY modify interpreter dispatch.
|
||||
You MUST NOT switch execution immediately.
|
||||
If entry frame layout unclear, STOP and ask.
|
||||
|
||||
---
|
||||
|
||||
# PR-7.4 — YIELD Instruction
|
||||
|
||||
## Briefing
|
||||
|
||||
Reference in New Issue
Block a user