Documentation ¶
Index ¶
- Variables
- func AbiForBodylessFuncStackMap(fn *ir.Func) *abi.ABIConfig
- func AddAux(a *obj.Addr, v *ssa.Value)
- func AddAux2(a *obj.Addr, v *ssa.Value, offset int64)
- func AddrAuto(a *obj.Addr, v *ssa.Value)
- func CheckArgReg(v *ssa.Value)
- func CheckLargeStacks()
- func CheckLoweredGetClosurePtr(v *ssa.Value)
- func CheckLoweredPhi(v *ssa.Value)
- func Compile(fn *ir.Func, worker int)
- func DumpInline(fn *ir.Func)
- func EmitArgInfo(f *ir.Func, abiInfo *abi.ABIParamResultInfo) *obj.LSym
- func EnableNoWriteBarrierRecCheck()
- func InitConfig()
- func InitEnv()
- func InitLSym(f *ir.Func, hasBody bool)
- func InitTables()
- func IsIntrinsicCall(n *ir.CallExpr) bool
- func NoWriteBarrierRecCheck()
- func SpillSlotAddr(spill ssa.Spill, baseReg int16, extraOffset int64) obj.Addr
- func StackOffset(slot ssa.LocalSlot) int32
- func TypeOK(t *types.Type) bool
- type ArchInfo
- type Branch
- type IndexJump
- type State
- func (s *State) Br(op obj.As, target *ssa.Block) *obj.Prog
- func (s *State) Call(v *ssa.Value) *obj.Prog
- func (s *State) CombJump(b, next *ssa.Block, jumps *[2][2]IndexJump)
- func (s *State) DebugFriendlySetPosFrom(v *ssa.Value)
- func (s *State) FuncInfo() *obj.FuncInfo
- func (s *State) Pc() *obj.Prog
- func (s *State) PrepareCall(v *ssa.Value)
- func (s *State) Prog(as obj.As) *obj.Prog
- func (s *State) SetPos(pos src.XPos)
- func (s *State) TailCall(v *ssa.Value) *obj.Prog
- func (s *State) UseArgs(n int64)
- type SymABIs
Constants ¶
This section is empty.
Variables ¶
var ( BoundsCheckFunc [ssa.BoundsKindCount]*obj.LSym ExtendCheckFunc [ssa.BoundsKindCount]*obj.LSym )
var GCWriteBarrierReg map[int16]*obj.LSym
GCWriteBarrierReg maps from registers to gcWriteBarrier implementation LSyms.
Functions ¶
func AbiForBodylessFuncStackMap ¶
AbiForBodylessFuncStackMap returns the ABI for a bodyless function's stack map. This is not necessarily the ABI used to call it. Currently (1.17 dev) such a stack map is always ABI0; any ABI wrapper that is present is nosplit, hence a precise stack map is not needed there (the parameters survive only long enough to call the wrapped assembly function). This always returns a freshly copied ABI.
func CheckArgReg ¶
CheckArgReg ensures that v is in the function's entry block.
func CheckLargeStacks ¶
func CheckLargeStacks()
func CheckLoweredGetClosurePtr ¶
CheckLoweredGetClosurePtr checks that v is the first instruction in the function's entry block, except for incoming in-register arguments. The output of LoweredGetClosurePtr is generally hardwired to the correct register. That register contains the closure pointer on closure entry.
func CheckLoweredPhi ¶
CheckLoweredPhi checks that regalloc and stackalloc correctly handled phi values. Called during ssaGenValue.
func Compile ¶
Compile builds an SSA backend function, uses it to generate a plist, and flushes that plist to machine code. worker indicates which of the backend workers is doing the processing.
func DumpInline ¶
func EmitArgInfo ¶
emit argument info (locations on stack) of f for traceback.
func EnableNoWriteBarrierRecCheck ¶
func EnableNoWriteBarrierRecCheck()
func InitConfig ¶
func InitConfig()
func InitLSym ¶
InitLSym defines f's obj.LSym and initializes it based on the properties of f. This includes setting the symbol flags and ABI and creating and initializing related DWARF symbols.
InitLSym must be called exactly once per function and must be called for both functions with bodies and functions without bodies. For body-less functions, we only create the LSym; for functions with bodies call a helper to setup up / populate the LSym.
func InitTables ¶
func InitTables()
func IsIntrinsicCall ¶
func NoWriteBarrierRecCheck ¶
func NoWriteBarrierRecCheck()
func SpillSlotAddr ¶
SlotAddr uses LocalSlot information to initialize an obj.Addr The resulting addr is used in a non-standard context -- in the prologue of a function, before the frame has been constructed, so the standard addressing for the parameters will be wrong.
func StackOffset ¶
StackOffset returns the stack location of a LocalSlot relative to the stack pointer, suitable for use in a DWARF location entry. This has nothing to do with its offset in the user variable.
Types ¶
type ArchInfo ¶
type ArchInfo struct { LinkArch *obj.LinkArch REGSP int MAXWIDTH int64 SoftFloat bool PadFrame func(int64) int64 // ZeroRange zeroes a range of memory on stack. It is only inserted // at function entry, and it is ok to clobber registers. ZeroRange func(*objw.Progs, *obj.Prog, int64, int64, *uint32) *obj.Prog Ginsnop func(*objw.Progs) *obj.Prog // SSAMarkMoves marks any MOVXconst ops that need to avoid clobbering flags. SSAMarkMoves func(*State, *ssa.Block) // SSAGenValue emits Prog(s) for the Value. SSAGenValue func(*State, *ssa.Value) // SSAGenBlock emits end-of-block Progs. SSAGenValue should be called // for all values in the block before SSAGenBlock. SSAGenBlock func(s *State, b, next *ssa.Block) // LoadRegResult emits instructions that loads register-assigned result // at n+off (n is PPARAMOUT) to register reg. The result is already in // memory. Used in open-coded defer return path. LoadRegResult func(s *State, f *ssa.Func, t *types.Type, reg int16, n *ir.Name, off int64) *obj.Prog // SpillArgReg emits instructions that spill reg to n+off. SpillArgReg func(pp *objw.Progs, p *obj.Prog, f *ssa.Func, t *types.Type, reg int16, n *ir.Name, off int64) *obj.Prog }
var Arch ArchInfo
type State ¶
type State struct { ABI obj.ABI // Branches remembers all the branch instructions we've seen // and where they would like to go. Branches []Branch // JumpTables remembers all the jump tables we've seen. JumpTables []*ssa.Block // wasm: The number of values on the WebAssembly stack. This is only used as a safeguard. OnWasmStackSkipped int // contains filtered or unexported fields }
State contains state needed during Prog generation.
func (*State) Br ¶
Br emits a single branch instruction and returns the instruction. Not all architectures need the returned instruction, but otherwise the boilerplate is common to all.
func (*State) Call ¶
Call returns a new CALL instruction for the SSA value v. It uses PrepareCall to prepare the call.
func (*State) CombJump ¶
CombJump generates combinational instructions (2 at present) for a block jump, thereby the behaviour of non-standard condition codes could be simulated
func (*State) DebugFriendlySetPosFrom ¶
DebugFriendlySetPosFrom adjusts Pos.IsStmt subject to heuristics that reduce "jumpy" line number churn when debugging. Spill/fill/copy instructions from the register allocator, phi functions, and instructions with a no-pos position are examples of instructions that can cause churn.
func (*State) PrepareCall ¶
PrepareCall prepares to emit a CALL instruction for v and does call-related bookkeeping. It must be called immediately before emitting the actual CALL instruction, since it emits PCDATA for the stack map at the call (calls are safe points).
type SymABIs ¶
type SymABIs struct {
// contains filtered or unexported fields
}
SymABIs records information provided by the assembler about symbol definition ABIs and reference ABIs.
func NewSymABIs ¶
func NewSymABIs() *SymABIs
func (*SymABIs) GenABIWrappers ¶
func (s *SymABIs) GenABIWrappers()
GenABIWrappers applies ABI information to Funcs and generates ABI wrapper functions where necessary.
func (*SymABIs) ReadSymABIs ¶
ReadSymABIs reads a symabis file that specifies definitions and references of text symbols by ABI.
The symabis format is a set of lines, where each line is a sequence of whitespace-separated fields. The first field is a verb and is either "def" for defining a symbol ABI or "ref" for referencing a symbol using an ABI. For both "def" and "ref", the second field is the symbol name and the third field is the ABI name, as one of the named cmd/internal/obj.ABI constants.