@@ -1273,7 +1273,7 @@ Object eachCodePoint(Object string, RubyProc block,
1273
1273
var iterator = createCodePointIteratorNode .execute (tstring , tencoding , ErrorHandling .RETURN_NEGATIVE );
1274
1274
1275
1275
while (iterator .hasNext ()) {
1276
- int codePoint = nextNode .execute (iterator );
1276
+ int codePoint = nextNode .execute (iterator , tencoding );
1277
1277
1278
1278
if (codePoint == -1 ) {
1279
1279
invalidCodePointProfile .enter (this );
@@ -1313,7 +1313,7 @@ Object codePointsWithoutBlock(Object string, Nil unusedBlock,
1313
1313
1314
1314
int i = 0 ;
1315
1315
while (iterator .hasNext ()) {
1316
- int codePoint = nextNode .execute (iterator );
1316
+ int codePoint = nextNode .execute (iterator , tencoding );
1317
1317
1318
1318
if (codePoint == -1 ) {
1319
1319
invalidCodePointProfile .enter (this );
@@ -1639,7 +1639,7 @@ static Object lstripBangSingleByte(RubyString string,
1639
1639
var tencoding = encoding .tencoding ;
1640
1640
1641
1641
var iterator = createCodePointIteratorNode .execute (tstring , tencoding , ErrorHandling .RETURN_NEGATIVE );
1642
- int codePoint = nextNode .execute (iterator );
1642
+ int codePoint = nextNode .execute (iterator , tencoding );
1643
1643
1644
1644
// Check the first code point to see if it's broken. In the case of strings without leading spaces,
1645
1645
// this check can avoid having to compile the while loop.
@@ -1657,7 +1657,7 @@ static Object lstripBangSingleByte(RubyString string,
1657
1657
1658
1658
while (iterator .hasNext ()) {
1659
1659
int byteIndex = iterator .getByteIndex ();
1660
- codePoint = nextNode .execute (iterator );
1660
+ codePoint = nextNode .execute (iterator , tencoding );
1661
1661
1662
1662
if (codePoint == -1 ) {
1663
1663
badCodePointProfile .enter (node );
@@ -1780,7 +1780,7 @@ static Object rstripBangNonEmptyString(RubyString string,
1780
1780
1781
1781
var iterator = createBackwardCodePointIteratorNode .execute (tstring , tencoding ,
1782
1782
ErrorHandling .RETURN_NEGATIVE );
1783
- int codePoint = previousNode .execute (iterator );
1783
+ int codePoint = previousNode .execute (iterator , tencoding );
1784
1784
1785
1785
// Check the last code point to see if it's broken. In the case of strings without trailing spaces,
1786
1786
// this check can avoid having to compile the while loop.
@@ -1798,7 +1798,7 @@ static Object rstripBangNonEmptyString(RubyString string,
1798
1798
1799
1799
while (iterator .hasPrevious ()) {
1800
1800
int byteIndex = iterator .getByteIndex ();
1801
- codePoint = previousNode .execute (iterator );
1801
+ codePoint = previousNode .execute (iterator , tencoding );
1802
1802
1803
1803
if (codePoint == -1 ) {
1804
1804
badCodePointProfile .enter (node );
@@ -3023,7 +3023,7 @@ Object capitalizeAsciiCodePoints(RubyString string, int caseMappingOptions,
3023
3023
byte [] bytes = null ;
3024
3024
3025
3025
var iterator = createCodePointIteratorNode .execute (tstring , tencoding , ErrorHandling .RETURN_NEGATIVE );
3026
- int firstCodePoint = nextNode .execute (iterator );
3026
+ int firstCodePoint = nextNode .execute (iterator , tencoding );
3027
3027
if (firstCharIsLowerProfile .profile (this , StringSupport .isAsciiLowercase (firstCodePoint ))) {
3028
3028
bytes = copyByteArray (tstring , tencoding );
3029
3029
bytes [0 ] ^= 0x20 ;
@@ -3289,7 +3289,7 @@ static Object stringAwkSplit(Object string, int limit, Object block,
3289
3289
int e = 0 , b = 0 , iterations = 0 ;
3290
3290
try {
3291
3291
while (loopProfile .inject (node , iterator .hasNext ())) {
3292
- int c = nextNode .execute (iterator );
3292
+ int c = nextNode .execute (iterator , tencoding );
3293
3293
int p = iterator .getByteIndex ();
3294
3294
iterations ++;
3295
3295
@@ -3521,7 +3521,7 @@ private static TruffleString rbStrEscape(AbstractTruffleString tstring, RubyEnco
3521
3521
3522
3522
while (iterator .hasNext ()) {
3523
3523
final int p = iterator .getByteIndex ();
3524
- int c = iterator .nextUncached ();
3524
+ int c = iterator .nextUncached (tencoding );
3525
3525
3526
3526
if (c == -1 ) {
3527
3527
int n = iterator .getByteIndex () - p ;
0 commit comments