Under register ABI, aggregates like [2]uint32 is passed
differently than a uint64. For now, don't use the fast version
of the map functions for non-trivial aggregates.
GOEXPERIMENT=regabi,regabiargs can now pass make.bash, modulo
staleness checks.
TODO: maybe find some way to use the fast functions. Maybe
unsafe-cast to uint32/64 then call the map function. But need to
make the type checker happy.
Change-Id: If42717280dde12636fb970798cf1ca8fb29a3d06
Reviewed-on: https://go-review.googlesource.com/c/go/+/308650
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: David Chase <drchase@google.com>
"cmd/compile/internal/ssagen"
"cmd/compile/internal/typecheck"
"cmd/compile/internal/types"
+ "cmd/internal/objabi"
"cmd/internal/src"
)
}
switch reflectdata.AlgType(t.Key()) {
case types.AMEM32:
+ if objabi.Experiment.RegabiArgs && t.Key().NumComponents(types.CountBlankFields) != 1 {
+ // If key has multiple components, under register ABI it will
+ // be passed differently than uint32.
+ // TODO: maybe unsafe-case to uint32. But needs to make the type
+ // checker happy.
+ return mapslow
+ }
if !t.Key().HasPointers() {
return mapfast32
}
}
base.Fatalf("small pointer %v", t.Key())
case types.AMEM64:
+ if objabi.Experiment.RegabiArgs && t.Key().NumComponents(types.CountBlankFields) != 1 {
+ // See above.
+ return mapslow
+ }
if !t.Key().HasPointers() {
return mapfast64
}