/** * The forty-one instructions of `compiled-program.md` section 4, and the two * facts an emitter has to get right about each one. * * The operand count is here so that a mistyped instruction is caught where it * is built rather than by an engine's verifier three systems away. The depth * change is here because section 3.5 check 5 requires the stack depth to be * computable by walking the list, to agree at every join and to be zero at * `HALT`; a compiler that cannot compute it cannot know it emitted a program * any engine will load, and this is the table that makes it computable. * * `ARRAY`, `CALL_LIB` and `CALL_FN` have a depth that depends on an operand, so * their entries carry the rule rather than a number. */ export declare const OPCODES: readonly ["CONST", "DUP", "POP", "LOAD", "STORE", "CELL_INIT", "LOADC", "STOREC", "SLOAD", "SSTORE", "HIST", "HISTP", "ADD", "SUB", "MUL", "DIV", "MOD", "NEG", "LT", "LE", "GT", "GE", "EQ", "NE", "NOT", "AND", "OR", "AND_SHORT", "OR_SHORT", "JUMP", "JUMP_FALSE", "TICK", "FOR_INIT", "FOR_NEXT", "ARRAY", "ELEM", "CALL_LIB", "CALL_FN", "RET", "EMIT", "HALT"]; export type Opcode = (typeof OPCODES)[number]; export declare function operandCount(opcode: Opcode): number; /** * The stack depth change of one instruction. * * `argcOf` answers for a `CALL_FN`, because its count lives in the call site * table rather than in the instruction, and the walker is the only caller that * has that table in hand. */ export declare function depthChange(opcode: Opcode, operands: readonly number[], argcOf: (site: number) => number): number; export declare function targetPositions(opcode: Opcode): readonly number[]; export declare function isOpcode(name: string): name is Opcode; //# sourceMappingURL=opcodes.d.ts.map