github.com/goccy/go-jit@v0.0.0-20200514131505-ff78d45cf6af/insn.go (about) 1 package jit 2 3 import ( 4 "unsafe" 5 6 "github.com/goccy/go-jit/internal/ccall" 7 ) 8 9 type Instruction struct { 10 *ccall.Instruction 11 } 12 13 func toInstruction(c *ccall.Instruction) *Instruction { 14 return &Instruction{c} 15 } 16 17 func (i *Instruction) Code() int { 18 return i.Instruction.Code() 19 } 20 21 func (i *Instruction) Dest() *Value { 22 return toValue(i.Instruction.Dest()) 23 } 24 25 func (i *Instruction) Value1() *Value { 26 return toValue(i.Instruction.Value1()) 27 } 28 29 func (i *Instruction) Value2() *Value { 30 return toValue(i.Instruction.Value2()) 31 } 32 33 func (i *Instruction) Label() *Label { 34 return toLabel(i.Instruction.Label()) 35 } 36 37 func (i *Instruction) Function() *Function { 38 return toFunction(i.Instruction.Function()) 39 } 40 41 func (i *Instruction) Native() unsafe.Pointer { 42 return i.Instruction.Native() 43 } 44 45 func (i *Instruction) Name() string { 46 return i.Instruction.Name() 47 } 48 49 func (i *Instruction) Signature() *Type { 50 return toType(i.Instruction.Signature()) 51 } 52 53 func (i *Instruction) DestIsValue() bool { 54 return i.Instruction.DestIsValue() 55 }