ToString() public method

public ToString ( ) : string
return string
Esempio n. 1
0
 public void Emit(OpCode opCode)
 {
     _sourceCodeWriter.MarkAndWriteLine(_ilGenerator, opCode.ToString());
     _ilGenerator.Emit(opCode);
 }
Esempio n. 2
0
 private void Emit(OpCode opcode)
 {
     il.Emit(opcode);
     #if DEBUG_COMPILE
     Helpers.DebugWriteLine(opcode.ToString());
     #endif
 }
Esempio n. 3
0
        /// <summary>
        /// Emits a managed indirect call instruction.
        /// </summary>
        public override void EmitCalli(OpCode opcode, CallingConventions callingConvention, Type returnType, Type[] parameterTypes, Type[] optionalParameterTypes) {
            StringBuilder sb = new StringBuilder();
            sb.Append(opcode.ToString());
            sb.Append('\t');
            sb.Append(callingConvention.ToString());
            sb.Append(' ');
            sb.Append(returnType.FormatTypeName());
            sb.Append('(');
            AppendTypeNames(sb, parameterTypes);
            sb.Append(") [(");
            AppendTypeNames(sb, optionalParameterTypes);
            sb.Append(")]");

            Write(sb.ToString());

            base.EmitCalli(opcode, callingConvention, returnType, parameterTypes, optionalParameterTypes);
        }
Esempio n. 4
0
 private static string FormatOpCode(OpCode opCode)
 {
     return opCode.ToString().ToLower().Replace('_', '.');
 }
Esempio n. 5
0
        /// <summary>
        /// Emits an unmanaged indirect call instruction.
        /// </summary>
        public override void EmitCalli(OpCode opcode, CallingConvention unmanagedCallConv, Type returnType, Type[] parameterTypes) {
            StringBuilder sb = new StringBuilder();
            sb.Append(opcode.ToString());
            sb.Append('\t');
            sb.Append(unmanagedCallConv.ToString());
            sb.Append(' ');
            sb.Append(returnType.FormatTypeName());
            sb.Append('(');
            AppendTypeNames(sb, parameterTypes);
            sb.Append(')');

            Write(sb.ToString());

            base.EmitCalli(opcode, unmanagedCallConv, returnType, parameterTypes);
        }
Esempio n. 6
0
        /// <summary>
        /// Emits an instruction with multiple target labels (switch).
        /// </summary>
        public override void Emit(OpCode opcode, Label[] labels) {
            StringBuilder sb = new StringBuilder();
            sb.Append(opcode.ToString());
            sb.Append("\t[");
            for (int i = 0; i < labels.Length; i++) {
                if (i != 0) {
                    sb.Append(", ");
                }
                sb.Append("label_" + GetLabelId(labels[i]).ToString(CultureInfo.CurrentCulture));
            }
            sb.Append("]");

            Write(sb.ToString());

            base.Emit(opcode, labels);
        }
Esempio n. 7
0
 /// <summary>
 /// Emits an instruction.
 /// </summary>
 public override void Emit(OpCode opcode)
 {
     Write(opcode.ToString());
     base.Emit(opcode);
 }
Esempio n. 8
0
		/// <summary>Adds the specified instruction into the IL.</summary>
		/// <param name="opcode">The instruction to add.</param>
		public void Emit(OpCode opcode){
			#if ildebug
				Output(opcode.ToString());
			#endif
			Generator.Emit(opcode);
		}
        private void ProcessCommand(OpCode opCode, int addStack, string comment)
        {
			
            int stackChange = 
                GetStackChange(opCode.StackBehaviourPop) + 
                GetStackChange(opCode.StackBehaviourPush) +
                addStack;

            stackCount += stackChange;
            WriteOutputCommand(opCode.ToString() + " " + comment);
        }