@@ -2460,7 +2460,7 @@ public RubyNode visitInterpolatedSymbolNode(Nodes.InterpolatedSymbolNode node) {
2460
2460
public RubyNode visitInterpolatedXStringNode (Nodes .InterpolatedXStringNode node ) {
2461
2461
// replace `` literal with a Kernel#` method call
2462
2462
2463
- var stringNode = new Nodes .InterpolatedStringNode (node .parts , node .startOffset , node .length );
2463
+ var stringNode = new Nodes .InterpolatedStringNode (NO_FLAGS , node .parts , node .startOffset , node .length );
2464
2464
final RubyNode string = stringNode .accept (this );
2465
2465
2466
2466
final RubyNode rubyNode = createCallNode (new SelfNode (), "`" , string );
@@ -2518,15 +2518,7 @@ private ToSNode[] translateInterpolatedParts(Nodes.Node[] parts) {
2518
2518
final ToSNode [] children = new ToSNode [parts .length ];
2519
2519
2520
2520
for (int i = 0 ; i < parts .length ; i ++) {
2521
- final RubyNode expression ;
2522
-
2523
- if (parts [i ] instanceof Nodes .StringNode stringNode ) {
2524
- // use frozen String literals to avoid extra allocations in the interpreter
2525
- // it will be addressed in Prism (see https://github.com/ruby/prism/issues/2532)
2526
- expression = visitStringNode (stringNode , true );
2527
- } else {
2528
- expression = parts [i ].accept (this );
2529
- }
2521
+ RubyNode expression = parts [i ].accept (this );
2530
2522
children [i ] = ToSNodeGen .create (expression );
2531
2523
}
2532
2524
@@ -3260,10 +3252,6 @@ public RubyNode visitStatementsNode(Nodes.StatementsNode node) {
3260
3252
3261
3253
@ Override
3262
3254
public RubyNode visitStringNode (Nodes .StringNode node ) {
3263
- return visitStringNode (node , node .isFrozen ());
3264
- }
3265
-
3266
- public RubyNode visitStringNode (Nodes .StringNode node , boolean frozen ) {
3267
3255
final RubyNode rubyNode ;
3268
3256
final RubyEncoding encoding ;
3269
3257
@@ -3277,7 +3265,7 @@ public RubyNode visitStringNode(Nodes.StringNode node, boolean frozen) {
3277
3265
3278
3266
byte [] bytes = node .unescaped ;
3279
3267
3280
- if (!frozen ) {
3268
+ if (!node . isFrozen () ) {
3281
3269
final TruffleString cachedTString = language .tstringCache .getTString (bytes , encoding );
3282
3270
rubyNode = new StringLiteralNode (cachedTString , encoding );
3283
3271
} else {
0 commit comments