コード例 #1
0
ファイル: MetadataStage.cs プロジェクト: Zahovay/MOSA-Project
 protected override void Setup()
 {
     if (TypeLayout.NativePointerSize == 4)
         NativePatchType = PatchType.I4;
     else
         NativePatchType = PatchType.I8;
 }
コード例 #2
0
        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());
            }
        }
コード例 #3
0
ファイル: LinkRequest.cs プロジェクト: tgiphil/MOSA-Project
        /// <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;
        }
コード例 #4
0
        /// <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;
        }
コード例 #5
0
        /// <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;
        }
コード例 #6
0
        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();
        }
コード例 #7
0
ファイル: LinkRequest.cs プロジェクト: Boddlnagg/MOSA-Project
        /// <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;
        }
コード例 #8
0
        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);
        }
コード例 #9
0
ファイル: BaseLinker.cs プロジェクト: pacificIT/MOSA-Project
        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);
        }
コード例 #10
0
ファイル: BaseLinker.cs プロジェクト: pacificIT/MOSA-Project
        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);
        }
コード例 #11
0
ファイル: BaseLinker.cs プロジェクト: pacificIT/MOSA-Project
 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);
     }
 }
コード例 #12
0
        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);
        }
コード例 #13
0
ファイル: BaseLinker.cs プロジェクト: mlintell/MOSA-Project
        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);
        }
コード例 #14
0
 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());
     }
 }
コード例 #15
0
ファイル: BaseLinker.cs プロジェクト: tgiphil/MOSA-Project
        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);
        }
コード例 #16
0
ファイル: BaseLinker.cs プロジェクト: tgiphil/MOSA-Project
        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);
        }