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)); }
private static void LdLen(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node) { var array = Pop(stack); stack.Push(new ArrayLengthExpression(array, 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 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 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 CastClass(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node) { var value = Pop(stack); stack.Push(new CastExpression(value, (TypeReference)instruction.Operand, instruction)); }
private static void LdToken(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node) { stack.Push(new TokenExpression((MemberReference)instruction.Operand, instruction)); }
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 LdNull(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node) { stack.Push(new ConstantExpression(null, MetadataType.Object, instruction)); }
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)); }
private static void LocAlloc(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node) { var size = Pop(stack); stack.Push(new LocallocExpression(size, instruction)); }
private static void ArgList(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node) { stack.Push(new ArglistExpression(instruction)); }
private static void Pop(MethodVariables variables, Stack <Expression> stack, Instruction instruction, SyntaxGraphNode node) { node.AddStatement(new DiscardStatement(Pop(stack), instruction)); }
internal void AddLink(Expression expression, SyntaxGraphNode target) { _outboundLinks.Add(new SyntaxGraphLink(expression, target)); }
public SyntaxGraphLink(Expression expression, SyntaxGraphNode target) { Expression = expression; Target = target; }