protected override void Setup() { if (TypeLayout.NativePointerSize == 4) NativePatchType = PatchType.I4; else NativePatchType = PatchType.I8; }
private static byte GetPatchTypeSize(PatchType patchType) { switch (patchType) { case PatchType.I4: return(32); case PatchType.I8: return(64); default: throw new CompilerException("unknown patch type: " + patchType.ToString()); } }
/// <summary> /// Initializes a new instance of LinkRequest. /// </summary> /// <param name="linkType">Type of the link.</param> /// <param name="patchType">Type of the patch.</param> /// <param name="patchSymbol">The patch symbol.</param> /// <param name="patchOffset">The patch offset.</param> /// <param name="referenceSymbol">The reference symbol.</param> /// <param name="referenceOffset">The reference offset.</param> /// public LinkRequest(LinkType linkType, PatchType patchType, LinkerSymbol patchSymbol, int patchOffset, LinkerSymbol referenceSymbol, int referenceOffset) { Debug.Assert(patchSymbol != null); Debug.Assert(referenceSymbol != null); LinkType = linkType; PatchType = patchType; PatchSymbol = patchSymbol; PatchOffset = patchOffset; ReferenceSymbol = referenceSymbol; ReferenceOffset = referenceOffset; }
/// <summary> /// Initializes a new instance of LinkRequest. /// </summary> /// <param name="linkType">Type of the link.</param> /// <param name="patchType">Type of the patch.</param> /// <param name="patchSymbol">The patch symbol.</param> /// <param name="patchOffset">The patch offset.</param> /// <param name="relativeBase">The relative base.</param> /// <param name="referenceSymbol">The reference symbol.</param> /// <param name="referenceOffset">The reference offset.</param> public LinkRequest(LinkType linkType, PatchType patchType, LinkerSymbol patchSymbol, int patchOffset, int relativeBase, LinkerSymbol referenceSymbol, int referenceOffset) { Debug.Assert(patchSymbol != null); Debug.Assert(referenceSymbol != null); Debug.Assert(patchType != null); this.LinkType = linkType; this.PatchType = patchType; this.PatchSymbol = patchSymbol; this.PatchOffset = patchOffset; this.RelativeBase = relativeBase; this.ReferenceSymbol = referenceSymbol; this.ReferenceOffset = referenceOffset; }
protected override void Run() { if (!HasProtectedRegions) return; ProtectedRegion.FinalizeAll(BasicBlocks, MethodCompiler.ProtectedRegions); codeEmitter = MethodCompiler.Pipeline.FindFirst<CodeGenerationStage>().CodeEmitter; if (TypeLayout.NativePointerSize == 4) NativePatchType = BuiltInPatch.I4; else NativePatchType = BuiltInPatch.I8; EmitProtectedRegionTable(); }
public void Link(LinkType linkType, PatchType patchType, LinkerSymbol patchSymbol, int patchOffset, int relativeBase, string referenceSymbol, SectionKind patchRelativeBase, int referenceOffset) { var referenceObject = GetSymbol(referenceSymbol, patchRelativeBase); Link(linkType, patchType, patchSymbol, patchOffset, relativeBase, referenceObject, referenceOffset); }
public void Link(LinkType linkType, PatchType patchType, string patchSymbol, SectionKind patchKind, int patchOffset, int relativeBase, string referenceSymbol, SectionKind referenceKind, int referenceOffset) { var referenceObject = GetSymbol(referenceSymbol, referenceKind); var patchObject = GetSymbol(patchSymbol, patchKind); Link(linkType, patchType, patchObject, patchOffset, relativeBase, referenceObject, referenceOffset); }
public void Link(LinkType linkType, PatchType patchType, LinkerSymbol patchSymbol, int patchOffset, int relativeBase, LinkerSymbol referenceSymbol, int referenceOffset) { lock (mylock) { var linkRequest = new LinkRequest(linkType, patchType, patchSymbol, patchOffset, relativeBase, referenceSymbol, referenceOffset); //LinkRequests.Add(linkRequest); patchSymbol.AddPatch(linkRequest); } }
public void Link(LinkType linkType, PatchType patchType, string patchSymbolName, SectionKind patchKind, int patchOffset, int relativeBase, LinkerSymbol referenceSymbol, int referenceOffset) { var patchObject = GetSymbol(patchSymbolName, patchKind); Link(linkType, patchType, patchObject, patchOffset, relativeBase, referenceSymbol, referenceOffset); }
public void Link(LinkType linkType, PatchType patchType, LinkerSymbol patchSymbol, int patchOffset, SectionKind referenceKind, string referenceSymbolName, int referenceOffset) { var referenceObject = GetSymbol(referenceSymbolName, referenceKind); Link(linkType, patchType, patchSymbol, patchOffset, referenceObject, referenceOffset); }
private static byte GetPatchTypeSize(PatchType patchType) { switch (patchType) { case PatchType.I4: return 32; case PatchType.I8: return 64; default: throw new CompilerException("unknown patch type: " + patchType.ToString()); } }
public void Link(LinkType linkType, PatchType patchType, SectionKind patchKind, string patchSymbolName, int patchOffset, LinkerSymbol referenceSymbol, int referenceOffset) { var patchObject = GetSymbol(patchSymbolName, patchKind); Link(linkType, patchType, patchObject, patchOffset, referenceSymbol, referenceOffset); }