github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/compile/internal/ssa/writebarrier.go (about) 1 // Copyright 2016 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package ssa 6 7 // A ZeroRegion records parts of an object which are known to be zero. 8 // A ZeroRegion only applies to a single memory state. 9 // Each bit in mask is set if the corresponding pointer-sized word of 10 // the base object is known to be zero. 11 // In other words, if mask & (1<<i) != 0, then [base+i*ptrSize, base+(i+1)*ptrSize) 12 // is known to be zero. 13 type ZeroRegion struct { 14 base *Value 15 mask uint64 16 } 17 18 // IsStackAddr reports whether v is known to be an address of a stack slot. 19 func IsStackAddr(v *Value) bool 20 21 // IsGlobalAddr reports whether v is known to be an address of a global (or nil). 22 func IsGlobalAddr(v *Value) bool 23 24 // IsReadOnlyGlobalAddr reports whether v is known to be an address of a read-only global. 25 func IsReadOnlyGlobalAddr(v *Value) bool 26 27 // IsNewObject reports whether v is a pointer to a freshly allocated & zeroed object, 28 // if so, also returns the memory state mem at which v is zero. 29 func IsNewObject(v *Value, select1 []*Value) (mem *Value, ok bool) 30 31 // IsSanitizerSafeAddr reports whether v is known to be an address 32 // that doesn't need instrumentation. 33 func IsSanitizerSafeAddr(v *Value) bool