ir
v1.15.5
github.com/bytedance/sonic/internal/encoder/ir
Documentation
pkg.go.dev ↗Constants
OpSize
const OpSize = unsafe.Sizeof(NewInsOp(0))
Variables
OpNames
var OpNames = [256]string{
OP_null: "null",
OP_empty_arr: "empty_arr",
OP_empty_obj: "empty_obj",
OP_bool: "bool",
OP_i8: "i8",
OP_i16: "i16",
OP_i32: "i32",
OP_i64: "i64",
OP_u8: "u8",
OP_u16: "u16",
OP_u32: "u32",
OP_u64: "u64",
OP_f32: "f32",
OP_f64: "f64",
OP_str: "str",
OP_bin: "bin",
OP_quote: "quote",
OP_number: "number",
OP_eface: "eface",
OP_iface: "iface",
OP_byte: "byte",
OP_text: "text",
OP_deref: "deref",
OP_index: "index",
OP_load: "load",
OP_save: "save",
OP_drop: "drop",
OP_drop_2: "drop_2",
OP_recurse: "recurse",
OP_is_nil: "is_nil",
OP_is_nil_p1: "is_nil_p1",
OP_is_zero_1: "is_zero_1",
OP_is_zero_2: "is_zero_2",
OP_is_zero_4: "is_zero_4",
OP_is_zero_8: "is_zero_8",
OP_is_zero_map: "is_zero_map",
OP_goto: "goto",
OP_map_iter: "map_iter",
OP_map_stop: "map_stop",
OP_map_check_key: "map_check_key",
OP_map_write_key: "map_write_key",
OP_map_value_next: "map_value_next",
OP_slice_len: "slice_len",
OP_slice_next: "slice_next",
OP_marshal: "marshal",
OP_marshal_p: "marshal_p",
OP_marshal_text: "marshal_text",
OP_marshal_text_p: "marshal_text_p",
OP_cond_set: "cond_set",
OP_cond_testc: "cond_testc",
OP_unsupported: "unsupported type",
}
Types
Instr
type Instr struct {
// contains filtered or unexported fields
}
NewInsField
func NewInsField(op Op, fv *resolver.FieldMeta) Instr
NewInsOp
func NewInsOp(op Op) Instr
NewInsVi
func NewInsVi(op Op, vi int) Instr
NewInsVp
func NewInsVp(op Op, vt reflect.Type, pv bool) Instr
NewInsVs
func NewInsVs(op Op, vs string) Instr
NewInsVt
func NewInsVt(op Op, vt reflect.Type) Instr
NewInsVtab
func NewInsVtab(op Op, vt reflect.Type, itab *rt.GoItab) Instr
Instr.Byte
func (self Instr) Byte() byte
Instr.Disassemble
func (self Instr) Disassemble() string
Instr.GoType
func (self Instr) GoType() *rt.GoType
Instr.I64
func (self Instr) I64() int64
Instr.Op
func (self Instr) Op() Op
Instr.VField
func (self Instr) VField() *resolver.FieldMeta
Instr.Vf
func (self Instr) Vf() uint8
Instr.Vi
func (self Instr) Vi() int
Instr.Vk
func (self Instr) Vk() reflect.Kind
Instr.Vlen
func (self Instr) Vlen() int
Instr.Vp
func (self Instr) Vp() (vt reflect.Type, pv bool)
Instr.Vp2
func (self Instr) Vp2() (vt *rt.GoType, pv bool)
Instr.Vr
func (self Instr) Vr() *rt.GoType
Instr.Vs
func (self Instr) Vs() (v string)
Instr.Vt
func (self Instr) Vt() reflect.Type
Instr.Vtab
func (self Instr) Vtab() (vt *rt.GoType, itab *rt.GoItab)
Op
type Op uint8
OP_null (52 declarations)
const ( OP_null Op = iota + 1 OP_empty_arr OP_empty_obj OP_bool OP_i8 OP_i16 OP_i32 OP_i64 OP_u8 OP_u16 OP_u32 OP_u64 OP_f32 OP_f64 OP_str OP_bin OP_quote OP_number OP_eface OP_iface OP_byte OP_text OP_deref OP_index OP_load OP_save OP_drop OP_drop_2 OP_recurse OP_is_nil OP_is_nil_p1 OP_is_zero_1 OP_is_zero_2 OP_is_zero_4 OP_is_zero_8 OP_is_zero_map OP_goto OP_map_iter OP_map_stop OP_map_check_key OP_map_write_key OP_map_value_next OP_slice_len OP_slice_next OP_marshal OP_marshal_p OP_marshal_text OP_marshal_text_p OP_cond_set OP_cond_testc OP_unsupported OP_is_zero )
OP_int
func OP_int() Op
OP_is_zero_ints
func OP_is_zero_ints() Op
OP_uint
func OP_uint() Op
OP_uintptr
func OP_uintptr() Op
Op.String
func (self Op) String() string
Program
type Program []Instr
Program.Add
func (self *Program) Add(op Op)
Program.Disassemble
func (self Program) Disassemble() string
Program.Int
func (self *Program) Int(op Op, vi int)
Program.Key
func (self *Program) Key(op Op)
Program.PC
func (self Program) PC() int
Program.Pin
func (self Program) Pin(i int)
Program.Rel
func (self Program) Rel(v []int)
Program.Rtt
func (self *Program) Rtt(op Op, vt reflect.Type)
Program.Str
func (self *Program) Str(op Op, vs string)
Program.Tag
func (self Program) Tag(n int)
Program.VField
func (self *Program) VField(op Op, fv *resolver.FieldMeta)
Program.Vp
func (self *Program) Vp(op Op, vt reflect.Type, pv bool)
Program.Vtab
func (self *Program) Vtab(op Op, vt reflect.Type, itab *rt.GoItab)