internal OpCode(string stringname, StackBehaviour pop, StackBehaviour push, System.Reflection.Emit.OperandType operand, System.Reflection.Emit.OpCodeType type, int size, byte s1, byte s2, System.Reflection.Emit.FlowControl ctrl, bool endsjmpblk, int stack)
 {
     this.m_stringname = stringname;
     this.m_pop = pop;
     this.m_push = push;
     this.m_operand = operand;
     this.m_type = type;
     this.m_size = size;
     this.m_s1 = s1;
     this.m_s2 = s2;
     this.m_ctrl = ctrl;
     this.m_endsUncondJmpBlk = endsjmpblk;
     this.m_stackChange = stack;
 }
Beispiel #2
0
 internal OpCode(string stringname, StackBehaviour pop, StackBehaviour push, System.Reflection.Emit.OperandType operand, System.Reflection.Emit.OpCodeType type, int size, byte s1, byte s2, System.Reflection.Emit.FlowControl ctrl, bool endsjmpblk, int stack)
 {
     this.m_stringname       = stringname;
     this.m_pop              = pop;
     this.m_push             = push;
     this.m_operand          = operand;
     this.m_type             = type;
     this.m_size             = size;
     this.m_s1               = s1;
     this.m_s2               = s2;
     this.m_ctrl             = ctrl;
     this.m_endsUncondJmpBlk = endsjmpblk;
     this.m_stackChange      = stack;
 }
        public int Compute(IMethodBody body)
        {
            int cyclo = 0;

            foreach (IInstruction instruction in body.Instructions)
            {
                System.Reflection.Emit.FlowControl flow =
                    this.flowConverter.Convert(instruction.Code);
                if (flow == System.Reflection.Emit.FlowControl.Cond_Branch)
                {
                    cyclo++;
                }
            }

            return(cyclo + 1);
        }