-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
Introducing an OP_BRANCHUNLESS <offset> instruction (inspired by Ruby).
Pseudo bytecode:
<condition> <= evaled condition is on stack
OP_BRANCHUNLESS 2 <= jump +2 bytes unless stack_pop
<2 bytes of body>
<end if>
To keep things simple at first, we could compile only the if/unless without any else branches.
This would be the first jump type instruction. if is the simplest one, so it's a good starting point. After this, porting for, case, and, or to instructions will be possible.
However, I think this is where the const_ptr pointer breaks. Any instruction using the const_ptr inside a loop/jump will cause it to be out of sync w/ ip. This should be fixed first.
Metadata
Metadata
Assignees
Labels
No labels