@@ -129,7 +129,7 @@ protected RubyEncoding negotiateStandardEncodingAndCr7Bit(
129
129
"getCodeRange(first, firstEncoding) == firstCodeRange" ,
130
130
"getCodeRange(second, secondEncoding) == secondCodeRange" },
131
131
limit = "getCacheLimit()" )
132
- protected RubyEncoding negotiateRopeRopeCached (
132
+ protected RubyEncoding negotiateEncodingCached (
133
133
AbstractTruffleString first ,
134
134
RubyEncoding firstEncoding ,
135
135
AbstractTruffleString second ,
@@ -140,19 +140,19 @@ protected RubyEncoding negotiateRopeRopeCached(
140
140
@ Cached ("getCodeRange(second, secondEncoding)" ) TruffleString .CodeRange secondCodeRange ,
141
141
@ Cached ("firstEncoding" ) RubyEncoding cachedFirstEncoding ,
142
142
@ Cached ("secondEncoding" ) RubyEncoding cachedSecondEncoding ,
143
- @ Cached ("compatibleEncodingForRopes (first, firstEncoding, second, secondEncoding)" ) RubyEncoding negotiatedEncoding ) {
143
+ @ Cached ("compatibleEncodingForStrings (first, firstEncoding, second, secondEncoding)" ) RubyEncoding negotiatedEncoding ) {
144
144
assert first .isCompatibleTo (firstEncoding .tencoding ) && second .isCompatibleTo (secondEncoding .tencoding );
145
145
return negotiatedEncoding ;
146
146
}
147
147
148
- @ Specialization (guards = "firstEncoding != secondEncoding" , replaces = "negotiateRopeRopeCached " )
149
- protected RubyEncoding negotiateRopeRopeUncached (
148
+ @ Specialization (guards = "firstEncoding != secondEncoding" , replaces = "negotiateEncodingCached " )
149
+ protected RubyEncoding negotiateEncodingUncached (
150
150
AbstractTruffleString first ,
151
151
RubyEncoding firstEncoding ,
152
152
AbstractTruffleString second ,
153
153
RubyEncoding secondEncoding ) {
154
154
assert first .isCompatibleTo (firstEncoding .tencoding ) && second .isCompatibleTo (secondEncoding .tencoding );
155
- return compatibleEncodingForRopes (first , firstEncoding , second , secondEncoding );
155
+ return compatibleEncodingForStrings (first , firstEncoding , second , secondEncoding );
156
156
}
157
157
158
158
/** This method returns non-null if either:
@@ -162,17 +162,17 @@ protected RubyEncoding negotiateRopeRopeUncached(
162
162
* </ul>
163
163
*/
164
164
@ TruffleBoundary
165
- protected RubyEncoding compatibleEncodingForRopes (AbstractTruffleString firstRope , RubyEncoding firstEncoding ,
166
- AbstractTruffleString secondRope , RubyEncoding secondEncoding ) {
165
+ protected RubyEncoding compatibleEncodingForStrings (AbstractTruffleString first , RubyEncoding firstEncoding ,
166
+ AbstractTruffleString second , RubyEncoding secondEncoding ) {
167
167
// MRI: enc_compatible_latter
168
168
assert firstEncoding != secondEncoding : "this method assumes the encodings are different" ;
169
169
170
- if (secondRope .isEmpty ()) {
170
+ if (second .isEmpty ()) {
171
171
return firstEncoding ;
172
172
}
173
- if (firstRope .isEmpty ()) {
173
+ if (first .isEmpty ()) {
174
174
return (firstEncoding .isAsciiCompatible &&
175
- StringGuards .is7Bit (secondRope , secondEncoding , getCodeRangeNode ()))
175
+ StringGuards .is7Bit (second , secondEncoding , getCodeRangeNode ()))
176
176
? firstEncoding
177
177
: secondEncoding ;
178
178
}
@@ -181,10 +181,10 @@ protected RubyEncoding compatibleEncodingForRopes(AbstractTruffleString firstRop
181
181
return null ;
182
182
}
183
183
184
- if (StringGuards .is7Bit (secondRope , secondEncoding , getCodeRangeNode ())) {
184
+ if (StringGuards .is7Bit (second , secondEncoding , getCodeRangeNode ())) {
185
185
return firstEncoding ;
186
186
}
187
- if (StringGuards .is7Bit (firstRope , firstEncoding , getCodeRangeNode ())) {
187
+ if (StringGuards .is7Bit (first , firstEncoding , getCodeRangeNode ())) {
188
188
return secondEncoding ;
189
189
}
190
190
@@ -255,10 +255,10 @@ protected RubyEncoding negotiateSameEncodingUncached(Object first, Object second
255
255
protected RubyEncoding negotiateStringStringEncoding (Object first , Object second ,
256
256
@ Cached RubyStringLibrary libFirst ,
257
257
@ Cached RubyStringLibrary libSecond ,
258
- @ Cached NegotiateCompatibleStringEncodingNode ropeNode ) {
258
+ @ Cached NegotiateCompatibleStringEncodingNode negotiateNode ) {
259
259
final RubyEncoding firstEncoding = libFirst .getEncoding (first );
260
260
final RubyEncoding secondEncoding = libSecond .getEncoding (second );
261
- return ropeNode .execute (
261
+ return negotiateNode .execute (
262
262
libFirst .getTString (first ),
263
263
firstEncoding ,
264
264
libSecond .getTString (second ),
0 commit comments