bloqade.lanes.bytecode.encode.BytecodeEncoder
← Module overview
class
method
sourcemethod
sourcemethod
source
classBytecodeEncoder¶source
bloqade.lanes.bytecode.encode.BytecodeEncoder
Bases: EmitABC[EmitFrame, Program]
Turn a stack_move ir.Method into a bytecode Program.
class BytecodeEncoder(instructions: list[Instruction] = list())Constructed with the method’s dialect group
(BytecodeEncoder(dialects=method.dialects)). Call run(method)
to populate self.instructions, then build the Program from them.
Prefer dump_program for the one-shot public API.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
instructions | list[Instruction] | list() |
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
keys | — | ('emit.bytecode',) | |
void | — | Program(version=(1, 0), instructions=[]) | |
instructions | list[Instruction] | field(default_factory=list) |
methodinitialize_frame¶source
bloqade.lanes.bytecode.encode.BytecodeEncoder.initialize_frame
Signature
def initialize_frame(node: ir.Statement, *, has_parent_access: bool = False) -> EmitFrameParameters
| Name | Type | Default | Description |
|---|---|---|---|
node | ir.Statement | required | |
has_parent_access | bool | False |
Returns
EmitFrame
methodreset¶source
bloqade.lanes.bytecode.encode.BytecodeEncoder.reset
def reset() -> Nonemethodeval_fallback¶source
bloqade.lanes.bytecode.encode.BytecodeEncoder.eval_fallback
def eval_fallback(frame: EmitFrame, node: ir.Statement) -> tupleParameters
| Name | Type | Description |
|---|---|---|
frame | EmitFrame | |
node | ir.Statement |
Returns
tuple