private void GetOrDefineDict()
 {
     FieldInfo baseDictField = baseType.GetField("dict");
     if (baseDictField == null) {
         dictField = tg.AddField(typeof(IAttributesDictionary), "__dict__");
     } else {
         dictField = new FieldSlot(new ThisSlot(tg.myType), baseDictField);
     }
 }
        private void CreateWeakRefField()
        {
            if (weakrefField != null) return;

            FieldInfo fi = baseType.GetField("__weakref__");
            if (fi != null) {
                // base defines it
                weakrefField = new FieldSlot(new ThisSlot(baseType), fi);
            }

            if (weakrefField == null) {
                weakrefField = tg.AddField(typeof(WeakRefTracker), "__weakref__");
            }
        }