public override void Linearize(Stack <IRStackObject> pStack) { switch (BranchCondition) { case IRBranchCondition.Always: //if (pStack.Count > 0) //{ // int sd = Method.StackDepths.Pop(); // while (pStack.Count > sd) // pStack.Pop(); //} break; case IRBranchCondition.False: case IRBranchCondition.True: Sources.Add(new IRLinearizedLocation(pStack.Pop().LinearizedTarget)); break; case IRBranchCondition.Equal: case IRBranchCondition.GreaterOrEqual: case IRBranchCondition.GreaterOrEqualUnsigned: case IRBranchCondition.Greater: case IRBranchCondition.GreaterUnsigned: case IRBranchCondition.LessOrEqual: case IRBranchCondition.LessOrEqualUnsigned: case IRBranchCondition.Less: case IRBranchCondition.LessUnsigned: case IRBranchCondition.NotEqualUnsigned: { IRStackObject value2 = pStack.Pop(); IRStackObject value1 = pStack.Pop(); Sources.Add(new IRLinearizedLocation(value1.LinearizedTarget)); Sources.Add(new IRLinearizedLocation(value2.LinearizedTarget)); break; } } }
public override void Linearize(Stack <IRStackObject> pStack) { for (int count = 0; count < Target.Parameters.Count; ++count) { Sources.Add(new IRLinearizedLocation(pStack.Pop().LinearizedTarget)); } if (Target.ReturnType != null) { IRStackObject returned = new IRStackObject(); IRType retType = Target.ReturnType; if (retType.IsTemporaryVar) { retType = Target.ParentType.GenericParameters[retType.TemporaryVarOrMVarIndex]; } else if (retType.IsTemporaryMVar) { retType = Target.GenericParameters[retType.TemporaryVarOrMVarIndex]; } returned.Type = retType; returned.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); returned.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, retType); Destination = new IRLinearizedLocation(returned.LinearizedTarget); pStack.Push(returned); } }
public override void Linearize(Stack <IRStackObject> pStack) { IRStackObject srcAddr = pStack.Pop(); IRStackObject destAddr = pStack.Pop(); Sources.Add(new IRLinearizedLocation(destAddr.LinearizedTarget)); Sources.Add(new IRLinearizedLocation(srcAddr.LinearizedTarget)); }
public override void Linearize(Stack<IRStackObject> pStack) { IRStackObject result = new IRStackObject(); result.Type = ParentMethod.Assembly.AppDomain.System_RuntimeArgumentHandle; result.LinearizedTarget = new IRLinearizedLocation(this, IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, ParentMethod.Assembly.AppDomain.System_RuntimeArgumentHandle); Destination = new IRLinearizedLocation(this, result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack<IRStackObject> pStack) { Sources.Add(new IRLinearizedLocation(this, pStack.Pop().LinearizedTarget)); IRStackObject result = new IRStackObject(); result.Type = TargetType; result.LinearizedTarget = new IRLinearizedLocation(this, IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, TargetType); Destination = new IRLinearizedLocation(this, result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack<IRStackObject> pStack) { Sources.Add(new IRLinearizedLocation(pStack.Pop().LinearizedTarget)); IRStackObject result = new IRStackObject(); result.Type = ParentMethod.Assembly.AppDomain.System_TypedReference; result.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, ParentMethod.Assembly.AppDomain.System_TypedReference); Destination = new IRLinearizedLocation(result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack <IRStackObject> pStack) { Sources.Add(new IRLinearizedLocation(pStack.Pop().LinearizedTarget)); IRStackObject result = new IRStackObject(); result.Type = ParentMethod.Assembly.AppDomain.System_TypedReference; result.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, ParentMethod.Assembly.AppDomain.System_TypedReference); Destination = new IRLinearizedLocation(result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack<IRStackObject> pStack) { // Skip first parameter source, it is the 'this' reference that is put on the stack by newobj before constructor call for (int count = 1; count < Constructor.Parameters.Count; ++count) Sources.Add(new IRLinearizedLocation(pStack.Pop().LinearizedTarget)); IRStackObject result = new IRStackObject(); result.Type = Constructor.ParentType; result.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, Constructor.ParentType); Destination = new IRLinearizedLocation(result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack<IRStackObject> pStack) { IRStackObject value = pStack.Pop(); Sources.Add(new IRLinearizedLocation(value.LinearizedTarget)); IRStackObject result = new IRStackObject(); result.Type = value.Type; result.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, value.Type); Destination = new IRLinearizedLocation(result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack <IRStackObject> pStack) { Sources.Add(new IRLinearizedLocation(pStack.Pop().LinearizedTarget)); IRStackObject result = new IRStackObject(); result.Type = Type; result.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, Type); Destination = new IRLinearizedLocation(result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack<IRStackObject> pStack) { Sources.Add(new IRLinearizedLocation(this, pStack.Pop().LinearizedTarget)); IRType arrayType = ParentMethod.Assembly.AppDomain.GetArrayType(ElementType); IRStackObject result = new IRStackObject(); result.Type = arrayType; result.LinearizedTarget = new IRLinearizedLocation(this, IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, arrayType); Destination = new IRLinearizedLocation(this, result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack<IRStackObject> pStack) { IRLinearizedLocation source = new IRLinearizedLocation(this, IRLinearizedLocationType.ArrayLength); source.ArrayLength.ArrayLocation = new IRLinearizedLocation(this, pStack.Pop().LinearizedTarget); Sources.Add(source); IRStackObject result = new IRStackObject(); result.Type = ParentMethod.Assembly.AppDomain.System_Int32; result.LinearizedTarget = new IRLinearizedLocation(this, IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, ParentMethod.Assembly.AppDomain.System_Int32); Destination = new IRLinearizedLocation(this, result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack<IRStackObject> pStack) { Sources.Add(new IRLinearizedLocation(this, pStack.Pop().LinearizedTarget)); IRType resultType = Type; if (!GetValue) resultType = ParentMethod.Assembly.AppDomain.GetUnmanagedPointerType(Type); IRStackObject result = new IRStackObject(); result.Type = resultType; result.LinearizedTarget = new IRLinearizedLocation(this, IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, resultType); Destination = new IRLinearizedLocation(this, result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack<IRStackObject> pStack) { IRLinearizedLocation source = new IRLinearizedLocation(IRLinearizedLocationType.LocalAddress); source.LocalAddress.LocalIndex = LocalIndex; Sources.Add(source); IRStackObject result = new IRStackObject(); result.Type = ParentMethod.Assembly.AppDomain.System_IntPtr; result.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, ParentMethod.Assembly.AppDomain.System_IntPtr); Destination = new IRLinearizedLocation(result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack<IRStackObject> pStack) { IRLinearizedLocation source = new IRLinearizedLocation(IRLinearizedLocationType.StaticField); source.StaticField.Field = Field; Sources.Add(source); IRStackObject result = new IRStackObject(); result.Type = Field.Type; result.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, Field.Type); Destination = new IRLinearizedLocation(result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack<IRStackObject> pStack) { IRLinearizedLocation value = new IRLinearizedLocation(IRLinearizedLocationType.String); value.String.Value = Value; Sources.Add(value); IRStackObject result = new IRStackObject(); result.Type = ParentMethod.Assembly.AppDomain.System_String; result.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, ParentMethod.Assembly.AppDomain.System_String); Destination = new IRLinearizedLocation(result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack<IRStackObject> pStack) { IRLinearizedLocation source = new IRLinearizedLocation(this, IRLinearizedLocationType.Local); source.Local.LocalIndex = LocalIndex; Sources.Add(source); IRStackObject result = new IRStackObject(); result.Type = ParentMethod.Locals[(int)LocalIndex].Type; result.LinearizedTarget = new IRLinearizedLocation(this, IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, ParentMethod.Locals[(int)LocalIndex].Type); Destination = new IRLinearizedLocation(this, result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack<IRStackObject> pStack) { IRLinearizedLocation value = new IRLinearizedLocation(IRLinearizedLocationType.FunctionAddress); value.FunctionAddress.Method = Target; value.FunctionAddress.Virtual = Virtual; Sources.Add(value); IRStackObject result = new IRStackObject(); result.Type = ParentMethod.Assembly.AppDomain.System_IntPtr; result.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, ParentMethod.Assembly.AppDomain.System_IntPtr); Destination = new IRLinearizedLocation(result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack<IRStackObject> pStack) { IRLinearizedLocation source = new IRLinearizedLocation(IRLinearizedLocationType.Indirect); source.Indirect.Type = Type; source.Indirect.AddressLocation = new IRLinearizedLocation(pStack.Pop().LinearizedTarget); Sources.Add(source); IRStackObject result = new IRStackObject(); result.Type = Type; result.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, Type); Destination = new IRLinearizedLocation(result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack <IRStackObject> pStack) { IRLinearizedLocation source = new IRLinearizedLocation(IRLinearizedLocationType.Parameter); source.Parameter.ParameterIndex = ParameterIndex; Sources.Add(source); IRStackObject result = new IRStackObject(); result.Type = ParentMethod.Parameters[(int)ParameterIndex].Type; result.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, ParentMethod.Parameters[(int)ParameterIndex].Type); Destination = new IRLinearizedLocation(result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack <IRStackObject> pStack) { IRLinearizedLocation source = new IRLinearizedLocation(IRLinearizedLocationType.ParameterAddress); source.ParameterAddress.ParameterIndex = ParameterIndex; Sources.Add(source); IRStackObject result = new IRStackObject(); result.Type = ParentMethod.Assembly.AppDomain.System_IntPtr; result.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, ParentMethod.Assembly.AppDomain.System_IntPtr); Destination = new IRLinearizedLocation(result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack <IRStackObject> pStack) { IRLinearizedLocation value = new IRLinearizedLocation(IRLinearizedLocationType.SizeOf); value.SizeOf.Type = Type; Sources.Add(value); IRStackObject result = new IRStackObject(); result.Type = ParentMethod.Assembly.AppDomain.System_UInt32; result.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, ParentMethod.Assembly.AppDomain.System_UInt32); Destination = new IRLinearizedLocation(result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack <IRStackObject> pStack) { IRStackObject value = pStack.Peek(); Sources.Add(new IRLinearizedLocation(value.LinearizedTarget)); IRStackObject result = new IRStackObject(); result.Type = value.Type; result.BoxedType = value.BoxedType; result.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, value.Type); Destination = new IRLinearizedLocation(result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack <IRStackObject> pStack) { IRLinearizedLocation source = new IRLinearizedLocation(IRLinearizedLocationType.ArrayLength); source.ArrayLength.ArrayLocation = new IRLinearizedLocation(pStack.Pop().LinearizedTarget); Sources.Add(source); IRStackObject result = new IRStackObject(); result.Type = ParentMethod.Assembly.AppDomain.System_Int32; result.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, ParentMethod.Assembly.AppDomain.System_Int32); Destination = new IRLinearizedLocation(result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack <IRStackObject> pStack) { IRLinearizedLocation source = new IRLinearizedLocation(IRLinearizedLocationType.StaticField); source.StaticField.Field = Field; Sources.Add(source); IRStackObject result = new IRStackObject(); result.Type = Field.Type; result.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, Field.Type); Destination = new IRLinearizedLocation(result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack<IRStackObject> pStack) { IRStackObject shiftAmount = pStack.Pop(); IRStackObject value = pStack.Pop(); Sources.Add(new IRLinearizedLocation(value.LinearizedTarget)); Sources.Add(new IRLinearizedLocation(shiftAmount.LinearizedTarget)); IRType resultType = ParentMethod.Assembly.AppDomain.ShiftNumericResult(value.Type, shiftAmount.Type); IRStackObject result = new IRStackObject(); result.Type = resultType; result.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, resultType); Destination = new IRLinearizedLocation(result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack<IRStackObject> pStack) { for (int count = 0; count < Target.Parameters.Count; ++count) Sources.Add(new IRLinearizedLocation(this, pStack.Pop().LinearizedTarget)); if (Target.ReturnType != null) { IRStackObject returned = new IRStackObject(); IRType retType = ResolveSimpleReturn(Target.ReturnType, Target); returned.Type = retType; returned.LinearizedTarget = new IRLinearizedLocation(this, IRLinearizedLocationType.Local); returned.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, retType); Destination = new IRLinearizedLocation(this, returned.LinearizedTarget); pStack.Push(returned); } }
public override void Linearize(Stack <IRStackObject> pStack) { // Skip first parameter source, it is the 'this' reference that is put on the stack by newobj before constructor call for (int count = 1; count < Constructor.Parameters.Count; ++count) { Sources.Add(new IRLinearizedLocation(pStack.Pop().LinearizedTarget)); } IRStackObject result = new IRStackObject(); result.Type = Constructor.ParentType; result.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, Constructor.ParentType); Destination = new IRLinearizedLocation(result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack<IRStackObject> pStack) { IRStackObject value2 = pStack.Pop(); IRStackObject value1 = pStack.Pop(); Sources.Add(new IRLinearizedLocation(this, value1.LinearizedTarget)); Sources.Add(new IRLinearizedLocation(this, value2.LinearizedTarget)); IRType resultType = ParentMethod.Assembly.AppDomain.BinaryNumericResult(value1.Type, value2.Type); IRStackObject result = new IRStackObject(); result.Type = resultType; result.LinearizedTarget = new IRLinearizedLocation(this, IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, resultType); Destination = new IRLinearizedLocation(this, result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack <IRStackObject> pStack) { IRLinearizedLocation value = new IRLinearizedLocation(IRLinearizedLocationType.FunctionAddress); value.FunctionAddress.Method = Target; value.FunctionAddress.Virtual = Virtual; Sources.Add(value); IRStackObject result = new IRStackObject(); result.Type = ParentMethod.Assembly.AppDomain.System_IntPtr; result.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, ParentMethod.Assembly.AppDomain.System_IntPtr); Destination = new IRLinearizedLocation(result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack <IRStackObject> pStack) { IRStackObject value2 = pStack.Pop(); IRStackObject value1 = pStack.Pop(); Sources.Add(new IRLinearizedLocation(value1.LinearizedTarget)); Sources.Add(new IRLinearizedLocation(value2.LinearizedTarget)); IRType resultType = ParentMethod.Assembly.AppDomain.BinaryNumericResult(value1.Type, value2.Type); IRStackObject result = new IRStackObject(); result.Type = resultType; result.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, resultType); Destination = new IRLinearizedLocation(result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack <IRStackObject> pStack) { Sources.Add(new IRLinearizedLocation(pStack.Pop().LinearizedTarget)); IRType resultType = Type; if (!Value) { resultType = ParentMethod.Assembly.AppDomain.GetPointerType(Type); } IRStackObject result = new IRStackObject(); result.Type = resultType; result.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, resultType); Destination = new IRLinearizedLocation(result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack<IRStackObject> pStack) { IRLinearizedLocation source = new IRLinearizedLocation(IRLinearizedLocationType.ArrayElement); source.ArrayElement.IndexLocation = new IRLinearizedLocation(pStack.Pop().LinearizedTarget); var arraySource = pStack.Pop(); source.ArrayElement.ArrayLocation = new IRLinearizedLocation(arraySource.LinearizedTarget); if (Type == null) { Type = arraySource.Type.ArrayType; } source.ArrayElement.ElementType = Type; Sources.Add(source); IRStackObject result = new IRStackObject(); result.Type = Type; result.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, Type); Destination = new IRLinearizedLocation(result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack<IRStackObject> pStack) { for (int count = 0; count < Target.Parameters.Count; ++count) Sources.Add(new IRLinearizedLocation(pStack.Pop().LinearizedTarget)); if (Target.ReturnType != null) { IRStackObject returned = new IRStackObject(); IRType retType = Target.ReturnType; if (retType.IsTemporaryVar) retType = Target.ParentType.GenericParameters[retType.TemporaryVarOrMVarIndex]; else if (retType.IsTemporaryMVar) retType = Target.GenericParameters[retType.TemporaryVarOrMVarIndex]; returned.Type = retType; returned.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); returned.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, retType); Destination = new IRLinearizedLocation(returned.LinearizedTarget); pStack.Push(returned); } }
public override void Linearize(Stack<IRStackObject> pStack) { IRLinearizedLocation source = new IRLinearizedLocation(this, IRLinearizedLocationType.ArrayElementAddress); source.ArrayElementAddress.IndexLocation = new IRLinearizedLocation(this, pStack.Pop().LinearizedTarget); var arraySource = pStack.Pop(); source.ArrayElementAddress.ArrayLocation = new IRLinearizedLocation(this, arraySource.LinearizedTarget); if (Type == null) { Type = arraySource.Type.ArrayElementType; } if (Type == null) throw new Exception(); source.ArrayElementAddress.ElementType = Type; Sources.Add(source); IRStackObject result = new IRStackObject(); result.Type = ParentMethod.Assembly.AppDomain.System_IntPtr; result.LinearizedTarget = new IRLinearizedLocation(this, IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, ParentMethod.Assembly.AppDomain.System_IntPtr); Destination = new IRLinearizedLocation(this, result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack<IRStackObject> pStack) { IRType handleType = null; if (TargetType != null) handleType = ParentMethod.Assembly.AppDomain.System_RuntimeTypeHandle; else if (TargetMethod != null) handleType = ParentMethod.Assembly.AppDomain.System_RuntimeMethodHandle; else if (TargetField != null) handleType = ParentMethod.Assembly.AppDomain.System_RuntimeFieldHandle; else throw new NullReferenceException(); IRLinearizedLocation value = new IRLinearizedLocation(IRLinearizedLocationType.RuntimeHandle); value.RuntimeHandle.HandleType = handleType; value.RuntimeHandle.TargetType = TargetType; value.RuntimeHandle.TargetMethod = TargetMethod; value.RuntimeHandle.TargetField = TargetField; Sources.Add(value); IRStackObject result = new IRStackObject(); result.Type = handleType; result.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, handleType); Destination = new IRLinearizedLocation(result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack<IRStackObject> pStack) { IRLinearizedLocation source = new IRLinearizedLocation(this, IRLinearizedLocationType.Indirect); var addressLocation = pStack.Pop(); source.Indirect.AddressLocation = new IRLinearizedLocation(this, addressLocation.LinearizedTarget); if (Type == null) { if (addressLocation.Type.IsManagedPointerType) Type = addressLocation.Type.ManagedPointerType; else Type = addressLocation.Type.UnmanagedPointerType; } if (Type == null) throw new Exception(); source.Indirect.Type = Type; Sources.Add(source); IRStackObject result = new IRStackObject(); result.Type = Type; result.LinearizedTarget = new IRLinearizedLocation(this, IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, Type); Destination = new IRLinearizedLocation(this, result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack <IRStackObject> pStack) { IRLinearizedLocation source = new IRLinearizedLocation(IRLinearizedLocationType.ArrayElement); source.ArrayElement.IndexLocation = new IRLinearizedLocation(pStack.Pop().LinearizedTarget); var arraySource = pStack.Pop(); source.ArrayElement.ArrayLocation = new IRLinearizedLocation(arraySource.LinearizedTarget); if (Type == null) { Type = arraySource.Type.ArrayType; } source.ArrayElement.ElementType = Type; Sources.Add(source); IRStackObject result = new IRStackObject(); result.Type = Type; result.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, Type); Destination = new IRLinearizedLocation(result.LinearizedTarget); pStack.Push(result); }
public override void Linearize(Stack <IRStackObject> pStack) { IRType handleType = null; if (TargetType != null) { handleType = ParentMethod.Assembly.AppDomain.System_RuntimeTypeHandle; } else if (TargetMethod != null) { handleType = ParentMethod.Assembly.AppDomain.System_RuntimeMethodHandle; } else if (TargetField != null) { handleType = ParentMethod.Assembly.AppDomain.System_RuntimeFieldHandle; } else { throw new NullReferenceException(); } IRLinearizedLocation value = new IRLinearizedLocation(IRLinearizedLocationType.RuntimeHandle); value.RuntimeHandle.HandleType = handleType; value.RuntimeHandle.TargetType = TargetType; value.RuntimeHandle.TargetMethod = TargetMethod; value.RuntimeHandle.TargetField = TargetField; Sources.Add(value); IRStackObject result = new IRStackObject(); result.Type = handleType; result.LinearizedTarget = new IRLinearizedLocation(IRLinearizedLocationType.Local); result.LinearizedTarget.Local.LocalIndex = AddLinearizedLocal(pStack, handleType); Destination = new IRLinearizedLocation(result.LinearizedTarget); pStack.Push(result); }