}
}
if p.arch.Family == sys.AMD64 {
- // 4 operand instruction have form ymm1, ymm2, ymm3/m256, imm8
+ // 4 operand instruction have form ymm1, ymm2, ymm3/m256, imm8
// So From3 is always just a register, so we store imm8 in Offset field,
// to avoid increasing size of Prog.
prog.From = a[1]
// formatIter iterates through the string s in increasing
// index order and calls f for each format specifier '%..v'.
// The arguments for f describe the specifier's index range.
-// If a format specifier contains a "*", f is called with
+// If a format specifier contains a "*", f is called with
// the index range for "*" alone, before being called for
// the entire specifier. The result of f is the index of
// the rune at which iteration continues.
case ssa.OpAMD64LoweredNilCheck:
// Issue a load which will fault if the input is nil.
// TODO: We currently use the 2-byte instruction TESTB AX, (reg).
- // Should we use the 3-byte TESTB $0, (reg) instead? It is larger
+ // Should we use the 3-byte TESTB $0, (reg) instead? It is larger
// but it doesn't have false dependency on AX.
// Or maybe allocate an output register and use MOVL (reg),reg2 ?
// That trades clobbering flags for clobbering a register.
func convT2Islice(tab *byte, elem *any) (ret any)
func convT2Inoptr(tab *byte, elem *any) (ret any)
-// interface type assertions x.(T)
+// interface type assertions x.(T)
func assertE2I(typ *byte, iface any) (ret any)
func assertE2I2(typ *byte, iface any) (ret any, b bool)
func assertI2I(typ *byte, iface any) (ret any)
return n
- // target is invalid type for a constant? leave alone.
+ // target is invalid type for a constant? leave alone.
case OLITERAL:
if !okforconst[t.Etype] && n.Type.Etype != TNIL {
return defaultlitreuse(n, nil, reuse)
return 'a' <= b && b <= 'z' || 'A' <= b && b <= 'Z'
}
-// is this path a local name? begins with ./ or ../ or /
+// is this path a local name? begins with ./ or ../ or /
func islocalname(name string) bool {
return strings.HasPrefix(name, "/") ||
runtime.GOOS == "windows" && len(name) >= 3 && isDriveLetter(name[0]) && name[1] == ':' && name[2] == '/' ||
return false
case PPARAMOUT:
if s.hasdefer {
- // TODO: handle this case? Named return values must be
+ // TODO: handle this case? Named return values must be
// in memory so that the deferred function can see them.
// Maybe do: if !strings.HasPrefix(n.String(), "~") { return false }
// Or maybe not, see issue 18860. Even unnamed return values
// but we take some extra care to make sure we
// don't get stuck in an infinite loop.
// Infinite copy loops may happen in unreachable code.
- // (TODO: or can they? Needs a test.)
+ // (TODO: or can they? Needs a test.)
slow := w
var advance bool
for w.Op == OpCopy {
// Decide on registers for phi ops. Use the registers determined
// by the primary predecessor if we can.
// TODO: pick best of (already processed) predecessors?
- // Majority vote? Deepest nesting level?
+ // Majority vote? Deepest nesting level?
phiRegs = phiRegs[:0]
var phiUsed regMask
for _, v := range phis {
case ssa.Op386LoweredNilCheck:
// Issue a load which will fault if the input is nil.
// TODO: We currently use the 2-byte instruction TESTB AX, (reg).
- // Should we use the 3-byte TESTB $0, (reg) instead? It is larger
+ // Should we use the 3-byte TESTB $0, (reg) instead? It is larger
// but it doesn't have false dependency on AX.
// Or maybe allocate an output register and use MOVL (reg),reg2 ?
// That trades clobbering flags for clobbering a register.
var dst int16 = REG_CX
if (p.As == ALEAL || p.As == AMOVL) && p.To.Reg != p.From.Reg && p.To.Reg != p.From.Index {
dst = p.To.Reg
- // Why? See the comment near the top of rewriteToUseGot above.
+ // Why? See the comment near the top of rewriteToUseGot above.
// AMOVLs might be introduced by the GOT rewrites.
}
q := obj.Appendp(p, newprog)
}
func (f *goobjFile) pcln() (textStart uint64, symtab, pclntab []byte, err error) {
- // Should never be called. We implement Liner below, callers
+ // Should never be called. We implement Liner below, callers
// should use that instead.
return 0, nil, nil, fmt.Errorf("pcln not available in go object file")
}
// Returns "",0,nil if unknown.
// This function implements the Liner interface in preference to pcln() above.
func (f *goobjFile) PCToLine(pc uint64) (string, int, *gosym.Func) {
- // TODO: this is really inefficient. Binary search? Memoize last result?
+ // TODO: this is really inefficient. Binary search? Memoize last result?
var arch *sys.Arch
for _, a := range sys.Archs {
if a.Name == f.goobj.Arch {
// recvType loads the definition of a type.
func (dec *Decoder) recvType(id typeId) {
- // Have we already seen this type? That's an error
+ // Have we already seen this type? That's an error
if id < firstUserId || dec.wireType[id] != nil {
dec.err = errors.New("gob: duplicate type received")
return
switch v.Kind() {
case reflect.Interface:
if v.NumMethod() == 0 {
- // Decoding into nil interface? Switch to non-reflect code.
+ // Decoding into nil interface? Switch to non-reflect code.
v.Set(reflect.ValueOf(d.arrayInterface()))
return
}
}
v = pv
- // Decoding into nil interface? Switch to non-reflect code.
+ // Decoding into nil interface? Switch to non-reflect code.
if v.Kind() == reflect.Interface && v.NumMethod() == 0 {
v.Set(reflect.ValueOf(d.objectInterface()))
return
b := make([]byte, len(s)+2*utf8.UTFMax)
w := copy(b, s[0:r])
for r < len(s) {
- // Out of room? Can only happen if s is full of
+ // Out of room? Can only happen if s is full of
// malformed UTF-8 and we're replacing each
// byte with RuneError.
if w >= len(b)-2*utf8.UTFMax {
// UnmarshalXML must consume exactly one XML element.
// One common implementation strategy is to unmarshal into
// a separate value with a layout matching the expected XML
-// using d.DecodeElement, and then to copy the data from
+// using d.DecodeElement, and then to copy the data from
// that value into the receiver.
// Another common strategy is to use d.Token to process the
// XML object one token at a time.
}
// UintVar defines a uint flag with specified name, default value, and usage string.
-// The argument p points to a uint variable in which to store the value of the flag.
+// The argument p points to a uint variable in which to store the value of the flag.
func UintVar(p *uint, name string, value uint, usage string) {
CommandLine.Var(newUintValue(value, p), name, usage)
}
// Uint defines a uint flag with specified name, default value, and usage string.
-// The return value is the address of a uint variable that stores the value of the flag.
+// The return value is the address of a uint variable that stores the value of the flag.
func (f *FlagSet) Uint(name string, value uint, usage string) *uint {
p := new(uint)
f.UintVar(p, name, value, usage)
}
// Uint defines a uint flag with specified name, default value, and usage string.
-// The return value is the address of a uint variable that stores the value of the flag.
+// The return value is the address of a uint variable that stores the value of the flag.
func Uint(name string, value uint, usage string) *uint {
return CommandLine.Uint(name, value, usage)
}
return f.parsed
}
-// Parse parses the command-line flags from os.Args[1:]. Must be called
+// Parse parses the command-line flags from os.Args[1:]. Must be called
// after all flags are defined and before flags are accessed by the program.
func Parse() {
// Ignore errors; CommandLine is set for ExitOnError.
p.buf.WriteByte(']')
}
case reflect.Ptr:
- // pointer to array or slice or struct? ok at top level
+ // pointer to array or slice or struct? ok at top level
// but not embedded (avoid loops)
if depth == 0 && f.Pointer() != 0 {
switch a := f.Elem(); a.Kind() {
} else if hasCL {
delHeader("Transfer-Encoding")
} else if w.req.ProtoAtLeast(1, 1) {
- // HTTP/1.1 or greater: Transfer-Encoding has been set to identity, and no
+ // HTTP/1.1 or greater: Transfer-Encoding has been set to identity, and no
// content-length has been provided. The connection must be closed after the
// reply is written, and no chunking is to be done. This is the setup
// recommended in the Server-Sent Events candidate recommendation 11,
package runtime
-// careful: cputicks is not guaranteed to be monotonic! In particular, we have
+// careful: cputicks is not guaranteed to be monotonic! In particular, we have
// noticed drift between cpus on certain os/arch combinations. See issue 8976.
func cputicks() int64
case v == 0:
// Nothing was waiting. Done.
case v == locked:
- // Two notewakeups! Not allowed.
+ // Two notewakeups! Not allowed.
throw("notewakeup - double wakeup")
default:
// Must be the waiting m. Wake it up.
}
}
- // Ok, we're doing it! Stop everybody else
+ // Ok, we're doing it! Stop everybody else
semacquire(&worldsema)
if trace.enabled {
exit(4)
fallthrough
default:
- // Can't even print! Just exit.
+ // Can't even print! Just exit.
exit(5)
}
}
return "", ErrSyntax
}
- // Is it trivial? Avoid allocation.
+ // Is it trivial? Avoid allocation.
if !contains(s, '\\') && !contains(s, quote) {
switch quote {
case '"':
magic64 = 0xdeddeadbeefbeef
)
-// Do the 64-bit functions panic? If so, don't bother testing.
+// Do the 64-bit functions panic? If so, don't bother testing.
var test64err = func() (err interface{}) {
defer func() {
err = recover()
}
// ParseFiles parses files listed in fs and extracts all syscall
-// functions listed in sys comments. It returns source files
+// functions listed in sys comments. It returns source files
// and functions collection *Source if successful.
func ParseFiles(fs []string) (*Source, error) {
src := &Source{
// Sizeof takes an expression x of any type and returns the size in bytes
// of a hypothetical variable v as if v was declared via var v = x.
// The size does not include any memory possibly referenced by x.
-// For instance, if x is a slice, Sizeof returns the size of the slice
+// For instance, if x is a slice, Sizeof returns the size of the slice
// descriptor, not the size of the memory referenced by the slice.
func Sizeof(x ArbitraryType) uintptr