Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeObject(buf []byte, val interface{}) (ret int, err error)
- func Pretouch(vt *rt.GoType, opts opts.Options) (map[reflect.Type]struct{}, error)
- func SetLinker(v Linker)
- func Translate(s Program) hir.Program
- type BasicBlock
- type Compiler
- type DecodeError
- type Decoder
- type FieldBitmap
- type GraphBuilder
- type Instr
- type Linker
- type LinkerAMD64
- type OpCode
- type Program
- type RuntimeState
- type SkipItem
- type StateItem
Constants ¶
View Source
const ( MaxField = 65536 MaxBitmap = MaxField / 64 )
View Source
const ( ETAG = -1 EEOF = -2 ESTACK = -3 )
View Source
const ( NbOffset = int64(unsafe.Offsetof(StateItem{}.Nb)) MpOffset = int64(unsafe.Offsetof(StateItem{}.Mp)) WpOffset = int64(unsafe.Offsetof(StateItem{}.Wp)) FmOffset = int64(unsafe.Offsetof(StateItem{}.Fm)) )
View Source
const ( SkOffset = int64(unsafe.Offsetof(RuntimeState{}.Sk)) PrOffset = int64(unsafe.Offsetof(RuntimeState{}.Pr)) IvOffset = int64(unsafe.Offsetof(RuntimeState{}.Iv)) )
View Source
const ( StateMax = (defs.StackSize - 1) * StateSize StateSize = int64(unsafe.Sizeof(StateItem{})) )
View Source
const ( ARG_buf = 0 ARG_nb = 1 ARG_i = 2 ARG_p = 3 ARG_rs = 4 ARG_st = 5 )
View Source
const ( WP = hir.P1 IP = hir.P2 RS = hir.P3 ET = hir.P4 // may also be used as a temporary pointer register EP = hir.P5 // may also be used as a temporary pointer register )
View Source
const ( LB_eof = "_eof" LB_halt = "_halt" LB_type = "_type" LB_skip = "_skip" LB_error = "_error" LB_missing = "_missing" LB_overflow = "_overflow" )
Variables ¶
View Source
var ( F_makemap = hir.RegisterGCall(makemap, emu_gcall_makemap) F_mallocgc = hir.RegisterGCall(mallocgc, emu_gcall_mallocgc) )
View Source
var ( F_newFieldBitmap = hir.RegisterGCall(newFieldBitmap, emu_gcall_newFieldBitmap) F_FieldBitmap_Free = hir.RegisterGCall((*FieldBitmap).Free, emu_gcall_FieldBitmap_Free) )
View Source
var ( MissCount uint64 = 0 TypeCount uint64 = 0 )
View Source
var ( F_error_eof = hir.RegisterGCall(error_eof, emu_gcall_error_eof) F_error_skip = hir.RegisterGCall(error_skip, emu_gcall_error_skip) F_error_type = hir.RegisterGCall(error_type, emu_gcall_error_type) F_error_missing = hir.RegisterGCall(error_missing, emu_gcall_error_missing) )
View Source
var ( F_mapassign = hir.RegisterGCall(mapassign, emu_gcall_mapassign) F_mapassign_fast32 = hir.RegisterGCall(mapassign_fast32, emu_gcall_mapassign_fast32) F_mapassign_fast64 = hir.RegisterGCall(mapassign_fast64, emu_gcall_mapassign_fast64) F_mapassign_faststr = hir.RegisterGCall(mapassign_faststr, emu_gcall_mapassign_faststr) F_mapassign_fast64ptr = hir.RegisterGCall(mapassign_fast64ptr, emu_gcall_mapassign_fast64ptr) )
View Source
var (
C_skip = hir.RegisterCCall(archSkippingFn(), emu_ccall_skip)
)
View Source
var (
F_decode *hir.CallHandle
)
View Source
var (
F_slicebytetostring = hir.RegisterGCall(slicebytetostring, emu_gcall_slicebytetostring)
)
Functions ¶
func DecodeObject ¶
Types ¶
type BasicBlock ¶
type BasicBlock struct { P Program Src int End int Link []*BasicBlock }
func (*BasicBlock) Free ¶
func (self *BasicBlock) Free()
func (*BasicBlock) Len ¶
func (self *BasicBlock) Len() int
func (*BasicBlock) String ¶
func (self *BasicBlock) String() string
type Compiler ¶
type Compiler struct {
// contains filtered or unexported fields
}
func CreateCompiler ¶
func CreateCompiler() *Compiler
func (*Compiler) CompileAndFree ¶
type DecodeError ¶
type DecodeError struct {
// contains filtered or unexported fields
}
func (DecodeError) Error ¶
func (self DecodeError) Error() string
type Decoder ¶
type FieldBitmap ¶
func (*FieldBitmap) Append ¶
func (self *FieldBitmap) Append(i int)
func (*FieldBitmap) Clear ¶
func (self *FieldBitmap) Clear()
func (*FieldBitmap) Free ¶
func (self *FieldBitmap) Free()
type GraphBuilder ¶
type GraphBuilder struct { Pin map[int]bool Graph map[int]*BasicBlock }
func (*GraphBuilder) Build ¶
func (self *GraphBuilder) Build(p Program) *BasicBlock
func (*GraphBuilder) BuildAndFree ¶
func (self *GraphBuilder) BuildAndFree(p Program) (bb *BasicBlock)
func (*GraphBuilder) Free ¶
func (self *GraphBuilder) Free()
type Instr ¶
type Instr struct { Op OpCode Tx defs.Tag Id uint16 To int Iv int64 Sw *int Vt *rt.GoType Fn unsafe.Pointer }
func (Instr) Disassemble ¶
type LinkerAMD64 ¶
type LinkerAMD64 struct{}
type OpCode ¶
type OpCode uint8
const ( OP_int OpCode = iota OP_str OP_str_nocopy OP_bin OP_bin_nocopy OP_enum OP_size OP_type OP_seek OP_deref OP_ctr_load OP_ctr_decr OP_ctr_is_zero OP_map_alloc OP_map_close OP_map_set_i8 OP_map_set_i16 OP_map_set_i32 OP_map_set_i64 OP_map_set_str OP_map_set_enum OP_map_set_pointer OP_list_alloc OP_struct_skip OP_struct_ignore OP_struct_bitmap OP_struct_switch OP_struct_require OP_struct_is_stop OP_struct_mark_tag OP_struct_read_type OP_struct_check_type OP_make_state OP_drop_state OP_construct OP_initialize OP_defer OP_goto OP_halt )
type RuntimeState ¶
type RuntimeState struct { St [defs.StackSize]StateItem // Must be the first field. Sk [defs.StackSize]SkipItem // Skip buffer, used for non-recursive skipping Pr unsafe.Pointer // Pointer spill space, used for non-fast string or pointer map access. Iv uint64 // Integer spill space, used for non-fast string map access. }
Source Files ¶
- alloc.go
- alloc_emu.go
- bitmap.go
- bitmap_emu.go
- compiler.go
- decoder.go
- errors.go
- errors_emu.go
- initfn.go
- linker.go
- linker_amd64.go
- linker_emu.go
- mapassign.go
- mapassign_emu.go
- native_amd64.go
- native_subr_amd64.go
- opcode.go
- optimizer.go
- pools.go
- skipping.go
- skipping_amd64.go
- skipping_emu.go
- state.go
- strconv.go
- strconv_emu.go
- translator.go
Click to show internal directories.
Click to hide internal directories.