Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/X86Emitter.cs')
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/X86Emitter.cs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/X86Emitter.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/X86Emitter.cs
index cd95c3cbcf0..e386e9a34da 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/X86Emitter.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/X86Emitter.cs
@@ -118,7 +118,7 @@ namespace ILCompiler.DependencyAnalysis.X86
Builder.EmitByte(0xC3);
}
- private bool InSignedByteRange(int i)
+ private static bool InSignedByteRange(int i)
{
return i == (int)(sbyte)i;
}
@@ -157,8 +157,7 @@ namespace ILCompiler.DependencyAnalysis.X86
{
byte lowOrderBitsOfBaseReg = (byte)((int)addrMode.BaseReg & 0x07);
modRM |= lowOrderBitsOfBaseReg;
- int offsetSize = 0;
-
+ int offsetSize;
if (addrMode.Offset == 0 && (lowOrderBitsOfBaseReg != (byte)Register.EBP))
{
offsetSize = 0;
@@ -208,7 +207,7 @@ namespace ILCompiler.DependencyAnalysis.X86
{
modRM = (byte)((modRM & 0xF8) | (int)Register.ESP);
Builder.EmitByte(modRM);
- int indexRegAsInt = (int)(addrMode.IndexReg.HasValue ? addrMode.IndexReg.Value : Register.ESP);
+ int indexRegAsInt = (int)(addrMode.IndexReg ?? Register.ESP);
Builder.EmitByte((byte)((addrMode.Scale << 6) + ((indexRegAsInt & 0x07) << 3) + ((int)sibByteBaseRegister & 0x07)));
}
EmitImmediate(addrMode.Offset, offsetSize);
@@ -226,7 +225,7 @@ namespace ILCompiler.DependencyAnalysis.X86
Builder.EmitByte((byte)(opcode >> 16));
}
Builder.EmitByte((byte)(opcode >> 8));
- }
+ }
private void EmitIndirInstruction(int opcode, byte subOpcode, ref AddrMode addrMode)
{