本文整理汇总了C#中IKVM.Internal.ClassFile.GetConstantPoolConstantType方法的典型用法代码示例。如果您正苦于以下问题:C# ClassFile.GetConstantPoolConstantType方法的具体用法?C# ClassFile.GetConstantPoolConstantType怎么用?C# ClassFile.GetConstantPoolConstantType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IKVM.Internal.ClassFile
的用法示例。
在下文中一共展示了ClassFile.GetConstantPoolConstantType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsLambdaAltMetafactory
private static bool IsLambdaAltMetafactory(ClassFile classFile, ClassFile.BootstrapMethod bsm)
{
ClassFile.ConstantPoolItemMethodHandle mh;
AltFlags flags;
int argpos = 4;
return bsm.ArgumentCount >= 4
&& (mh = classFile.GetConstantPoolConstantMethodHandle(bsm.BootstrapMethodIndex)).Kind == ClassFile.RefKind.invokeStatic
&& mh.Member != null
&& IsLambdaAltMetafactory(mh.Member)
&& classFile.GetConstantPoolConstantType(bsm.GetArgument(0)) == ClassFile.ConstantType.MethodType
&& classFile.GetConstantPoolConstantType(bsm.GetArgument(1)) == ClassFile.ConstantType.MethodHandle
&& classFile.GetConstantPoolConstantType(bsm.GetArgument(2)) == ClassFile.ConstantType.MethodType
&& classFile.GetConstantPoolConstantType(bsm.GetArgument(3)) == ClassFile.ConstantType.Integer
&& ((flags = (AltFlags)classFile.GetConstantPoolConstantInteger(bsm.GetArgument(3))) & ~AltFlags.Mask) == 0
&& ((flags & AltFlags.Markers) == 0 || CheckOptionalArgs(classFile, bsm, ClassFile.ConstantType.Class, ref argpos))
&& ((flags & AltFlags.Bridges) == 0 || CheckOptionalArgs(classFile, bsm, ClassFile.ConstantType.MethodType, ref argpos))
&& argpos == bsm.ArgumentCount;
}
示例2: CheckOptionalArgs
private static bool CheckOptionalArgs(ClassFile classFile, ClassFile.BootstrapMethod bsm, ClassFile.ConstantType type, ref int argpos)
{
if (bsm.ArgumentCount - argpos < 1)
{
return false;
}
if (classFile.GetConstantPoolConstantType(bsm.GetArgument(argpos)) != ClassFile.ConstantType.Integer)
{
return false;
}
int count = classFile.GetConstantPoolConstantInteger(bsm.GetArgument(argpos++));
if (count < 0 || bsm.ArgumentCount - argpos < count)
{
return false;
}
for (int i = 0; i < count; i++)
{
if (classFile.GetConstantPoolConstantType(bsm.GetArgument(argpos++)) != type)
{
return false;
}
}
return true;
}
示例3: IsLambdaMetafactory
private static bool IsLambdaMetafactory(ClassFile classFile, ClassFile.BootstrapMethod bsm)
{
ClassFile.ConstantPoolItemMethodHandle mh;
return bsm.ArgumentCount == 3
&& classFile.GetConstantPoolConstantType(bsm.GetArgument(0)) == ClassFile.ConstantType.MethodType
&& classFile.GetConstantPoolConstantType(bsm.GetArgument(1)) == ClassFile.ConstantType.MethodHandle
&& classFile.GetConstantPoolConstantType(bsm.GetArgument(2)) == ClassFile.ConstantType.MethodType
&& (mh = classFile.GetConstantPoolConstantMethodHandle(bsm.BootstrapMethodIndex)).Kind == ClassFile.RefKind.invokeStatic
&& mh.Member != null
&& IsLambdaMetafactory(mh.Member);
}