Files
Dec2017-Script-Dump/mscorlib/System/Reflection/Emit/OpCode.cs
T
2026-06-04 11:42:34 +02:00

212 lines
7.3 KiB
C#

using System;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Describes a Microsoft intermediate language (MSIL) instruction.</summary>
// Token: 0x0200020A RID: 522
[ComVisible(true)]
public struct OpCode
{
// Token: 0x06001BC1 RID: 7105 RVA: 0x00067DC0 File Offset: 0x00065FC0
internal OpCode(int p, int q)
{
this.op1 = (byte)(p & 255);
this.op2 = (byte)((p >> 8) & 255);
this.push = (byte)((p >> 16) & 255);
this.pop = (byte)((p >> 24) & 255);
this.size = (byte)(q & 255);
this.type = (byte)((q >> 8) & 255);
this.args = (byte)((q >> 16) & 255);
this.flow = (byte)((q >> 24) & 255);
}
/// <summary>Returns the generated hash code for this Opcode.</summary>
/// <returns>Returns the hash code for this instance.</returns>
// Token: 0x06001BC2 RID: 7106 RVA: 0x00067E50 File Offset: 0x00066050
public override int GetHashCode()
{
return this.Name.GetHashCode();
}
/// <summary>Tests whether the given object is equal to this Opcode.</summary>
/// <returns>true if <paramref name="obj" /> is an instance of Opcode and is equal to this object; otherwise, false.</returns>
/// <param name="obj">The object to compare to this object. </param>
// Token: 0x06001BC3 RID: 7107 RVA: 0x00067E60 File Offset: 0x00066060
public override bool Equals(object obj)
{
if (obj == null || !(obj is OpCode))
{
return false;
}
OpCode opCode = (OpCode)obj;
return opCode.op1 == this.op1 && opCode.op2 == this.op2;
}
/// <summary>Indicates whether the current instance is equal to the specified <see cref="T:System.Reflection.Emit.OpCode" />.</summary>
/// <returns>true if the value of <paramref name="obj" /> is equal to the value of the current instance; otherwise, false.</returns>
/// <param name="obj">The <see cref="T:System.Reflection.Emit.OpCode" /> to compare to the current instance.</param>
// Token: 0x06001BC4 RID: 7108 RVA: 0x00067EAC File Offset: 0x000660AC
public bool Equals(OpCode obj)
{
return obj.op1 == this.op1 && obj.op2 == this.op2;
}
/// <summary>Returns this Opcode as a <see cref="T:System.String" />.</summary>
/// <returns>Returns a <see cref="T:System.String" /> containing the name of this Opcode.</returns>
// Token: 0x06001BC5 RID: 7109 RVA: 0x00067EE0 File Offset: 0x000660E0
public override string ToString()
{
return this.Name;
}
/// <summary>The name of the Microsoft intermediate language (MSIL) instruction.</summary>
/// <returns>Read-only. The name of the MSIL instruction.</returns>
// Token: 0x170004F3 RID: 1267
// (get) Token: 0x06001BC6 RID: 7110 RVA: 0x00067EE8 File Offset: 0x000660E8
public string Name
{
get
{
if (this.op1 == 255)
{
return OpCodeNames.names[(int)this.op2];
}
return OpCodeNames.names[256 + (int)this.op2];
}
}
/// <summary>The size of the Microsoft intermediate language (MSIL) instruction.</summary>
/// <returns>Read-only. The size of the MSIL instruction.</returns>
// Token: 0x170004F4 RID: 1268
// (get) Token: 0x06001BC7 RID: 7111 RVA: 0x00067F1C File Offset: 0x0006611C
public int Size
{
get
{
return (int)this.size;
}
}
/// <summary>The type of Microsoft intermediate language (MSIL) instruction.</summary>
/// <returns>Read-only. The type of Microsoft intermediate language (MSIL) instruction.</returns>
// Token: 0x170004F5 RID: 1269
// (get) Token: 0x06001BC8 RID: 7112 RVA: 0x00067F24 File Offset: 0x00066124
public OpCodeType OpCodeType
{
get
{
return (OpCodeType)this.type;
}
}
/// <summary>The operand type of an Microsoft intermediate language (MSIL) instruction.</summary>
/// <returns>Read-only. The operand type of an MSIL instruction.</returns>
// Token: 0x170004F6 RID: 1270
// (get) Token: 0x06001BC9 RID: 7113 RVA: 0x00067F2C File Offset: 0x0006612C
public OperandType OperandType
{
get
{
return (OperandType)this.args;
}
}
/// <summary>The flow control characteristics of the Microsoft intermediate language (MSIL) instruction.</summary>
/// <returns>Read-only. The type of flow control.</returns>
// Token: 0x170004F7 RID: 1271
// (get) Token: 0x06001BCA RID: 7114 RVA: 0x00067F34 File Offset: 0x00066134
public FlowControl FlowControl
{
get
{
return (FlowControl)this.flow;
}
}
/// <summary>How the Microsoft intermediate language (MSIL) instruction pops the stack.</summary>
/// <returns>Read-only. The way the MSIL instruction pops the stack.</returns>
// Token: 0x170004F8 RID: 1272
// (get) Token: 0x06001BCB RID: 7115 RVA: 0x00067F3C File Offset: 0x0006613C
public StackBehaviour StackBehaviourPop
{
get
{
return (StackBehaviour)this.pop;
}
}
/// <summary>How the Microsoft intermediate language (MSIL) instruction pushes operand onto the stack.</summary>
/// <returns>Read-only. The way the MSIL instruction pushes operand onto the stack.</returns>
// Token: 0x170004F9 RID: 1273
// (get) Token: 0x06001BCC RID: 7116 RVA: 0x00067F44 File Offset: 0x00066144
public StackBehaviour StackBehaviourPush
{
get
{
return (StackBehaviour)this.push;
}
}
/// <summary>The value of the immediate operand of the Microsoft intermediate language (MSIL) instruction.</summary>
/// <returns>Read-only. The value of the immediate operand of the MSIL instruction.</returns>
// Token: 0x170004FA RID: 1274
// (get) Token: 0x06001BCD RID: 7117 RVA: 0x00067F4C File Offset: 0x0006614C
public short Value
{
get
{
if (this.size == 1)
{
return (short)this.op2;
}
return (short)(((int)this.op1 << 8) | (int)this.op2);
}
}
/// <summary>Indicates whether two <see cref="T:System.Reflection.Emit.OpCode" /> structures are equal.</summary>
/// <returns>true if <paramref name="a" /> is equal to <paramref name="b" />; otherwise, false.</returns>
/// <param name="a">The <see cref="T:System.Reflection.Emit.OpCode" /> to compare to <paramref name="b" />.</param>
/// <param name="b">The <see cref="T:System.Reflection.Emit.OpCode" /> to compare to <paramref name="a" />.</param>
// Token: 0x06001BCE RID: 7118 RVA: 0x00067F74 File Offset: 0x00066174
public static bool operator ==(OpCode a, OpCode b)
{
return a.op1 == b.op1 && a.op2 == b.op2;
}
/// <summary>Indicates whether two <see cref="T:System.Reflection.Emit.OpCode" /> structures are not equal.</summary>
/// <returns>true if <paramref name="a" /> is not equal to <paramref name="b" />; otherwise, false.</returns>
/// <param name="a">The <see cref="T:System.Reflection.Emit.OpCode" /> to compare to <paramref name="b" />.</param>
/// <param name="b">The <see cref="T:System.Reflection.Emit.OpCode" /> to compare to <paramref name="a" />.</param>
// Token: 0x06001BCF RID: 7119 RVA: 0x00067FA8 File Offset: 0x000661A8
public static bool operator !=(OpCode a, OpCode b)
{
return a.op1 != b.op1 || a.op2 != b.op2;
}
// Token: 0x0400084F RID: 2127
internal byte op1;
// Token: 0x04000850 RID: 2128
internal byte op2;
// Token: 0x04000851 RID: 2129
private byte push;
// Token: 0x04000852 RID: 2130
private byte pop;
// Token: 0x04000853 RID: 2131
private byte size;
// Token: 0x04000854 RID: 2132
private byte type;
// Token: 0x04000855 RID: 2133
private byte args;
// Token: 0x04000856 RID: 2134
private byte flow;
}
}