pub fn writeOpcode(writer: *Writer, comptime opcode: u8) !void writer: *Writeropcode: u8776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814 pub fn writeOpcode(writer: *Writer, comptime opcode: u8) !void {
if (options.call_frame_context and !comptime isOpcodeValidInCFA(opcode)) return error.InvalidCFAOpcode;
switch (opcode) {
OP.dup,
OP.drop,
OP.over,
OP.swap,
OP.rot,
OP.deref,
OP.xderef,
OP.push_object_address,
OP.form_tls_address,
OP.call_frame_cfa,
OP.abs,
OP.@"and",
OP.div,
OP.minus,
OP.mod,
OP.mul,
OP.neg,
OP.not,
OP.@"or",
OP.plus,
OP.shl,
OP.shr,
OP.shra,
OP.xor,
OP.le,
OP.ge,
OP.eq,
OP.lt,
OP.gt,
OP.ne,
OP.nop,
OP.stack_value,
=> try writer.writeByte(opcode),
else => @compileError("This opcode requires operands, use `write<Opcode>()` instead"),
}
}
Zero-operand instructions