Example #1
0
        private static void IsInst(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node)
        {
            var obj = Pop(stack);

            stack.Push(new IsTypeExpression(obj, (TypeReference)instruction.Operand, instruction));
        }
Example #2
0
        private static void LdLen(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node)
        {
            var array = Pop(stack);

            stack.Push(new ArrayLengthExpression(array, instruction));
        }
Example #3
0
        private static void Return(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node)
        {
            var value = PopOrDefault(stack);

            node.AddStatement(new ReturnStatement(value, instruction));
        }
Example #4
0
        private static void StArg(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node)
        {
            var value = Pop(stack);

            node.AddStatement(new StoreParameterStatement((ParameterReference)instruction.Operand, value, instruction));
        }
Example #5
0
        private static void Dup(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node)
        {
            // Store the current value in a temporary, then load it into the stack twice
            var value = Pop(stack);
            var temp  = variables.CreateTemporary();

            node.AddStatement(new StoreTemporaryStatement(temp, value, instruction));
            stack.Push(new TemporaryExpression(temp, instruction));
            stack.Push(new TemporaryExpression(temp, instruction));
        }
Example #6
0
        private static void CastClass(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node)
        {
            var value = Pop(stack);

            stack.Push(new CastExpression(value, (TypeReference)instruction.Operand, instruction));
        }
Example #7
0
 private static void LdToken(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node)
 {
     stack.Push(new TokenExpression((MemberReference)instruction.Operand, instruction));
 }
Example #8
0
        private static void InitObj(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node)
        {
            var addr  = Pop(stack);
            var value = new InitObjExpression((TypeReference)instruction.Operand, instruction);

            node.AddStatement(new StoreIndirectStatement(addr, value, MetadataType.Object, instruction));
        }
Example #9
0
 private static void LdNull(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node)
 {
     stack.Push(new ConstantExpression(null, MetadataType.Object, instruction));
 }
Example #10
0
        private static void LdObj(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node)
        {
            var addr = Pop(stack);

            stack.Push(new DereferenceExpression(addr, (TypeReference)instruction.Operand, instruction));
        }
Example #11
0
        private static void LocAlloc(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node)
        {
            var size = Pop(stack);

            stack.Push(new LocallocExpression(size, instruction));
        }
Example #12
0
 private static void ArgList(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node)
 {
     stack.Push(new ArglistExpression(instruction));
 }
Example #13
0
 private static void Pop(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node)
 {
     node.AddStatement(new DiscardStatement(Pop(stack), instruction));
 }
Example #14
0
 internal void AddLink(Expression expression, SyntaxGraphNode target)
 {
     _outboundLinks.Add(new SyntaxGraphLink(expression, target));
 }
Example #15
0
 public SyntaxGraphLink(Expression expression, SyntaxGraphNode target)
 {
     Expression = expression;
     Target     = target;
 }