You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// The implementations of the 8-bit indexOf operations cast the character for
412
+
// which they are searching to a signed byte value, and the characters in the
413
+
// String themselves are stored in a signed byte array. Make sure that folding
414
+
// at compile-time takes into account that operations are on signed bytes.
415
+
ch = (int32_t)(int8_t) ch;
416
+
}
417
+
400
418
if (ch == targetChar)
401
419
{
402
420
if (performTransformation(comp(), "%sReplacing indexOf call node [" POINTER_PRINTF_FORMAT "] on known string receiver with constant value of %d\n", OPT_DETAILS, indexOfNode, i))
// The implementations of the 8-bit indexOf operations cast the character for
458
+
// which they are searching to a signed byte value, and the characters in the
459
+
// String themselves are stored in a signed byte array. Make sure that the
460
+
// inlined version similarly operates on signed bytes.
461
+
ch = (int32_t)(int8_t) ch;
462
+
}
463
+
436
464
if (!performTransformation(comp(), "%sReplacing indexOf call node [" POINTER_PRINTF_FORMAT "] on known string receiver with equivalent icmpeq tree\n", OPT_DETAILS, indexOfNode))
437
465
returnfalse;
466
+
467
+
// The implementations of the 8-bit indexOf operations cast the character for
468
+
// which they are searching to a signed byte value. In some cases that happens
469
+
// at the call to the known method that's being processed here, and in some
470
+
// cases that happens within the known method itself. If targetCharNode is not
471
+
// known to be the result of a b2i operation and is not already known to be in
472
+
// the required range for a signed byte value, force that. Otherwise, this
473
+
// could end up looking for the degree symbol, U+00B0, say, as an unsigned
if (!performTransformation(comp(), "%sReplacing indexOf call node [" POINTER_PRINTF_FORMAT "] on known string receiver with equivalent iselect tree\n", OPT_DETAILS, indexOfNode))
if (!performTransformation(comp(), "%sReplacing indexOf call node [" POINTER_PRINTF_FORMAT "] on known string receiver with equivalent iselect tree\n", OPT_DETAILS, indexOfNode))
474
-
returnfalse;
542
+
543
+
if (!is16Bit)
544
+
{
545
+
// The implementations of the 8-bit indexOf operations cast the character for
546
+
// which they are searching to a signed byte value, and the characters in the
547
+
// String themselves are stored in a signed byte array. Make sure that the
548
+
// inlined version similarly operates on signed bytes.
0 commit comments