Ejemplo n.º 1
0
        public short AddConstantClass(Type c)
        {
            if (c == null) return 0;

            var nameIndex = AddConstantUtf8(c.GetDescriptor(true));
            var classConst = ConstantPool.OfType<CompileConstantClass>().FirstOrDefault(x => x.NameIndex == nameIndex);

            if (classConst == null)
            {
                classConst = new CompileConstantClass { PoolIndex = nextConstantIndex++, NameIndex = nameIndex };

                ConstantPool.Add(classConst);
            }

            return classConst.PoolIndex;
        }
Ejemplo n.º 2
0
 // is this assignable to c?
 public override bool IsAssignableTo(Type c)
 {
     //TODO: Improve?
     return c.GetDescriptor() == GetDescriptor() || (Super != null && Super.IsAssignableTo(c));
 }