diff options
author | Manu <manu-silicon@users.noreply.github.com> | 2015-11-17 08:59:24 +0300 |
---|---|---|
committer | Manu <manu-silicon@users.noreply.github.com> | 2015-11-18 06:54:57 +0300 |
commit | dca4cf7bb11b9cfb9fff1f3ca9e0e6144a64f09c (patch) | |
tree | a617041738d4f6ffed2d90f44bcdc08221328ed0 /src/JitInterface | |
parent | 6dceb45f10d43ddf2b01f022826d011bdb8f8a0a (diff) |
Defined BlockType an enum which is now used to define the block type of a Relocation or a BlockRelativeTarget.
Diffstat (limited to 'src/JitInterface')
-rw-r--r-- | src/JitInterface/src/CorInfoImpl.cs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/JitInterface/src/CorInfoImpl.cs b/src/JitInterface/src/CorInfoImpl.cs index d9fd2f2f4..e19c034c6 100644 --- a/src/JitInterface/src/CorInfoImpl.cs +++ b/src/JitInterface/src/CorInfoImpl.cs @@ -1989,14 +1989,14 @@ namespace Internal.JitInterface List<Relocation> _relocs; - int findKnownBlock(void *location, out int offset) + BlockType findKnownBlock(void *location, out int offset) { fixed (byte * pCode = _code) { if (pCode <= (byte*)location && (byte*)location < pCode + _code.Length) { offset = (int)((byte*)location - pCode); - return 0; + return BlockType.Code; } } @@ -2007,7 +2007,7 @@ namespace Internal.JitInterface if (pColdCode <= (byte*)location && (byte*)location < pColdCode + _coldCode.Length) { offset = (int)((byte*)location - pColdCode); - return 1; + return BlockType.ColdCode; } } } @@ -2019,13 +2019,13 @@ namespace Internal.JitInterface if (pROData <= (byte*)location && (byte*)location < pROData + _roData.Length) { offset = (int)((byte*)location - pROData); - return 2; + return BlockType.ROData; } } } offset = 0; - return -1; + return BlockType.Unknown; } void recordRelocation(IntPtr _this, void* location, void* target, ushort fRelocType, ushort slotNum, int addlDelta) @@ -2034,13 +2034,13 @@ namespace Internal.JitInterface reloc.RelocType = fRelocType; - int locationBlock = findKnownBlock(location, out reloc.Offset); - Debug.Assert(locationBlock >= 0); - reloc.Block = (sbyte)locationBlock; + BlockType locationBlock = findKnownBlock(location, out reloc.Offset); + Debug.Assert(locationBlock == BlockType.Code || locationBlock == BlockType.ColdCode || locationBlock == BlockType.ROData, "Known block"); + reloc.Block = locationBlock; int targetOffset; - int targetBlock = findKnownBlock(target, out targetOffset); - if (targetBlock < 0) + BlockType targetBlock = findKnownBlock(target, out targetOffset); + if (targetBlock == BlockType.Unknown) { // Reloc points to something outside of the generated blocks reloc.Target = HandleToObject((IntPtr)target); @@ -2050,7 +2050,7 @@ namespace Internal.JitInterface // Target is relative to one of the blocks reloc.Target = new BlockRelativeTarget { - Block = (sbyte)targetBlock, + Block = targetBlock, Offset = targetOffset }; } |