aboutsummaryrefslogtreecommitdiff
path: root/src/internal/pkgbits/decoder.go
AgeCommit message (Collapse)Author
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-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-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-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>
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-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>
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-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-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-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-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>