gc

Imports

Imports #

"fmt"
"go/constant"
"cmd/compile/internal/base"
"cmd/compile/internal/ir"
"cmd/compile/internal/typecheck"
"cmd/compile/internal/types"
"cmd/internal/bio"
"bufio"
"bytes"
"cmd/compile/internal/base"
"cmd/compile/internal/coverage"
"cmd/compile/internal/deadlocals"
"cmd/compile/internal/dwarfgen"
"cmd/compile/internal/escape"
"cmd/compile/internal/inline"
"cmd/compile/internal/inline/interleaved"
"cmd/compile/internal/ir"
"cmd/compile/internal/logopt"
"cmd/compile/internal/loopvar"
"cmd/compile/internal/noder"
"cmd/compile/internal/pgoir"
"cmd/compile/internal/pkginit"
"cmd/compile/internal/reflectdata"
"cmd/compile/internal/rttype"
"cmd/compile/internal/ssa"
"cmd/compile/internal/ssagen"
"cmd/compile/internal/staticinit"
"cmd/compile/internal/typecheck"
"cmd/compile/internal/types"
"cmd/internal/dwarf"
"cmd/internal/obj"
"cmd/internal/objabi"
"cmd/internal/src"
"cmd/internal/telemetry/counter"
"flag"
"fmt"
"internal/buildcfg"
"log"
"os"
"runtime"
"cmd/compile/internal/base"
"cmd/compile/internal/ir"
"cmd/compile/internal/noder"
"cmd/compile/internal/objw"
"cmd/compile/internal/pkginit"
"cmd/compile/internal/reflectdata"
"cmd/compile/internal/staticdata"
"cmd/compile/internal/typecheck"
"cmd/compile/internal/types"
"cmd/internal/archive"
"cmd/internal/bio"
"cmd/internal/obj"
"cmd/internal/objabi"
"encoding/json"
"fmt"
"strings"
"net/url"
"os"
"path/filepath"
"runtime"
"runtime/pprof"
tracepkg "runtime/trace"
"strings"
"cmd/compile/internal/base"
"cmp"
"internal/race"
"math/rand"
"slices"
"sync"
"cmd/compile/internal/base"
"cmd/compile/internal/ir"
"cmd/compile/internal/liveness"
"cmd/compile/internal/objw"
"cmd/compile/internal/pgoir"
"cmd/compile/internal/ssagen"
"cmd/compile/internal/staticinit"
"cmd/compile/internal/types"
"cmd/compile/internal/walk"
"cmd/internal/obj"

Constants & Variables

compilequeue var #

var compilequeue []*ir.Func

modeCompilerObj const #

These modes say which kind of object file to generate. The default use of the toolchain is to set both bits, generating a combined compiler+linker object, one that serves to describe the package to both the compiler and the linker. In fact the compiler and linker read nearly disjoint sections of that file, though, so in a distributed build setting it can be more efficient to split the output into two files, supplying the compiler object only to future compilations and the linker object only to future links. By default a combined object is written, but if -linkobj is specified on the command line then the default -o output is a compiler object and the -linkobj output is a linker object.

const modeCompilerObj = *ast.BinaryExpr

modeLinkerObj const #

These modes say which kind of object file to generate. The default use of the toolchain is to set both bits, generating a combined compiler+linker object, one that serves to describe the package to both the compiler and the linker. In fact the compiler and linker read nearly disjoint sections of that file, though, so in a distributed build setting it can be more efficient to split the output into two files, supplying the compiler object only to future compilations and the linker object only to future links. By default a combined object is written, but if -linkobj is specified on the command line then the default -o output is a compiler object and the -linkobj output is a linker object.

const modeLinkerObj

Functions

Main function #

Main parses flags and Go source files specified in the command-line arguments, type-checks the parsed Go package, compiles functions to machine code, and finally writes the compiled package definition to disk.

func Main(archInit func(*ssagen.ArchInfo))

addGCLocals function #

addGCLocals adds gcargs, gclocals, gcregs, and stack object symbols to Ctxt.Data. This is done during the sequential phase after compilation, since global symbols can't be declared during parallel compilation.

func addGCLocals()

compileFunctions function #

compileFunctions compiles all functions in compilequeue. It fans out nBackendWorkers to do the work and waits for them to complete.

func compileFunctions(profile *pgoir.Profile)

dumpCompilerObj function #

func dumpCompilerObj(bout *bio.Writer)

dumpGlobal function #

func dumpGlobal(n *ir.Name)

dumpGlobalConst function #

func dumpGlobalConst(n *ir.Name)

dumpLinkerObj function #

func dumpLinkerObj(bout *bio.Writer)

dumpasmhdr function #

func dumpasmhdr()

dumpdata function #

func dumpdata()

dumpembeds function #

func dumpembeds()

dumpobj function #

func dumpobj()

dumpobj1 function #

func dumpobj1(outfile string, mode int)

enqueueFunc function #

func enqueueFunc(fn *ir.Func)

finishArchiveEntry function #

func finishArchiveEntry(bout *bio.Writer, start int64, name string)

ggloblnod function #

func ggloblnod(nam *ir.Name)

handlePanic function #

handlePanic ensures that we print out an "internal compiler error" for any panic or runtime exception during front-end compiler processing (unless there have already been some compiler errors). It may also be invoked from the explicit panic in hcrash(), in which case, we pass the panic on through.

func handlePanic()

makePos function #

func makePos(b *src.PosBase, line uint, col uint) src.XPos

prepareFunc function #

prepareFunc handles any remaining frontend compilation tasks that aren't yet safe to perform concurrently.

func prepareFunc(fn *ir.Func)

printObjHeader function #

func printObjHeader(bout *bio.Writer)

profileName function #

func profileName(fn string, suffix string) string

startArchiveEntry function #

func startArchiveEntry(bout *bio.Writer) int64

startProfile function #

func startProfile()

writebench function #

func writebench(filename string) error

Generated with Arrow