.net 反射镜错误或优化?
长话短说:我在System.Security.Util.Tokenizer类上使用了reflector,其中有大量goto语句 下面是一个简短的示例片段:.net 反射镜错误或优化?,.net,optimization,.net-reflector,.net,Optimization,.net Reflector,长话短说:我在System.Security.Util.Tokenizer类上使用了reflector,其中有大量goto语句 下面是一个简短的示例片段: Label_0026: if (this._inSavedCharacter != -1) { num = this._inSavedCharacter; this._inSavedCharacter = -1; } els
Label_0026:
if (this._inSavedCharacter != -1)
{
num = this._inSavedCharacter;
this._inSavedCharacter = -1;
}
else
{
switch (this._inTokenSource)
{
case TokenSource.UnicodeByteArray:
if ((this._inIndex + 1) < this._inSize)
{
break;
}
stream.AddToken(-1);
return;
case TokenSource.UTF8ByteArray:
if (this._inIndex < this._inSize)
{
goto Label_00CF;
}
stream.AddToken(-1);
return;
case TokenSource.ASCIIByteArray:
if (this._inIndex < this._inSize)
{
goto Label_023C;
}
stream.AddToken(-1);
return;
case TokenSource.CharArray:
if (this._inIndex < this._inSize)
{
goto Label_0272;
}
stream.AddToken(-1);
return;
case TokenSource.String:
if (this._inIndex < this._inSize)
{
goto Label_02A8;
}
stream.AddToken(-1);
return;
case TokenSource.NestedStrings:
if (this._inNestedSize == 0)
{
goto Label_030D;
}
if (this._inNestedIndex >= this._inNestedSize)
{
goto Label_0306;
}
num = this._inNestedString[this._inNestedIndex++];
goto Label_0402;
default:
num = this._inTokenReader.Read();
if (num == -1)
{
stream.AddToken(-1);
return;
}
goto Label_0402;
}
num = (this._inBytes[this._inIndex + 1] << 8) + this._inBytes[this._inIndex];
this._inIndex += 2;
}
goto Label_0402;
Label_00CF:
num = this._inBytes[this._inIndex++];
if ((num & 0x80) != 0)
{
switch (((num & 240) >> 4))
{
case 8:
case 9:
case 10:
case 11:
throw new XmlSyntaxException(this.LineNo);
case 12:
case 13:
num &= 0x1f;
num3 = 2;
break;
case 14:
num &= 15;
num3 = 3;
break;
case 15:
throw new XmlSyntaxException(this.LineNo);
}
if (this._inIndex >= this._inSize)
{
throw new XmlSyntaxException(this.LineNo, Environment.GetResourceString("XMLSyntax_UnexpectedEndOfFile"));
}
byte num2 = this._inBytes[this._inIndex++];
if ((num2 & 0xc0) != 0x80)
{
throw new XmlSyntaxException(this.LineNo);
}
num = (num << 6) | (num2 & 0x3f);
if (num3 != 2)
{
if (this._inIndex >= this._inSize)
{
throw new XmlSyntaxException(this.LineNo, Environment.GetResourceString("XMLSyntax_UnexpectedEndOfFile"));
}
num2 = this._inBytes[this._inIndex++];
if ((num2 & 0xc0) != 0x80)
{
throw new XmlSyntaxException(this.LineNo);
}
num = (num << 6) | (num2 & 0x3f);
}
}
goto Label_0402;
Label_023C:
num = this._inBytes[this._inIndex++];
goto Label_0402;
Label_0272:
num = this._inChars[this._inIndex++];
goto Label_0402;
Label_02A8:
num = this._inString[this._inIndex++];
goto Label_0402;
Label_0306:
this._inNestedSize = 0;
标签\u 0026:
如果(此._inSavedCharacter!=-1)
{
num=这个。\u保存字符;
这个._inSavedCharacter=-1;
}
其他的
{
开关(此。\u输入到源)
{
case TokenSource.UnicodeByteArray:
如果((此索引+1)<此索引)
{
打破
}
stream.AddToken(-1);
回来
case TokenSource.UTF8ByteArray:
如果(本指数<本指数)
{
转到标签\u 00CF;
}
stream.AddToken(-1);
回来
case TokenSource.asciByteArray:
如果(本指数<本指数)
{
goto标签_023C;
}
stream.AddToken(-1);
回来
case TokenSource.CharArray:
如果(本指数<本指数)
{
goto标签_0272;
}
stream.AddToken(-1);
回来
大小写标记源。字符串:
如果(本指数<本指数)
{
goto标签_02A8;
}
stream.AddToken(-1);
回来
case TokenSource.NestedStrings:
如果(此._inNestedSize==0)
{
goto标签_030D;
}
如果(this.\u inNestedIndex>=this.\u inNestedSize)
{
goto标签_0306;
}
num=这个;
goto标签_0402;
违约:
num=这个。_inTokenReader.Read();
如果(num==-1)
{
stream.AddToken(-1);
回来
}
goto标签_0402;
}
num=(本字节[本字节+1]>4))
{
案例8:
案例9:
案例10:
案例11:
抛出新的XmlSyntaxException(this.LineNo);
案例12:
案例13:
num&=0x1f;
num3=2;
打破
案例14:
num&=15;
num3=3;
打破
案例15:
抛出新的XmlSyntaxException(this.LineNo);
}
如果(此索引>=此索引)
{
抛出新的XmlSyntaxException(this.LineNo,Environment.GetResourceString(“XMLSyntax_UnexpectedEndOfFile”);
}
字节num2=这个。_inBytes[这个。_inIndex++];
如果((num2&0xc0)!=0x80)
{
抛出新的XmlSyntaxException(this.LineNo);
}
num=(num=this.\u inSize)
{
抛出新的XmlSyntaxException(this.LineNo,Environment.GetResourceString(“XMLSyntax_UnexpectedEndOfFile”);
}
num2=这个。_英寸字节[这个。_英寸索引++];
如果((num2&0xc0)!=0x80)
{
抛出新的XmlSyntaxException(this.LineNo);
}
num=(num看起来Reflector无法确定原始循环结构
有趣的是(为什么有时会出现这种情况)没有IL操作码用于,而和用于循环和中断和继续。如果测试与跳转相结合(即gotos),则等效的IL就是.看起来反射器无法确定原始环路结构
有趣的是(为什么有时会出现这种情况)没有IL操作码用于,而和用于循环和中断和继续。如果测试与跳转相结合(即gotos),则等效的IL就是.我怀疑是反射器错误-希望Redgate能够改进底层引擎…我怀疑是反射器错误-希望Redgate能够改进底层引擎。。。