Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into hotfix/atomic-and-or-wasm-dup
Browse files Browse the repository at this point in the history
Change-Id: I256e2c89ffe8dc5ee5a7fe16f25a1cbd41ffd592
  • Loading branch information
mauri870 committed Nov 21, 2023
2 parents 5188f46 + 2e77b51 commit 92736a6
Show file tree
Hide file tree
Showing 64 changed files with 2,803 additions and 1,688 deletions.
6 changes: 6 additions & 0 deletions doc/godebug.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ Go 1.22 changed the default TLS cipher suites used by clients and servers when
not explicitly configured, removing the cipher suites which used RSA based key
exchange. The default can be revert using the [`tlsrsakex` setting](/pkg/crypto/tls/#Config).

Go 1.22 disabled
[`ConnectionState.ExportKeyingMaterial`](/pkg/crypto/tls/#ConnectionState.ExportKeyingMaterial)
when the connection supports neither TLS 1.3 nor Extended Master Secret
(implemented in Go 1.21). It can be reenabled with the [`tlsunsafeekm`
setting](/pkg/crypto/tls/#ConnectionState.ExportKeyingMaterial).

### Go 1.21

Go 1.21 made it a run-time error to call `panic` with a nil interface value,
Expand Down
50 changes: 50 additions & 0 deletions src/cmd/compile/abi-internal.md
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,56 @@ modifying or saving the FPCR.
Functions are allowed to modify it between calls (as long as they
restore it), but as of this writing Go code never does.

### loong64 architecture

The loong64 architecture uses R4 – R19 for integer arguments and integer results.

It uses F0 – F15 for floating-point arguments and results.

Registers R20 - R21, R23 – R28, R30 - R31, F16 – F31 are permanent scratch registers.

Register R2 is reserved and never used.

Register R20, R21 is Used by runtime.duffcopy, runtime.duffzero.

Special-purpose registers used within Go generated code and Go assembly code
are as follows:

| Register | Call meaning | Return meaning | Body meaning |
| --- | --- | --- | --- |
| R0 | Zero value | Same | Same |
| R1 | Link register | Link register | Scratch |
| R3 | Stack pointer | Same | Same |
| R20,R21 | Scratch | Scratch | Used by duffcopy, duffzero |
| R22 | Current goroutine | Same | Same |
| R29 | Closure context pointer | Same | Same |
| R30, R31 | used by the assembler | Same | Same |

*Rationale*: These register meanings are compatible with Go’s stack-based
calling convention.

#### Stack layout

The stack pointer, R3, grows down and is aligned to 8 bytes.

A function's stack frame, after the frame is created, is laid out as
follows:

+------------------------------+
| ... locals ... |
| ... outgoing arguments ... |
| return PC | ← R3 points to
+------------------------------+ ↓ lower addresses

This stack layout is used by both register-based (ABIInternal) and
stack-based (ABI0) calling conventions.

The "return PC" is loaded to the link register, R1, as part of the
loong64 `JAL` operation.

#### Flags
All bits in CSR are system flags and are not modified by Go.

### ppc64 architecture

The ppc64 architecture uses R3 – R10 and R14 – R17 for integer arguments
Expand Down
15 changes: 8 additions & 7 deletions src/cmd/compile/internal/inline/inlheur/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,13 @@ func AnalyzeFunc(fn *ir.Func, canInline func(*ir.Func), budgetForFunc func(*ir.F
// inlinable; if it is over the default hairyness limit and it
// doesn't have any interesting properties, then we don't want
// the overhead of writing out its inline body.
nameFinder := newNameFinder(fn)
for i := len(funcs) - 1; i >= 0; i-- {
f := funcs[i]
if f.OClosure != nil && !f.InlinabilityChecked() {
canInline(f)
}
funcProps := analyzeFunc(f, inlineMaxBudget)
funcProps := analyzeFunc(f, inlineMaxBudget, nameFinder)
revisitInlinability(f, funcProps, budgetForFunc)
if f.Inl != nil {
f.Inl.Properties = funcProps.SerializeToString()
Expand All @@ -122,11 +123,11 @@ func TearDown() {
scoreCallsCache.csl = nil
}

func analyzeFunc(fn *ir.Func, inlineMaxBudget int) *FuncProps {
func analyzeFunc(fn *ir.Func, inlineMaxBudget int, nf *nameFinder) *FuncProps {
if funcInlHeur, ok := fpmap[fn]; ok {
return funcInlHeur.props
}
funcProps, fcstab := computeFuncProps(fn, inlineMaxBudget)
funcProps, fcstab := computeFuncProps(fn, inlineMaxBudget, nf)
file, line := fnFileLine(fn)
entry := fnInlHeur{
fname: fn.Sym().Name,
Expand Down Expand Up @@ -163,21 +164,21 @@ func revisitInlinability(fn *ir.Func, funcProps *FuncProps, budgetForFunc func(*
// computeFuncProps examines the Go function 'fn' and computes for it
// a function "properties" object, to be used to drive inlining
// heuristics. See comments on the FuncProps type for more info.
func computeFuncProps(fn *ir.Func, inlineMaxBudget int) (*FuncProps, CallSiteTab) {
func computeFuncProps(fn *ir.Func, inlineMaxBudget int, nf *nameFinder) (*FuncProps, CallSiteTab) {
if debugTrace&debugTraceFuncs != 0 {
fmt.Fprintf(os.Stderr, "=-= starting analysis of func %v:\n%+v\n",
fn, fn)
}
funcProps := new(FuncProps)
ffa := makeFuncFlagsAnalyzer(fn)
analyzers := []propAnalyzer{ffa}
analyzers = addResultsAnalyzer(fn, analyzers, funcProps, inlineMaxBudget)
analyzers = addParamsAnalyzer(fn, analyzers, funcProps)
analyzers = addResultsAnalyzer(fn, analyzers, funcProps, inlineMaxBudget, nf)
analyzers = addParamsAnalyzer(fn, analyzers, funcProps, nf)
runAnalyzersOnFunction(fn, analyzers)
for _, a := range analyzers {
a.setResults(funcProps)
}
cstab := computeCallSiteTable(fn, fn.Body, nil, ffa.panicPathTable(), 0)
cstab := computeCallSiteTable(fn, fn.Body, nil, ffa.panicPathTable(), 0, nf)
return funcProps, cstab
}

Expand Down
Loading

0 comments on commit 92736a6

Please sign in to comment.