return (n + a - 1) &^ (a - 1)
}
-func newName(n, tag, pkgPath string, exported bool) name {
+func newName(n, tag string, exported bool) name {
if len(n) > 1<<16-1 {
panic("reflect.nameFrom: name too long: " + n)
}
l += 2 + len(tag)
bits |= 1 << 1
}
- if pkgPath != "" {
- bits |= 1 << 2
- }
b := make([]byte, l)
b[0] = bits
copy(tb[2:], tag)
}
- if pkgPath != "" {
- panic("reflect: creating a name with a package path is not supported")
- }
-
return name{bytes: &b[0]}
}
prototype := *(**ptrType)(unsafe.Pointer(&iptr))
pp := *prototype
- pp.str = resolveReflectName(newName(s, "", "", false))
+ pp.str = resolveReflectName(newName(s, "", false))
pp.ptrToThis = 0
// For the type structures linked into the binary, the
ch := *prototype
ch.tflag = 0
ch.dir = uintptr(dir)
- ch.str = resolveReflectName(newName(s, "", "", false))
+ ch.str = resolveReflectName(newName(s, "", false))
ch.hash = fnv1(typ.hash, 'c', byte(dir))
ch.elem = typ
// Make a map type.
var imap interface{} = (map[unsafe.Pointer]unsafe.Pointer)(nil)
mt := **(**mapType)(unsafe.Pointer(&imap))
- mt.str = resolveReflectName(newName(s, "", "", false))
+ mt.str = resolveReflectName(newName(s, "", false))
mt.tflag = 0
mt.hash = fnv1(etyp.hash, 'm', byte(ktyp.hash>>24), byte(ktyp.hash>>16), byte(ktyp.hash>>8), byte(ktyp.hash))
mt.key = ktyp
}
// Populate the remaining fields of ft and store in cache.
- ft.str = resolveReflectName(newName(str, "", "", false))
+ ft.str = resolveReflectName(newName(str, "", false))
ft.ptrToThis = 0
return addToCache(&ft.rtype)
}
b.align = 8
}
s := "bucket(" + ktyp.String() + "," + etyp.String() + ")"
- b.str = resolveReflectName(newName(s, "", "", false))
+ b.str = resolveReflectName(newName(s, "", false))
return b
}
prototype := *(**sliceType)(unsafe.Pointer(&islice))
slice := *prototype
slice.tflag = 0
- slice.str = resolveReflectName(newName(s, "", "", false))
+ slice.str = resolveReflectName(newName(s, "", false))
slice.hash = fnv1(typ.hash, '[')
slice.elem = typ
slice.ptrToThis = 0
}
}
- typ.str = resolveReflectName(newName(str, "", "", false))
+ typ.str = resolveReflectName(newName(str, "", false))
typ.tflag = 0
typ.hash = hash
typ.size = size
resolveReflectType(field.Type.common()) // install in runtime
return structField{
- name: newName(field.Name, string(field.Tag), "", true),
+ name: newName(field.Name, string(field.Tag), true),
typ: field.Type.common(),
offsetAnon: offsetAnon,
}
prototype := *(**arrayType)(unsafe.Pointer(&iarray))
array := *prototype
array.tflag = 0
- array.str = resolveReflectName(newName(s, "", "", false))
+ array.str = resolveReflectName(newName(s, "", false))
array.hash = fnv1(typ.hash, '[')
for n := uint32(count); n > 0; n >>= 8 {
array.hash = fnv1(array.hash, byte(n))
} else {
s = "funcargs(" + t.String() + ")"
}
- x.str = resolveReflectName(newName(s, "", "", false))
+ x.str = resolveReflectName(newName(s, "", false))
// cache result for future callers
framePool = &sync.Pool{New: func() interface{} {