Improve the performance of IRFactory.normalizeString.
indexOf is much cheaper than replaceAll, we expect \r to be rare so use indexOf to short circuit the use of replaceAll.
@@ -3039,7 +3039,9 @@ class IRFactory {
// <CR><LF> and <CR> are normalized as <LF>. For raw template literal string values: this is the
// spec behaviour. For regular string literals: they can only be part of a line continuation,
// which we want to scrub.
+ if (value.indexOf('\r') >= 0) {
value = value.replaceAll("\r\n?", "\n");
+ }
int start = templateLiteral ? 0 : 1; // skip the leading quote
int cur = value.indexOf('\\');
