Browse Source

Remove MethodImplOptions.AggressiveInlining from trival field accessors

This JIT, particually with tiering enabled, should already be inlining these.
af/merge-core
Jason Nelson 8 years ago
parent
commit
b1578e25be
  1. 9
      src/ImageSharp/ColorSpaces/CieLab.cs
  2. 6
      src/ImageSharp/ColorSpaces/CieLch.cs
  3. 9
      src/ImageSharp/ColorSpaces/CieLchuv.cs
  4. 9
      src/ImageSharp/ColorSpaces/CieLuv.cs
  5. 3
      src/ImageSharp/ColorSpaces/CieXyChromaticityCoordinates.cs
  6. 9
      src/ImageSharp/ColorSpaces/CieXyy.cs
  7. 4
      src/ImageSharp/ColorSpaces/CieXyz.cs
  8. 1
      src/ImageSharp/ColorSpaces/Cmyk.cs
  9. 9
      src/ImageSharp/ColorSpaces/Hsl.cs
  10. 9
      src/ImageSharp/ColorSpaces/HunterLab.cs
  11. 9
      src/ImageSharp/ColorSpaces/LinearRgb.cs
  12. 9
      src/ImageSharp/ColorSpaces/Lms.cs
  13. 9
      src/ImageSharp/ColorSpaces/Rgb.cs
  14. 6
      src/ImageSharp/ColorSpaces/YCbCr.cs

9
src/ImageSharp/ColorSpaces/CieLab.cs

