Exemple #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));
        }
Exemple #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));
        }
Exemple #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));
        }
Exemple #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));
        }
Exemple #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));
        }
Exemple #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));
        }
Exemple #7
0
 private static void LdToken(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node)
 {
     stack.Push(new TokenExpression((MemberReference)instruction.Operand, instruction));
 }
Exemple #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));
        }
Exemple #9
0
 private static void LdNull(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node)
 {
     stack.Push(new ConstantExpression(null, MetadataType.Object, instruction));
 }
Exemple #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));
        }
Exemple #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));
        }
Exemple #12
0
 private static void ArgList(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node)
 {
     stack.Push(new ArglistExpression(instruction));
 }
Exemple #13
0
 private static void Pop(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node)
 {
     node.AddStatement(new DiscardStatement(Pop(stack), instruction));
 }
Exemple #14
0
 internal void AddLink(Expression expression, SyntaxGraphNode target)
 {
     _outboundLinks.Add(new SyntaxGraphLink(expression, target));
 }
Exemple #15
0
 public SyntaxGraphLink(Expression expression, SyntaxGraphNode target)
 {
     Expression = expression;
     Target     = target;
 }