uproot_custom.detree.compiler package

Submodules

uproot_custom.detree.compiler.frontend module

uproot_custom.detree.compiler.frontend.compile_reader(reader)[source]

Compile a whole reader tree; return (module bytes, signature).

Parameters:

reader – the root of the detree reader tree.

Returns:

The canonical module bytes and the structural signature they were built from.

uproot_custom.detree.compiler.frontend.describe_reader(reader: Reader, path: str = 'root')[source]

A structural signature: class, constants, buffers and children.

Fields are walked in declaration order, so the signature does not depend on how a constructor happened to assign attributes. A state is described by its declared default – what the module seeds the slot with – so the signature of a reader tree is the same before and after a run, and a reader reused across baskets stays one cache entry.

uproot_custom.detree.compiler.ir_builder module

IR builder used by the reader frontend.

The reader frontend historically emitted the legacy 20-byte instruction stream directly. It now emits detree-vm’s typed IR instead; this builder keeps the small, expression-oriented surface the emitter was written against while all control flow is structured (there are no labels or jumps).

Optimization does not happen here: detree.compile runs the detree-vm optimizer and lowering after the frontend has produced the IR.

class uproot_custom.detree.compiler.ir_builder.IRFunctionBuilder(function: Function, program: Program)[source]

Bases: object

Build one detree-vm IR function with an emitter-friendly API.

assert_str_eq(left, right, message)[source]
block()[source]
buf_append(buf, value)[source]
buf_append_const(buf, value)[source]
buf_append_len(dst, src)[source]
buf_append_offset(buf, value)[source]
buf_last(buf)[source]
buf_len(buf)[source]
call(func, arg=None)[source]
const(value)[source]
const_into(target, value)[source]
cursor(dst=None)[source]
data_size(dst=None)[source]
emit(stmt, **operands)[source]
emit_op(op, rd=0, ra=0, rb=0, imm1=0, imm2=0)[source]

Lower one legacy opcode-shaped operation to an IR statement.

entries(dst=None)[source]
finish()[source]

Kept for the emitter’s explicit finalisation call.

for_range(var, start, stop, step, body)[source]
if_(cond, then_body, else_body=())[source]
init_offset(dst=None)[source]
local(name: str) → Local[source]
mov(target, value)[source]
offset_seek(value)[source]
read_append(buf, typecode)[source]
read_bulk(buf, typecode, count)[source]
read_cstr(dst=None)[source]
read_fields(layout, count)[source]
read_fnb(dst=None)[source]
read_scalar(typecode, dst=None)[source]
read_strided(buf, typecode, count, stride)[source]
read_version(dst=None)[source]
ref_count()[source]
ref_get_class(value)[source]
ref_get_obj(value)[source]
ref_has(value)[source]
ref_set_class(tag, value)[source]
ref_set_obj(tag, value)[source]
reg()[source]

The emitter’s scratch register is just a fresh IR local.

ret(value=None)[source]
set_cursor(value)[source]
skip(nbytes)[source]
skip_cstr()[source]
skip_fnb()[source]
skip_objhdr()[source]
skip_reg(value)[source]
skip_tobject()[source]
skip_version()[source]
state_get(slot)[source]
state_iadd(slot, value)[source]
state_set(slot, value)[source]
str_const(ident)[source]
str_load(slot)[source]
str_store(slot, value)[source]
temp() → Local[source]
throw(message)[source]
while_(cond, body)[source]

Module contents