objw

package standard library
go1.19.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2022 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const StackMapDontCare = -1000

StackMapDontCare indicates that the stack map index at a Value doesn't matter.

This is a sentinel value that should never be emitted to the PCDATA stream. We use -1000 because that's obviously never a valid stack index (but -1 is).

Variables

View Source
var LivenessDontCare = LivenessIndex{StackMapDontCare, true}

LivenessDontCare indicates that the liveness information doesn't matter. Currently it is used in deferreturn liveness when we don't actually need it. It should never be emitted to the PCDATA stream.

Functions

func BitVec

func BitVec(s *obj.LSym, off int, bv bitvec.BitVec) int

Bitvec writes the contents of bv into s as sequence of bytes in little-endian order, and returns the next unused offset.

func Global

func Global(s *obj.LSym, width int32, flags int16)

func LosesStmtMark

func LosesStmtMark(as obj.As) bool

LosesStmtMark reports whether a prog with op as loses its statement mark on the way to DWARF. The attributes from some opcodes are lost in translation. TODO: this is an artifact of how funcpctab combines information for instructions at a single PC. Should try to fix it there.

func SymPtr

func SymPtr(s *obj.LSym, off int, x *obj.LSym, xoff int) int

func SymPtrOff

func SymPtrOff(s *obj.LSym, off int, x *obj.LSym) int

func SymPtrWeak

func SymPtrWeak(s *obj.LSym, off int, x *obj.LSym, xoff int) int

func SymPtrWeakOff

func SymPtrWeakOff(s *obj.LSym, off int, x *obj.LSym) int

func Uint16

func Uint16(s *obj.LSym, off int, v uint16) int

func Uint32

func Uint32(s *obj.LSym, off int, v uint32) int

func Uint8

func Uint8(s *obj.LSym, off int, v uint8) int

Uint8 writes an unsigned byte v into s at offset off, and returns the next unused offset (i.e., off+1).

func UintN

func UintN(s *obj.LSym, off int, v uint64, wid int) int

UintN writes an unsigned integer v of size wid bytes into s at offset off, and returns the next unused offset.

func Uintptr

func Uintptr(s *obj.LSym, off int, v uint64) int

Types

type LivenessIndex

type LivenessIndex struct {
	StackMapIndex int

	// IsUnsafePoint indicates that this is an unsafe-point.
	//
	// Note that it's possible for a call Value to have a stack
	// map while also being an unsafe-point. This means it cannot
	// be preempted at this instruction, but that a preemption or
	// stack growth may happen in the called function.
	IsUnsafePoint bool
}

LivenessIndex stores the liveness map information for a Value.

func (LivenessIndex) StackMapValid

func (idx LivenessIndex) StackMapValid() bool

type Progs

type Progs struct {
	Text       *obj.Prog  // ATEXT Prog for this function
	Next       *obj.Prog  // next Prog
	PC         int64      // virtual PC; count of Progs
	Pos        src.XPos   // position to use for new Progs
	CurFunc    *ir.Func   // fn these Progs are for
	Cache      []obj.Prog // local progcache
	CacheIndex int        // first free element of progcache

	NextLive LivenessIndex // liveness index for the next Prog
	PrevLive LivenessIndex // last emitted liveness index
}

Progs accumulates Progs for a function and converts them into machine code.

func NewProgs

func NewProgs(fn *ir.Func, worker int) *Progs

NewProgs returns a new Progs for fn. worker indicates which of the backend workers will use the Progs.

func (*Progs) Append

func (pp *Progs) Append(p *obj.Prog, as obj.As, ftype obj.AddrType, freg int16, foffset int64, ttype obj.AddrType, treg int16, toffset int64) *obj.Prog

func (*Progs) Clear

func (pp *Progs) Clear(p *obj.Prog)

func (*Progs) Flush

func (pp *Progs) Flush()

Flush converts from pp to machine code.

func (*Progs) Free

func (pp *Progs) Free()

Free clears pp and any associated resources.

func (*Progs) NewProg

func (pp *Progs) NewProg() *obj.Prog

func (*Progs) Prog

func (pp *Progs) Prog(as obj.As) *obj.Prog

Prog adds a Prog with instruction As to pp.

func (*Progs) SetText

func (pp *Progs) SetText(fn *ir.Func)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL