]> Cypherpunks.ru repositories - gostls13.git/commitdiff
[dev.typeparams] runtime: replace Goarch* constants with internal/goarch versions...
authorMichael Anthony Knyszek <mknyszek@google.com>
Wed, 16 Jun 2021 21:57:58 +0000 (21:57 +0000)
committerMichael Knyszek <mknyszek@google.com>
Thu, 17 Jun 2021 21:29:09 +0000 (21:29 +0000)
[git-generate]
cd src/runtime
gofmt -w -r "sys.Goarch386         -> goarch.Is386" .
gofmt -w -r "sys.GoarchAmd64       -> goarch.IsAmd64" .
gofmt -w -r "sys.GoarchAmd64p32    -> goarch.IsAmd64p32" .
gofmt -w -r "sys.GoarchArm         -> goarch.IsArm" .
gofmt -w -r "sys.GoarchArmbe       -> goarch.IsArmbe" .
gofmt -w -r "sys.GoarchArm64       -> goarch.IsArm64" .
gofmt -w -r "sys.GoarchArm64be     -> goarch.IsArm64be" .
gofmt -w -r "sys.GoarchPpc64       -> goarch.IsPpc64" .
gofmt -w -r "sys.GoarchPpc64le     -> goarch.IsPpc64le" .
gofmt -w -r "sys.GoarchMips        -> goarch.IsMips" .
gofmt -w -r "sys.GoarchMipsle      -> goarch.IsMipsle" .
gofmt -w -r "sys.GoarchMips64      -> goarch.IsMips64" .
gofmt -w -r "sys.GoarchMips64le    -> goarch.IsMips64le" .
gofmt -w -r "sys.GoarchMips64p32   -> goarch.IsMips64p32" .
gofmt -w -r "sys.GoarchMips64p32le -> goarch.IsMips64p32le" .
gofmt -w -r "sys.GoarchPpc         -> goarch.IsPpc" .
gofmt -w -r "sys.GoarchRiscv       -> goarch.IsRiscv" .
gofmt -w -r "sys.GoarchRiscv64     -> goarch.IsRiscv64" .
gofmt -w -r "sys.GoarchS390        -> goarch.IsS390" .
gofmt -w -r "sys.GoarchS390x       -> goarch.IsS390x" .
gofmt -w -r "sys.GoarchSparc       -> goarch.IsSparc" .
gofmt -w -r "sys.GoarchSparc64     -> goarch.IsSparc64" .
gofmt -w -r "sys.GoarchWasm        -> goarch.IsWasm" .
goimports -w *.go

Change-Id: I9d88e1284efabaeb0ee3733cba6286247d078c85
Reviewed-on: https://go-review.googlesource.com/c/go/+/328345
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/runtime/malloc.go
src/runtime/panic.go
src/runtime/stack.go
src/runtime/trace.go

