aboutsummaryrefslogtreecommitdiff
path: root/src/internal/pkgbits
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2022-07-31 18:48:16 -0700
committerGopher Robot <gobot@golang.org>2022-08-03 19:20:41 +0000
commitc9f2150cfb3c1db87f6434f727c25403d985a6e4 (patch)
tree8341f6a10d7a5aa209510ee79006e0bac3bc65be /src/internal/pkgbits
parent994ff78ba01b921870866f9ce9db7563bd89494f (diff)
downloadgo-c9f2150cfb3c1db87f6434f727c25403d985a6e4.tar.xz
[dev.unified] cmd/compile: start using runtime dictionaries
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>
Diffstat (limited to 'src/internal/pkgbits')
-rw-r--r--src/internal/pkgbits/encoder.go1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/internal/pkgbits/encoder.go b/src/internal/pkgbits/encoder.go
index f1bc8367ef..ec47e352cb 100644
--- a/src/internal/pkgbits/encoder.go
+++ b/src/internal/pkgbits/encoder.go
@@ -21,7 +21,6 @@ import (
// - v1: adds the flags uint32 word
//
// TODO(mdempsky): For the next version bump:
-// - remove the unused dict.derived.needed bool
// - remove the legacy "has init" bool from the public root
const currentVersion uint32 = 1