ByteCode Specification


After studying the GNU bytecode specs, we realized that we would much rather write our specs for simplicity, understandability, and ease of maintenance than for speed. This has been a concern for us from the start of the project, so it made sense to apply it here. Below is a "kinder, gentler" specification.

Satori Bytecode Specification
OpCode What # Size of args Notes
push Reciever 1 1 byte:index
Temporary 2 1 byte:index
Literal 3 1 byte:index
Association 4 1 byte:index Pushes value onto stack
Special 5 1 byte:index Restricted to # of global objects
StackTop 6 No Args Duplicates stack top & pushes
ActiveContext 7 No Args Pushes currect context onto stack
Self 8 No Args Pushes self onto stack
pop Reciever 9 1 byte:index
Temporary 10 1 byte:index
Literal 11 1 byte:index
Association 12 1 byte:index pops value and stores in association
Special 13 1 byte:index Restricted to # of global objects
StackTop 14 No Args Duplicates stack top & pushes
store Reciever 15 1 byte:index fetches (w/o pop) off stack and stores at index
Temporary 16 1 byte:index ditto
Literal 17 1 byte:index same here
Association 18 1 byte:index uh huh
jump plain 19 2 bytes:(signed short)
ifTrue 20 2 bytes:(signed short)
ifFalse 21 2 bytes:(signed short)
send plain 22 1 byte:arity
1 byte:frame index
toSuper 23 1 byte:arity
1 byte:frame index
return index 24 1 byte:special index
from message 25 No Args
from block 26 No Args