Beispiel #1
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));
        }
Beispiel #2
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));
        }
Beispiel #3
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));
        }
Beispiel #4
0
        private static void Return(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node)
        {
            var value = PopOrDefault(stack);

            node.AddStatement(new ReturnStatement(value, instruction));
        }
Beispiel #5
0
 private static void Pop(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node)
 {
     node.AddStatement(new DiscardStatement(Pop(stack), instruction));
 }