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;
        }
示例#2
0
 // is this assignable to c?
 public override bool IsAssignableTo(Type c)
 {
     //TODO: Improve?
     return c.GetDescriptor() == GetDescriptor() || (Super != null && Super.IsAssignableTo(c));
 }