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)); }
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)); }
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)); }
private static void Return(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node) { var value = PopOrDefault(stack); node.AddStatement(new ReturnStatement(value, instruction)); }
private static void Pop(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node) { node.AddStatement(new DiscardStatement(Pop(stack), instruction)); }