aboutsummaryrefslogtreecommitdiff
path: root/src/internal/pkgbits
AgeCommit message (Collapse)Author
14 daysinternal/pkgbits: bump version for generic methodsMark Freeman
We still need to guard changes to the bitstream which don't depend on witnessing a generic method. Change-Id: Idfc189ebb02f86dbd91e47f5e4c7663479441370 Reviewed-on: https://go-review.googlesource.com/c/go/+/761583 Auto-Submit: Mark Freeman <markfreeman@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Griesemer <gri@google.com>
2026-03-20internal/pkgbits: add missing testsRobert Griesemer
The encoding version was recently bumped to V3 but the tests were not updated. Do it now. For #9859. Change-Id: Ia61d3e178215e804dcd2db186774883617e5e5a4 Reviewed-on: https://go-review.googlesource.com/c/go/+/757440 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Mark Freeman <markfreeman@google.com>
2026-03-19cmd/compile/internal/noder: encode promoted struct fields for composite ↵Robert Griesemer
literals in UIR This change requires an encoding format change for struct literals. Introduce a new UIR version (V3) and use the opportunity to encode all composite literals more compactly: specifically, when we know that (composite literal) keys are always present, avoid encoding a bool value for each key. Do not yet enable the new format. For #9859. Change-Id: Ic6dc9adb1aa494e923eadaf578f8cfc61efd5ea4 Reviewed-on: https://go-review.googlesource.com/c/go/+/754664 Reviewed-by: Mark Freeman <markfreeman@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Griesemer <gri@google.com>
2025-11-14std: fix printf("%q", int) mistakesAlan Donovan
For #72850 Change-Id: I07e64f05c82a34b1dadb9a72e16f5045e68cbd24 Reviewed-on: https://go-review.googlesource.com/c/go/+/720642 Auto-Submit: Alan Donovan <adonovan@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-05-29internal/pkgbits: explain the rationale for reference tablesMark Freeman
The primary benefit of reference tables is to the linker, though they are also reasonably compact as compared to absolute element indices. It is worth also checking if reference table structure is similarly exploited past the IR linking stage. Ideally, the reference table definition would live in / near the linker. As it stands, it's a bit hard to infer the purpose of the reference tables when looking at pkgbits in isolation. Change-Id: I496aca5a4edcf28e66fa7863ddfa4d825e1b2e89 Reviewed-on: https://go-review.googlesource.com/c/go/+/675596 Auto-Submit: Mark Freeman <mark@golang.org> Reviewed-by: Robert Griesemer <gri@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-05-21internal/pkgbits: mark element / section ends as delta encoding candidatesMark Freeman
Change-Id: I165c98a0a5800515bfa33c60b95b534900d0ea59 Reviewed-on: https://go-review.googlesource.com/c/go/+/675215 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Mark Freeman <mark@golang.org> Reviewed-by: Robert Griesemer <gri@google.com>
2025-05-21internal/pkgbits: specify that RelIdx is an element indexMark Freeman
Without this, it's not clear what this is relative to or the granularity of the index. Change-Id: Ibaabe47e089f0ba9b084523969c5347ed4c9dbee Reviewed-on: https://go-review.googlesource.com/c/go/+/674636 Auto-Submit: Mark Freeman <mark@golang.org> Reviewed-by: Robert Griesemer <gri@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-05-21internal/pkgbits: indent productions and hoist some types upMark Freeman
The types being hoisted are those which cannot be referenced; that is, where Ref[T] is illegal. These are most clearly owned by pkgbits. The types which follow are those which can be referenced. Referenceable types are more hazy due to the reference mechanism of UIR - sections. These are a detail of the UIR file format and are surfaced directly to importers. I suspect that pkgbits would benefit from a reference mechanism not dependent on sections. This would permit us to push down many types from the noder into pkgbits, reducing the interface surface without giving up deduplication. Change-Id: Ifaf5cd9de20c767ad0941413385b308d628aac6c Reviewed-on: https://go-review.googlesource.com/c/go/+/674635 Auto-Submit: Mark Freeman <mark@golang.org> TryBot-Bypass: Mark Freeman <mark@golang.org> Reviewed-by: Robert Griesemer <gri@google.com>
2025-05-20internal/pkgbits: rename RelocEnt to RefTableEntryMark Freeman
Change-Id: I9b1c9a0499ad3444e8cb3e4be187f9fab816c90c Reviewed-on: https://go-review.googlesource.com/c/go/+/674159 Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Mark Freeman <mark@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-05-19std: pass bytes.Buffer and strings.Builder by pointerAlan Donovan
This CL fixes a number of (all true positive) findings of vet's copylock analyzer patched to treat the Bu{ff,uild}er types as non-copyable after first use. This does require imposing an additional indirection between noder.writer and Encoder since the field is embedded by value but its constructor now returns a pointer. Updates golang/go#25907 Updates golang/go#47276 Change-Id: I0b4d77ac12bcecadf06a91709e695365da10766c Reviewed-on: https://go-review.googlesource.com/c/go/+/635339 Reviewed-by: Robert Findley <rfindley@google.com> Commit-Queue: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Alan Donovan <adonovan@google.com>
2025-05-14internal/pkgbits, cmd/compile/internal/noder: document string sectionMark Freeman
To understand this change, we begin with a short description of the UIR file format. Every file is a header followed by a series of sections. Each section has a kind, which determines the type of elements it contains. An element is just a collection of one or more primitives, as defined by package pkgbits. Strings have their own section. Elements in the string section contain only string primitives. To use a string, elements in other sections encode a reference to the string section. To illustrate, consider a simple file which exports nothing at all. package p In the meta section, there is an element representing a package stub. In that package stub, a string ("p") represents both the path and name of the package. Again, these are encoded as references. To manage references, every element begins with a reference table. Instead of writing the bytes for "p" directly, the package stub encodes an index in this reference table. At that index, a pair of numbers is stored, indicating: 1. which section 2. which element index within the section Effectively, elements always use *2* layers of indirection; first to the reference table, then to the bytes themselves. With some minor hand-waving, an encoding for the above package is given below, with (S)ections, (E)lements and (P)rimitives denoted. + Header | + Section Ends // each section has 1 element | | + 1 // String is elements [0, 1) | | + 2 // Meta is elements [1, 2) | + Element Ends | | + 1 // "p" is bytes [0, 1) | | + 6 // stub is bytes [1, 6) + Payload | + (S) String | | + (E) String | | | + (P) String { byte } 0x70 // "p" | + (S) Meta | | + (E) Package Stub | | | + Reference Table | | | | + (P) Entry Count uvarint 1 // there is a single entry | | | | + (P) 0th Section uvarint 0 // to String, 0th section | | | | + (P) 0th Index uvarint 0 // to 0th element in String | | | + Internals | | | | + (P) Path uvarint 0 // 0th entry in table | | | | + (P) Name uvarint 0 // 0th entry in table Note that string elements do not have reference tables like other elements. They behave more like a primitive. As this is a bit complicated and getting into details of the UIR file format, we omit some details in the documentation here. The structure will become clearer as we continue documenting. Change-Id: I12a5ce9a34251c5358a20f2f2c4d0f9bd497f4d0 Reviewed-on: https://go-review.googlesource.com/c/go/+/671997 Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Mark Freeman <mark@golang.org> TryBot-Bypass: Mark Freeman <mark@golang.org>
2025-05-12internal/pkgbits: rename Reloc* to Section*Mark Freeman
This is a basic refactoring. This enumeration refers primarily to the different sections of a UIR file, so this naming is a bit more direct. Change-Id: Ib70ab054e97effaabc035450d246ae4354da8075 Reviewed-on: https://go-review.googlesource.com/c/go/+/671935 Reviewed-by: Robert Griesemer <gri@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Mark Freeman <mark@golang.org>
2025-05-12internal/pkgbits: write a formal grammar for UIR primitivesMark Freeman
This complements the grammar being developed in package noder. It is unclear how to discuss references in their current state, as they require knowledge of sections, elements, etc. Perhaps the references here should refer to indices on the byte array. This would allow a stronger separation of pkgbits and noder. Change-Id: Ic0e5ac9c07f0a0b92d6ffd4d4e26dbe5dcf89e57 Reviewed-on: https://go-review.googlesource.com/c/go/+/671440 Reviewed-by: Robert Griesemer <gri@google.com> TryBot-Bypass: Mark Freeman <mark@golang.org> Auto-Submit: Mark Freeman <mark@golang.org>
2025-05-08pkgbits: consolidate doc.go to only relevant detailsMark Freeman
The stated goal for pkgbits is to implement encoding / decoding of primitives. However, pkgbits has knowledge of high-level details like elements, sections, and file layout. This change starts to clarify pkgbits by paring back documentation to only those concepts which pkgbits owns. Further CLs are needed to shift away logic that pkgbits should not own. Change-Id: Id93003d080f58ffbd6327e2db1a4878500511619 Reviewed-on: https://go-review.googlesource.com/c/go/+/670176 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Mark Freeman <mark@golang.org> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Mark Freeman <mark@golang.org>
2025-05-06pkgbits: replace references to RelocKind with SectionKindMark Freeman
Change-Id: Id194a42645d1da6440558bf12dc252f347072f86 Reviewed-on: https://go-review.googlesource.com/c/go/+/670175 Auto-Submit: Mark Freeman <mark@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Mark Freeman <mark@golang.org> Reviewed-by: Robert Griesemer <gri@google.com>
2025-05-06pkgbits: alias RelocKind with a SectionKind typeMark Freeman
I think that SectionKind better conveys the original intent here, and goes nicely with codifying section relative indices. Change-Id: I96a245e67295a5f9f8e462756a14f60eccec6862 Reviewed-on: https://go-review.googlesource.com/c/go/+/668538 Reviewed-by: Mark Freeman <mark@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Mark Freeman <mark@golang.org> Reviewed-by: Robert Griesemer <gri@google.com>
2025-05-06pkgbits: alias the Index type to clarify it is section relativeMark Freeman
Change-Id: I214eb97ef3b11a6de8584498f2df4baff1903e1d Reviewed-on: https://go-review.googlesource.com/c/go/+/668537 Auto-Submit: Mark Freeman <mark@golang.org> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Mark Freeman <mark@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-05-05pkgbits: improve documentation in reloc.goMark Freeman
Change-Id: I71cc0db153c559d4c5b48d1d744daf16deffe6d6 Reviewed-on: https://go-review.googlesource.com/c/go/+/668536 Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Mark Freeman <mark@golang.org> Auto-Submit: Mark Freeman <mark@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-01-07cmd/internal/hash: stop using md5, sha1Russ Cox
These break if the tools are run with GODEBUG=fips140=only, which happens if someone sets that during 'go test' (and a test binary must be built). The easiest fix is to make the tools compatible with this GODEBUG by just using sha256 as the underlying hash always. Just in case, I made the wrappers select different sections of the hash, but none of the call sites really care. This CL is for the Go 1.24 release, but a follow-up during the Go 1.25 dev cycle could change all the usage sites to only use Sum32/New32. For #70514 Fixes #70878 Change-Id: Id5fea779c83df51d1680dbe561e0949c56e8d1e5 Reviewed-on: https://go-review.googlesource.com/c/go/+/641096 Reviewed-by: Keith Randall <khr@golang.org> Auto-Submit: Russ Cox <rsc@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com>
2024-11-21all: fix some function names and typos in commentcuishuang
Change-Id: I07e7c8eaa5bd4bac0d576b2f2f4cd3f81b0b77a4 Reviewed-on: https://go-review.googlesource.com/c/go/+/630055 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Commit-Queue: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Russ Cox <rsc@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-08-28cmd/compile/internal/noder: write V2 bitstream aliastypeparams=1Tim King
Enables V2 unified IR bitstreams when GOEXPERIMENT aliastypeparams are enabled. Allows pkgbits.NewPkgEncoder to set the output version. Reenables support for writing V0 streams. Updates #68778 Updates #68526 Change-Id: I590c494d81ab7db148232ceaba52229068d1e986 Reviewed-on: https://go-review.googlesource.com/c/go/+/608595 Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2024-08-26internal/pkgbits: add DerivedInfoNeededCuong Manh Le
So next CL can use it to remove unnecessary derivedInfo needed field. Updates #68778 Change-Id: Ia4e0f638beaf4a448fbf10a9aa1bc9425349a5e8 Reviewed-on: https://go-review.googlesource.com/c/go/+/608215 Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Tim King <taking@google.com> Reviewed-by: Robert Griesemer <gri@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-08-21internal/pkgbits: fix incorrect doc commentRobert Griesemer
Change-Id: I71d1dfec11657ffa8ffe12e87f6dbd65cbb1854b Reviewed-on: https://go-review.googlesource.com/c/go/+/607475 Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Robert Griesemer <gri@google.com> TryBot-Bypass: Robert Griesemer <gri@google.com>
2024-08-20internal/pkgbits: add Version typeTim King
Adds a new Version type to pkgbits to represent the version of the bitstream. Versions let readers and writers know when different data is expected to be present or not in the bitstream. These different pieces of data are called Fields, as an analogy with fields of a struct. Fields can be added, removed or changed in a Version. Extends Encoder and Decoder to report which version they are. Updates #68778 Change-Id: Iaffa1828544fb4cbc47a905de853449bc8e5b91f Reviewed-on: https://go-review.googlesource.com/c/go/+/605655 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2024-08-19internal/pkgbits: s/errorf/panicf/ because that's what it isRobert Griesemer
Make it obvious that this function panics. Change-Id: I272142d2cf7132aa8915f8f4b5945834376db062 Reviewed-on: https://go-review.googlesource.com/c/go/+/606935 Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Robert Griesemer <gri@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-04-11all: re-run stringerIan Lance Taylor
Re-run all go:generate stringer commands. This mostly adds checks that the constant values did not change, but does add new strings for the debug/dwarf and internal/pkgbits packages. Change-Id: I5fc41f20da47338152c183d45d5ae65074e2fccf Reviewed-on: https://go-review.googlesource.com/c/go/+/483717 Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org>
2022-09-27cmd/compile: make a type-specialized copy of encoding/binary.ReadUvarintDavid Chase
This is to get better escape analysis for a frequently-allocated object. Change-Id: I1942a4e1c3cd1f0fa870bc8433a0165c18ce9c75 Reviewed-on: https://go-review.googlesource.com/c/go/+/435336 Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com> Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2022-09-27cmd/compile: introduce "temporary" readers for more storage reuseDavid Chase
Change-Id: Id05d6099624284a9c1583b066d1a703e806b1e22 Reviewed-on: https://go-review.googlesource.com/c/go/+/433037 Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com>
2022-08-10cmd/compile/internal/noder: explicitly handle function instantiationsMatthew Dempsky
This CL changes unified IR to explicitly handle function instantiations within expression handling, rather than leaving it to the underlying object reading logic. Change-Id: I009a56013fbe9fbc4dabf80eea98993d34af4272 Reviewed-on: https://go-review.googlesource.com/c/go/+/421817 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: David Chase <drchase@google.com>
2022-08-10internal/pkgbits: fix performance of rawRelocDavid Chase
There was a TODO about quadratic performance, and indeed, it can get bad. Added a map, made some integers that are unlikely to exceed a few million into 32-bit integers. Change-Id: I6facf2eabc00483e943b326ca8dcae2f778093da Reviewed-on: https://go-review.googlesource.com/c/go/+/422297 Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2022-08-08all: use io.Seek* instead of deprecated os.SEEK_*Tobias Klauser
These are available since Go 1.7. The version used for bootstrap is Go 1.17 for Go 1.20. For #44505 Change-Id: I497c9f617baefdeb273cd115b08b6e31bd10aad2 Reviewed-on: https://go-review.googlesource.com/c/go/+/421634 Reviewed-by: Than McIntosh <thanm@google.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-08-04all: clean up TODO after fixing issue 44505hopehook
For #44505 Change-Id: I89220be02372b5340cb987bf2ac870a9346a8c8f Reviewed-on: https://go-review.googlesource.com/c/go/+/421079 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-08-04[dev.unified] all: merge master (85d87b9) into dev.unifiedMatthew Dempsky
Merge List: + 2022-08-04 85d87b9c75 all: update vendored golang.org/x dependencies for Go 1.20 development + 2022-08-04 fb1bfd4d37 all: remove pre-Go 1.17 workarounds + 2022-08-04 44ff9bff0c runtime: clean up panic and deadlock lock ranks + 2022-08-04 f42dc0de74 runtime: make the lock rank DAG make more sense + 2022-08-04 d29a0282e9 runtime: add mayAcquire annotation for finlock + 2022-08-04 c5be4ed7df runtime: add missing trace lock edges + 2022-08-04 2b8a9a484f runtime: generate the lock ranking from a DAG description + 2022-08-04 ddfd639408 runtime: delete unused lock ranks + 2022-08-04 426ea5702b internal/dag: add a Graph type and make node order deterministic + 2022-08-04 d37cc9a8cd go/build, internal/dag: lift DAG parser into an internal package + 2022-08-04 ab0a94c6d3 cmd/dist: require Go 1.17 for building Go + 2022-08-04 1e3c19f3fe runtime: support riscv64 SV57 mode + 2022-08-03 f28fa952b5 make.bat, make.rc: show bootstrap toolchain version + 2022-08-03 87384801dc cmd/asm: update package doc to describe "-p" option + 2022-08-03 c6a2dada0d net: disable TestIPv6WriteMsgUDPAddrPortTargetAddrIPVersion [sic] on DragonflyBSD + 2022-08-02 29b9a328d2 runtime: trivial replacements of g in remaining files + 2022-08-02 c647264619 runtime: trivial replacements of g in signal_unix.go + 2022-08-02 399f50c9d7 runtime: tricky replacements of g in traceback.go + 2022-08-02 4509e951ec runtime: tricky replacements of g in proc.go + 2022-08-02 4400238ec8 runtime: trivial replacements of _g_ in remaining files + 2022-08-02 5999a28de8 runtime: trivial replacements of _g_ in os files + 2022-08-02 0e18cf6d09 runtime: trivial replacements of _g_ in GC files + 2022-08-02 4358a53a97 runtime: trivial replacements of _g_ in proc.go + 2022-08-02 b486518964 runtime: tricky replacements of _g_ in os3_solaris.go + 2022-08-02 54a0ab3f7b runtime: tricky replacements of _g_ in os3_plan9.go + 2022-08-02 4240ff764b runtime: tricky replacements of _g_ in signal_windows.go + 2022-08-02 8666d89ca8 runtime: tricky replacements of _g_ in signal_unix.go + 2022-08-02 74cee276fe runtime: tricky replacements of _g_ in trace.go + 2022-08-02 222799fde6 runtime: tricky replacements of _g_ in mgc.go + 2022-08-02 e9d7f54a1a runtime: tricky replacements of _g_ in proc.go + 2022-08-02 5e8d261918 runtime: rename _p_ to pp + 2022-08-02 0ad2ec6596 runtime: clean up dopanic_m + 2022-08-02 7e952962df runtime: clean up canpanic + 2022-08-02 9dbc0f3556 runtime: fix outdated g.m comment in traceback.go + 2022-08-02 d723df76da internal/goversion: update Version to 1.20 + 2022-08-02 1b7e71e8ae all: disable tests that fail on Alpine + 2022-08-01 f2a9f3e2e0 test: improve generic type assertion test + 2022-08-01 27038b70f8 cmd/compile: fix wrong dict pass condition for type assertions + 2022-08-01 e99f53fed9 doc: move Go 1.19 release notes to x/website + 2022-08-01 8b13a073a1 doc: mention removal of cmd/compile's -importmap and -installsuffix flags + 2022-08-01 e95fd4c238 doc/go1.19: fix typo: EM_LONGARCH -> EM_LOONGARCH + 2022-08-01 dee3efd9f8 doc/go1.19: fix a few links that were missing trailing slashes + 2022-07-30 f32519e5fb runtime: fix typos + 2022-07-29 9a2001a8cc cmd/dist: always pass -short=true with -quick + 2022-07-28 5c8ec89cb5 doc/go1.19: minor adjustments and links + 2022-07-28 417be37048 doc/go1.19: improve the loong64 release notes + 2022-07-28 027855e8d8 os/exec: add GODEBUG setting to opt out of ErrDot changes Change-Id: Idc0fbe93978c0dff7600b90a2c3ecc067fd9f5f2
2022-08-04all: remove pre-Go 1.17 workaroundsRuss Cox
The Go bootstrap toolchain requirement is now Go 1.17. We can finally delete all these pre-Go 1.17 workarounds. For #44505. Change-Id: I59d4dff1cde23da022892b5b6a116eb3dbad9ce4 Reviewed-on: https://go-review.googlesource.com/c/go/+/420903 Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Austin Clements <austin@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-03[dev.unified] cmd/compile: start using runtime dictionariesMatthew Dempsky
This CL switches unified IR to start using runtime dictionaries, rather than pure stenciling. In particular, for each instantiated function `F[T]`, it now: 1. Generates a global variable `F[T]-dict` of type `[N]uintptr`, with all of the `*runtime._type` values needed by `F[T]`. 2. Generates a function `F[T]-shaped`, with an extra `.dict *[N]uintptr` parameter and indexing into that parameter for derived types. (N.B., this function is not yet actually using shape types.) 3. Changes `F[T]` to instead be a wrapper function that calls `F[T]-shaped` passing `&F[T]-dict` as the `.dict` parameter. This is done in one pass to make sure the overall wiring is all working (especially, function literals and inlining). Subsequent CLs will write more information into `F[T]-dict` and update `F[T]-shaped` to use it instead of relying on `T`-derived information itself. Once that's done, `F[T]-shaped` can be changed to `F[shapify(T)]` (e.g., `F[go.shape.int]`) and deduplicated. Change-Id: I0e802a4d9934794e01a6bfc367820af893335155 Reviewed-on: https://go-review.googlesource.com/c/go/+/420416 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: David Chase <drchase@google.com>
2022-07-28[dev.unified] cmd/compile: move "has init" to private metadataMatthew Dempsky
Currently, there's a "has init" bool in the public metadata section, which is only needed by cmd/compile; but because it's in the public metadata section, it's known to the go/types importers too. This CL moves it instead to the new compiler-only private metadata section added in the last CL for the inline bodies index. The existing bool in the public metadata section is left in place, and just always set to false, to avoid breaking the x/tools importer. The next time we bump the export version number, we can remove the bool properly. But no urgency just yet. Change-Id: I380f358652374b5a221f85020a53dc65912ddb29 Reviewed-on: https://go-review.googlesource.com/c/go/+/419676 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-28[dev.unified] cmd/compile: write iface conversion RTTI into unified IRMatthew Dempsky
This CL changes convRTTI into a serialization method too, like the previous CL's rtype method. And again, currently this just builds on the existing type serialization logic, but will eventually be changed to use dictionary lookups where appropriate. Change-Id: I551aef8ade24b08dc6206f06ace86d91e665f5c1 Reviewed-on: https://go-review.googlesource.com/c/go/+/419457 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com>
2022-07-28[dev.unified] cmd/compile: write RTTI into unified IR export dataMatthew Dempsky
This CL adds `rtype` methods for unified IR for writing/reading types that need to have their *runtime._type value available. For now, this just builds on the existing type writing/reading mechanics and calling reflectdata.TypePtrAt; but longer term, reading of derived types can be changed to use dictionary lookups instead. Change-Id: I6f803b84546fa7df2877a8a3bcbf2623e4b03449 Reviewed-on: https://go-review.googlesource.com/c/go/+/419456 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: David Chase <drchase@google.com>
2022-07-25[dev.unified] cmd/compile: add method expressions to dictionariesMatthew Dempsky
This CL changes method expressions that use derived-type receiver parameters to use dictionary lookups. Change-Id: Iacd09b6d77a2d3000438ec8bc9b5af2a0b068aa7 Reviewed-on: https://go-review.googlesource.com/c/go/+/419455 Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-12internal/pkgbits: change EnableSync into a dynamic knobMatthew Dempsky
Rather than requiring users to recompile the compiler and all tools to enable/disable sync markers, this CL adds a flag word into the Unified IR file format to allow indicating whether they're enabled or not. This in turn requires bumping the file format version. Thanks to drchase@ for benchmarks showing this isn't as expensive as I feared it would be. Change-Id: I99afa0ee0b6ef5f30ed8ca840805ff9fd46b1857 Reviewed-on: https://go-review.googlesource.com/c/go/+/417097 Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-06-30[dev.unified] cmd/compile/internal/noder: refactor N:1 expression handlingMatthew Dempsky
Pull all multi-value expression handling logic into a new multiExpr helper method. Change-Id: I78ec2dfc523abcfa3368a1064df7045aade8e468 Reviewed-on: https://go-review.googlesource.com/c/go/+/415243 Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
2022-06-06[dev.unified] cmd/compile/internal/noder: push exprBlank up into assignment ↵Matthew Dempsky
handling Blanks can only appear on the LHS of an assignment. Instead of handling them as an arbitrary expression, handle them as part of assignee expression lists. Change-Id: Iaeb0a5c471ffa1abd2bbbd9c95f7876533e5a607 Reviewed-on: https://go-review.googlesource.com/c/go/+/410100 Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2022-05-25internal/pkgbits: add Index typeMatthew Dempsky
Element indices are very common in the pkgbits API, so introduce a new defined type to help make that clearer. Change-Id: I8f9493e2335601c740eb403d1fdcd11183122907 Reviewed-on: https://go-review.googlesource.com/c/go/+/407435 Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-05-25internal/pkgbits: finish documentationMatthew Dempsky
This CL adds documentation for all exported pkgbits APIs, and removes its UNREVIEWED comments. Updates #48194. Change-Id: Ifff548cd9f31a5c5cc5f400a6dae5c98c46ec4ca Reviewed-on: https://go-review.googlesource.com/c/go/+/407614 Reviewed-by: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com>
2022-05-20internal/pkgbits: better documentationMatthew Dempsky
Change-Id: I3f96a6e8a43faa5c8111b9d979aa37822c1dce06 Reviewed-on: https://go-review.googlesource.com/c/go/+/407434 Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
2022-03-28internal/pkgbits: add fingerprints to unified IR export formatMatthew Dempsky
So far unified IR has been relying on the backwards-compat iexport data to supply package fingerprints for imports. To be able to drop the iexport data and natively use unified IR everywhere. This CL applies basically the same idea that iexport used: simply hash all of the export data as it's being written out, and then tack on an 8-byte hash at the end. Change-Id: Iaca5fbfd7443088bc7f422a1c58be3e762c29014 Reviewed-on: https://go-review.googlesource.com/c/go/+/396196 Trust: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-03-07cmd/compile: represent derived types with ir.DynamicType in unified IRMatthew Dempsky
This CL switches unified IR to using ir.DynamicType for derived types. This has an immediate effect of fixing compilation of generic code that when fully stenciled results in statically invalid type assertions. This does require updating typecheck to expect ODYNAMICTYPE in type switches, but this is straightforward to implement. For now, we still statically resolve the runtime type (or itab) pointer. However, a subsequent CL will allow reading these pointers from the runtime dictionary. Change-Id: I1666678fcc588bc9cb8b97871bd02b9059848e6d Reviewed-on: https://go-review.googlesource.com/c/go/+/390336 Trust: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2022-03-01internal/pkgbits: add version numberMatthew Dempsky
Especially once this code gets copied into x/tools, we need a way to evolve the file format, so add an explicit version number. Change-Id: I9cc2e357c3ca3f07fd8d0c0ba4e4a95f89edeac6 Reviewed-on: https://go-review.googlesource.com/c/go/+/388914 Trust: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
2022-03-01internal/pkgbits: extract unified IR coding-level logicMatthew Dempsky
This logic is needed for the go/types unified IR importer, so extract it into a separate internal package so we can reuse a single copy. Change-Id: I5f734b76e580fdb69ee39e45ac553c22d01c5909 Reviewed-on: https://go-review.googlesource.com/c/go/+/386000 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Trust: Matthew Dempsky <mdempsky@google.com>