@ -83,11 +83,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <summary>
/// Gets the reference white point of this color
/// </summary>
public CieXyz WhitePoint
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get;
}
public CieXyz WhitePoint { get; }
/// <summary>
/// Gets the lightness dimension.
@ -144,7 +140,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <returns>
/// True if the current left is equal to the <paramref name="right"/> parameter; otherwise, false.
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator ==(CieLab left, CieLab right)
{
return left.Equals(right);
@ -162,7 +157,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <returns>
/// True if the current left is unequal to the <paramref name="right"/> parameter; otherwise, false.
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator !=(CieLab left, CieLab right)
{
return !left.Equals(right);
@ -191,7 +185,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
}
/// <inheritdoc/>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override bool Equals(object obj)
{
return obj is CieLab other && this.Equals(other);

6
src/ImageSharp/ColorSpaces/CieLch.cs

@ -83,11 +83,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <summary>
/// Gets the reference white point of this color
/// </summary>
public CieXyz WhitePoint
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get;
}
public CieXyz WhitePoint { get; }
/// <summary>
/// Gets the lightness dimension.

9
src/ImageSharp/ColorSpaces/CieLchuv.cs

@ -83,11 +83,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <summary>
/// Gets the reference white point of this color
/// </summary>
public CieXyz WhitePoint
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get;
}
public CieXyz WhitePoint { get; }
/// <summary>
/// Gets the lightness dimension.
@ -144,7 +140,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <returns>
/// True if the current left is equal to the <paramref name="right"/> parameter; otherwise, false.
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator ==(CieLchuv left, CieLchuv right)
{
return left.Equals(right);
@ -162,7 +157,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <returns>
/// True if the current left is unequal to the <paramref name="right"/> parameter; otherwise, false.
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator !=(CieLchuv left, CieLchuv right)
{
return !left.Equals(right);
@ -191,7 +185,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
}
/// <inheritdoc/>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override bool Equals(object obj)
{
return obj is CieLchuv other && this.Equals(other);

9
src/ImageSharp/ColorSpaces/CieLuv.cs

@ -85,11 +85,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <summary>
/// Gets the reference white point of this color
/// </summary>
public CieXyz WhitePoint
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get;
}
public CieXyz WhitePoint { get; }
/// <summary>
/// Gets the lightness dimension
@ -146,7 +142,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <returns>
/// True if the current left is equal to the <paramref name="right"/> parameter; otherwise, false.
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator ==(CieLuv left, CieLuv right)
{
return left.Equals(right);
@ -164,7 +159,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <returns>
/// True if the current left is unequal to the <paramref name="right"/> parameter; otherwise, false.
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator !=(CieLuv left, CieLuv right)
{
return !left.Equals(right);
@ -193,7 +187,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
}
/// <inheritdoc/>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override bool Equals(object obj)
{
return obj is CieLuv other && this.Equals(other);

3
src/ImageSharp/ColorSpaces/CieXyChromaticityCoordinates.cs

@ -105,7 +105,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <returns>
/// True if the current left is unequal to the <paramref name="right"/> parameter; otherwise, false.
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator !=(CieXyChromaticityCoordinates left, CieXyChromaticityCoordinates right)
{
return !left.Equals(right);
@ -129,14 +128,12 @@ namespace SixLabors.ImageSharp.ColorSpaces
}
/// <inheritdoc/>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override bool Equals(object obj)
{
return obj is CieXyChromaticityCoordinates other && this.Equals(other);
}
/// <inheritdoc/>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(CieXyChromaticityCoordinates other)
{
// The memberwise comparison here is a workaround for https://github.com/dotnet/coreclr/issues/16443

9
src/ImageSharp/ColorSpaces/CieXyy.cs

@ -85,11 +85,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
public bool IsEmpty => this.Equals(Empty);
/// <inheritdoc />
public Vector3 Vector
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => this.backingVector;
}
public Vector3 Vector => this.backingVector;
/// <summary>
/// Compares two <see cref="CieXyy"/> objects for equality.
@ -103,7 +99,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <returns>
/// True if the current left is equal to the <paramref name="right"/> parameter; otherwise, false.
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator ==(CieXyy left, CieXyy right)
{
return left.Equals(right);
@ -121,7 +116,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <returns>
/// True if the current left is unequal to the <paramref name="right"/> parameter; otherwise, false.
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator !=(CieXyy left, CieXyy right)
{
return !left.Equals(right);
@ -145,7 +139,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
}
/// <inheritdoc/>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override bool Equals(object obj)
{
return obj is CieXyy other && this.Equals(other);

4
src/ImageSharp/ColorSpaces/CieXyz.cs

@ -40,7 +40,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// Initializes a new instance of the <see cref="CieXyz"/> struct.
/// </summary>
/// <param name="vector">The vector representing the x, y, z components.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public CieXyz(Vector3 vector)
: this()
{
@ -103,7 +102,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <returns>
/// True if the current left is equal to the <paramref name="right"/> parameter; otherwise, false.
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator ==(CieXyz left, CieXyz right)
{
return left.Equals(right);
@ -121,7 +119,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <returns>
/// True if the current left is unequal to the <paramref name="right"/> parameter; otherwise, false.
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator !=(CieXyz left, CieXyz right)
{
return !left.Equals(right);
@ -145,7 +142,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
}
/// <inheritdoc/>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override bool Equals(object obj)
{
return obj is CieXyz other && this.Equals(other);

1
src/ImageSharp/ColorSpaces/Cmyk.cs

@ -147,7 +147,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
}
/// <inheritdoc/>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override bool Equals(object obj)
{
return obj is Cmyk other && this.Equals(other);

9
src/ImageSharp/ColorSpaces/Hsl.cs

@ -87,11 +87,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
public bool IsEmpty => this.Equals(Empty);
/// <inheritdoc/>
public Vector3 Vector
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => this.backingVector;
}
public Vector3 Vector => this.backingVector;
/// <summary>
/// Compares two <see cref="Hsl"/> objects for equality.
@ -105,7 +101,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <returns>
/// True if the current left is equal to the <paramref name="right"/> parameter; otherwise, false.
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator ==(Hsl left, Hsl right)
{
return left.Equals(right);
@ -123,7 +118,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <returns>
/// True if the current left is unequal to the <paramref name="right"/> parameter; otherwise, false.
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator !=(Hsl left, Hsl right)
{
return !left.Equals(right);
@ -147,7 +141,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
}
/// <inheritdoc/>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override bool Equals(object obj)
{
return obj is Hsl other && this.Equals(other);

9
src/ImageSharp/ColorSpaces/HunterLab.cs

@ -122,11 +122,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
public bool IsEmpty => this.Equals(Empty);
/// <inheritdoc />
public Vector3 Vector
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => this.backingVector;
}
public Vector3 Vector => this.backingVector;
/// <summary>
/// Compares two <see cref="HunterLab"/> objects for equality.
@ -140,7 +136,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <returns>
/// True if the current left is equal to the <paramref name="right"/> parameter; otherwise, false.
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator ==(HunterLab left, HunterLab right)
{
return left.Equals(right);
@ -158,7 +153,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <returns>
/// True if the current left is unequal to the <paramref name="right"/> parameter; otherwise, false.
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator !=(HunterLab left, HunterLab right)
{
return !left.Equals(right);
@ -187,7 +181,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
}
/// <inheritdoc/>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override bool Equals(object obj)
{
return obj is HunterLab other && this.Equals(other);

9
src/ImageSharp/ColorSpaces/LinearRgb.cs

@ -119,11 +119,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
public bool IsEmpty => this.Equals(Empty);
/// <inheritdoc />
public Vector3 Vector
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => this.backingVector;
}
public Vector3 Vector => this.backingVector;
/// <summary>
/// Compares two <see cref="LinearRgb"/> objects for equality.
@ -137,7 +133,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <returns>
/// True if the current left is equal to the <paramref name="right"/> parameter; otherwise, false.
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator ==(LinearRgb left, LinearRgb right)
{
return left.Equals(right);
@ -155,7 +150,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <returns>
/// True if the current left is unequal to the <paramref name="right"/> parameter; otherwise, false.
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator !=(LinearRgb left, LinearRgb right)
{
return !left.Equals(right);
@ -179,7 +173,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
}
/// <inheritdoc/>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override bool Equals(object obj)
{
return obj is LinearRgb other && this.Equals(other);

9
src/ImageSharp/ColorSpaces/Lms.cs

@ -86,11 +86,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
public bool IsEmpty => this.Equals(Empty);
/// <inheritdoc />
public Vector3 Vector
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => this.backingVector;
}
public Vector3 Vector => this.backingVector;
/// <summary>
/// Compares two <see cref="Lms"/> objects for equality.
@ -104,7 +100,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <returns>
/// True if the current left is equal to the <paramref name="right"/> parameter; otherwise, false.
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator ==(Lms left, Lms right)
{
return left.Equals(right);
@ -122,7 +117,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <returns>
/// True if the current left is unequal to the <paramref name="right"/> parameter; otherwise, false.
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator !=(Lms left, Lms right)
{
return !left.Equals(right);
@ -146,7 +140,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
}
/// <inheritdoc/>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override bool Equals(object obj)
{
return obj is Lms other && this.Equals(other);

9
src/ImageSharp/ColorSpaces/Rgb.cs

@ -125,11 +125,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
public bool IsEmpty => this.Equals(Empty);
/// <inheritdoc />
public Vector3 Vector
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => this.backingVector;
}
public Vector3 Vector => this.backingVector;
/// <summary>
/// Allows the implicit conversion of an instance of <see cref="Rgba32"/> to a
@ -159,7 +155,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <returns>
/// True if the current left is equal to the <paramref name="right"/> parameter; otherwise, false.
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator ==(Rgb left, Rgb right)
{
return left.Equals(right);
@ -177,7 +172,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <returns>
/// True if the current left is unequal to the <paramref name="right"/> parameter; otherwise, false.
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator !=(Rgb left, Rgb right)
{
return !left.Equals(right);
@ -201,7 +195,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
}
/// <inheritdoc/>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override bool Equals(object obj)
{
return obj is Rgb other && this.Equals(other);

6
src/ImageSharp/ColorSpaces/YCbCr.cs

@ -89,11 +89,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
public bool IsEmpty => this.Equals(Empty);
/// <inheritdoc/>
public Vector3 Vector
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => this.backingVector;
}
public Vector3 Vector => this.backingVector;
/// <summary>
/// Compares two <see cref="YCbCr"/> objects for equality.

Loading…
Cancel
Save