bloqade.lanes.bytecode.decode.BytecodeDecoder
← Module overview
class
method
source
classBytecodeDecoder¶source
bloqade.lanes.bytecode.decode.BytecodeDecoder
Turn a bytecode Program into a stack_move ir.Method.
class BytecodeDecoder(frame: StackMachineFrame = StackMachineFrame())Maintains a virtual stack of SSA values during decoding: each bytecode push emits a stack_move statement whose result is pushed onto the virtual stack, and each pop consumes the top SSA reference. Stack ops (Pop/Dup/Swap) emit corresponding stack_move statements (linear-IR style — see the design doc).
All stack and IR manipulation is delegated to self.frame; the
handlers below are thin translators from bytecode opcodes to
stack_move statements.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
frame | StackMachineFrame | StackMachineFrame() |
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
frame | StackMachineFrame | field(default_factory=StackMachineFrame) |
methoddecode¶source
bloqade.lanes.bytecode.decode.BytecodeDecoder.decode
def decode(program: 'Program', kernel_name: str = 'main') -> ir.MethodParameters
| Name | Type | Default | Description |
|---|---|---|---|
program | 'Program' | required | |
kernel_name | str | 'main' |
Returns
ir.Method