summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoseph Tremoulet <JCTremoulet@gmail.com>2017-09-13 23:49:38 -0400
committerJan Kotas <jkotas@microsoft.com>2017-09-13 20:49:38 -0700
commit1376d3b190346ea2775f7d850389d0c99f62553c (patch)
tree502e899eaa99a91bdd39ed53bcb8156c42fafdae /src
parent9efc256fd1878207c37e9bcf7572b0437c1bf91e (diff)
downloadcoreclr-1376d3b190346ea2775f7d850389d0c99f62553c.tar.gz
coreclr-1376d3b190346ea2775f7d850389d0c99f62553c.tar.bz2
coreclr-1376d3b190346ea2775f7d850389d0c99f62553c.zip
Undo more JIT layout workarounds (#13961)
Remove some `goto`s that were added to work around undesirable jit layout (#9692, fixed in #13314) and epilog factoring (improved in #13792 and #13903), which are no longer needed. Resolves #13466.
Diffstat (limited to 'src')
-rw-r--r--src/mscorlib/src/System/String.Comparison.cs44
1 files changed, 19 insertions, 25 deletions
diff --git a/src/mscorlib/src/System/String.Comparison.cs b/src/mscorlib/src/System/String.Comparison.cs
index afdcddfe2f..6c6c5856be 100644
--- a/src/mscorlib/src/System/String.Comparison.cs
+++ b/src/mscorlib/src/System/String.Comparison.cs
@@ -100,19 +100,19 @@ namespace System
while (length >= 12)
{
- if (*(long*)a != *(long*)b) goto ReturnFalse;
- if (*(long*)(a + 4) != *(long*)(b + 4)) goto ReturnFalse;
- if (*(long*)(a + 8) != *(long*)(b + 8)) goto ReturnFalse;
+ if (*(long*)a != *(long*)b) return false;
+ if (*(long*)(a + 4) != *(long*)(b + 4)) return false;
+ if (*(long*)(a + 8) != *(long*)(b + 8)) return false;
length -= 12; a += 12; b += 12;
}
#else
while (length >= 10)
{
- if (*(int*)a != *(int*)b) goto ReturnFalse;
- if (*(int*)(a + 2) != *(int*)(b + 2)) goto ReturnFalse;
- if (*(int*)(a + 4) != *(int*)(b + 4)) goto ReturnFalse;
- if (*(int*)(a + 6) != *(int*)(b + 6)) goto ReturnFalse;
- if (*(int*)(a + 8) != *(int*)(b + 8)) goto ReturnFalse;
+ if (*(int*)a != *(int*)b) return false;
+ if (*(int*)(a + 2) != *(int*)(b + 2)) return false;
+ if (*(int*)(a + 4) != *(int*)(b + 4)) return false;
+ if (*(int*)(a + 6) != *(int*)(b + 6)) return false;
+ if (*(int*)(a + 8) != *(int*)(b + 8)) return false;
length -= 10; a += 10; b += 10;
}
#endif
@@ -123,14 +123,11 @@ namespace System
// the zero terminator.
while (length > 0)
{
- if (*(int*)a != *(int*)b) goto ReturnFalse;
+ if (*(int*)a != *(int*)b) return false;
length -= 2; a += 2; b += 2;
}
return true;
-
- ReturnFalse:
- return false;
}
}
@@ -190,31 +187,31 @@ namespace System
// Single int read aligns pointers for the following long reads
// No length check needed as this method is called when length >= 2
Debug.Assert(length >= 2);
- if (*(int*)a != *(int*)b) goto ReturnFalse;
+ if (*(int*)a != *(int*)b) return false;
length -= 2; a += 2; b += 2;
while (length >= 12)
{
- if (*(long*)a != *(long*)b) goto ReturnFalse;
- if (*(long*)(a + 4) != *(long*)(b + 4)) goto ReturnFalse;
- if (*(long*)(a + 8) != *(long*)(b + 8)) goto ReturnFalse;
+ if (*(long*)a != *(long*)b) return false;
+ if (*(long*)(a + 4) != *(long*)(b + 4)) return false;
+ if (*(long*)(a + 8) != *(long*)(b + 8)) return false;
length -= 12; a += 12; b += 12;
}
#else
while (length >= 10)
{
- if (*(int*)a != *(int*)b) goto ReturnFalse;
- if (*(int*)(a+2) != *(int*)(b+2)) goto ReturnFalse;
- if (*(int*)(a+4) != *(int*)(b+4)) goto ReturnFalse;
- if (*(int*)(a+6) != *(int*)(b+6)) goto ReturnFalse;
- if (*(int*)(a+8) != *(int*)(b+8)) goto ReturnFalse;
+ if (*(int*)a != *(int*)b) return false;
+ if (*(int*)(a+2) != *(int*)(b+2)) return false;
+ if (*(int*)(a+4) != *(int*)(b+4)) return false;
+ if (*(int*)(a+6) != *(int*)(b+6)) return false;
+ if (*(int*)(a+8) != *(int*)(b+8)) return false;
length -= 10; a += 10; b += 10;
}
#endif
while (length >= 2)
{
- if (*(int*)a != *(int*)b) goto ReturnFalse;
+ if (*(int*)a != *(int*)b) return false;
length -= 2; a += 2; b += 2;
}
@@ -222,9 +219,6 @@ namespace System
// and that the terminating zero is not included in the length. For even string sizes
// this compare can include the zero terminator. Bitwise OR avoids a branch.
return length == 0 | *a == *b;
-
- ReturnFalse:
- return false;
}
}