index 715019671d9927e84623e8f72fa6d54693d12175..8483ec99d88cd946b78d2755dd9618612ab7c699 100644 (file)
@@ -209,7 +209,7 @@ const (
        // arenaBaseOffset to offset into the top 4 GiB.
        //
        // WebAssembly currently has a limit of 4GB linear memory.
-       heapAddrBits = (_64bit*(1-sys.GoarchWasm)*(1-goos.IsIos*sys.GoarchArm64))*48 + (1-_64bit+sys.GoarchWasm)*(32-(sys.GoarchMips+sys.GoarchMipsle)) + 33*goos.IsIos*sys.GoarchArm64
+       heapAddrBits = (_64bit*(1-goarch.IsWasm)*(1-goos.IsIos*goarch.IsArm64))*48 + (1-_64bit+goarch.IsWasm)*(32-(goarch.IsMips+goarch.IsMipsle)) + 33*goos.IsIos*goarch.IsArm64
 
        // maxAlloc is the maximum size of an allocation. On 64-bit,
        // it's theoretically possible to allocate 1<<heapAddrBits bytes. On
@@ -250,7 +250,7 @@ const (
        // logHeapArenaBytes is log_2 of heapArenaBytes. For clarity,
        // prefer using heapArenaBytes where possible (we need the
        // constant to compute some other constants).
-       logHeapArenaBytes = (6+20)*(_64bit*(1-goos.IsWindows)*(1-sys.GoarchWasm)*(1-goos.IsIos*sys.GoarchArm64)) + (2+20)*(_64bit*goos.IsWindows) + (2+20)*(1-_64bit) + (2+20)*sys.GoarchWasm + (2+20)*goos.IsIos*sys.GoarchArm64
+       logHeapArenaBytes = (6+20)*(_64bit*(1-goos.IsWindows)*(1-goarch.IsWasm)*(1-goos.IsIos*goarch.IsArm64)) + (2+20)*(_64bit*goos.IsWindows) + (2+20)*(1-_64bit) + (2+20)*goarch.IsWasm + (2+20)*goos.IsIos*goarch.IsArm64
 
        // heapArenaBitmapBytes is the size of each heap arena's bitmap.
        heapArenaBitmapBytes = heapArenaBytes / (goarch.PtrSize * 8 / 2)
@@ -305,7 +305,7 @@ const (
        //
        // On other platforms, the user address space is contiguous
        // and starts at 0, so no offset is necessary.
-       arenaBaseOffset = 0xffff800000000000*sys.GoarchAmd64 + 0x0a00000000000000*goos.IsAix
+       arenaBaseOffset = 0xffff800000000000*goarch.IsAmd64 + 0x0a00000000000000*goos.IsAix
        // A typed version of this constant that will make it into DWARF (for viewcore).
        arenaBaseOffsetUintptr = uintptr(arenaBaseOffset)
 
index 04b95e51e53735218157c7cfb97768431758807f..abf76537b05651fddca01c043b0b4f39552f1138 100644 (file)
@@ -5,6 +5,7 @@
 package runtime
 
 import (
+       "internal/goarch"
        "runtime/internal/atomic"
        "runtime/internal/sys"
        "unsafe"
@@ -29,7 +30,7 @@ import (
 // pc should be the program counter of the compiler-generated code that
 // triggered this panic.
 func panicCheck1(pc uintptr, msg string) {
-       if sys.GoarchWasm == 0 && hasPrefix(funcname(findfunc(pc)), "runtime.") {
+       if goarch.IsWasm == 0 && hasPrefix(funcname(findfunc(pc)), "runtime.") {
                // Note: wasm can't tail call, so we can't get the original caller's pc.
                throw(msg)
        }
index 779d0c21a06f943b95c6eb4a620bb0e5c16bfd01..1fa235bf8624512671cec5602b5872f3542d44b2 100644 (file)
@@ -69,7 +69,7 @@ const (
        // to each stack below the usual guard area for OS-specific
        // purposes like signal handling. Used on Windows, Plan 9,
        // and iOS because they do not use a separate stack.
-       _StackSystem = goos.IsWindows*512*goarch.PtrSize + goos.IsPlan9*512 + goos.IsIos*sys.GoarchArm64*1024
+       _StackSystem = goos.IsWindows*512*goarch.PtrSize + goos.IsPlan9*512 + goos.IsIos*goarch.IsArm64*1024
 
        // The minimum size of stack used by Go code
        _StackMin = 2048
index 72e95947db979a0cee6b62133367203917d7ef33..00544e4283c620310c1ee3b53664750d34787713 100644 (file)
@@ -86,7 +86,7 @@ const (
        // and ppc64le.
        // Tracing won't work reliably for architectures where cputicks is emulated
        // by nanotime, so the value doesn't matter for those architectures.
-       traceTickDiv = 16 + 48*(sys.Goarch386|sys.GoarchAmd64)
+       traceTickDiv = 16 + 48*(goarch.Is386|goarch.IsAmd64)
        // Maximum number of PCs in a single stack trace.
        // Since events contain only stack id rather than whole stack trace,
        // we can allow quite large values here.