@@ -4008,12 +4008,10 @@ protected Object splicePrepend(
4008
4008
@ Cached RubyStringLibrary libString ,
4009
4009
@ Cached RubyStringLibrary libOther ,
4010
4010
@ Cached TruffleString .SubstringByteIndexNode prependSubstringNode ,
4011
- @ Cached TruffleString .ConcatNode prependConcatNode ,
4012
- @ Cached TruffleString .ForceEncodingNode forceEncodingNode ) {
4011
+ @ Cached TruffleString .ConcatNode prependConcatNode ) {
4013
4012
var original = string .tstring ;
4014
4013
var originalTEncoding = libString .getTEncoding (string );
4015
- var left = forceEncodingNode .execute (libOther .getTString (other ), libOther .getTEncoding (other ),
4016
- rubyEncoding .tencoding );
4014
+ var left = libOther .getTString (other );
4017
4015
var right = prependSubstringNode .execute (original , byteCountToReplace ,
4018
4016
original .byteLength (originalTEncoding ) - byteCountToReplace , originalTEncoding , true );
4019
4017
@@ -4029,13 +4027,9 @@ protected Object spliceAppend(
4029
4027
@ Cached RubyStringLibrary libString ,
4030
4028
@ Cached RubyStringLibrary libOther ,
4031
4029
@ Cached TruffleString .ConcatNode appendConcatNode ,
4032
- @ Cached TruffleString .ForceEncodingNode forceEncodingNodeLeft ,
4033
- @ Cached TruffleString .ForceEncodingNode forceEncodingNodeRight ,
4034
4030
@ Bind ("libString.byteLength(string)" ) int byteLength ) {
4035
- var left = forceEncodingNodeLeft .execute (string .tstring , libString .getTEncoding (string ),
4036
- rubyEncoding .tencoding );
4037
- var right = forceEncodingNodeRight .execute (libOther .getTString (other ), libOther .getTEncoding (other ),
4038
- rubyEncoding .tencoding );
4031
+ var left = string .tstring ;
4032
+ var right = libOther .getTString (other );
4039
4033
4040
4034
var concatResult = appendConcatNode .execute (left , right , rubyEncoding .tencoding , true );
4041
4035
string .setTString (concatResult , rubyEncoding );
@@ -4055,7 +4049,6 @@ protected RubyString splice(
4055
4049
@ Cached TruffleString .ConcatNode leftConcatNode ,
4056
4050
@ Cached TruffleString .ConcatNode rightConcatNode ,
4057
4051
@ Cached TruffleString .ForceEncodingNode forceEncodingNode ,
4058
- @ Cached TruffleString .ForceEncodingNode forceEncodingNodeOther ,
4059
4052
@ Bind ("libString.byteLength(string)" ) int byteLength ) {
4060
4053
var sourceTEncoding = libString .getTEncoding (string );
4061
4054
var resultTEncoding = rubyEncoding .tencoding ;
@@ -4071,9 +4064,7 @@ protected RubyString splice(
4071
4064
if (insertStringIsEmptyProfile .profile (insert .isEmpty ())) {
4072
4065
joinedLeft = forceEncodingNode .execute (splitLeft , sourceTEncoding , resultTEncoding );
4073
4066
} else {
4074
- joinedLeft = leftConcatNode .execute (splitLeft ,
4075
- forceEncodingNodeOther .execute (insert , libOther .getTEncoding (other ), resultTEncoding ),
4076
- resultTEncoding , true );
4067
+ joinedLeft = leftConcatNode .execute (splitLeft , insert , resultTEncoding , true );
4077
4068
}
4078
4069
4079
4070
final TruffleString joinedRight ; // always in resultTEncoding
0 commit comments