|
24 | 24 | import org.jruby.ir.Tuple; |
25 | 25 | import org.jruby.ir.builder.IRBuilder; |
26 | 26 | import org.jruby.ir.builder.LazyMethodDefinition; |
| 27 | +import org.jruby.ir.builder.StringStyle; |
27 | 28 | import org.jruby.ir.instructions.*; |
28 | 29 | import org.jruby.ir.instructions.defined.GetErrorInfoInstr; |
29 | 30 | import org.jruby.ir.instructions.defined.RestoreErrorInfoInstr; |
30 | 31 | import org.jruby.ir.operands.Array; |
31 | 32 | import org.jruby.ir.operands.Bignum; |
| 33 | +import org.jruby.ir.operands.ChilledString; |
32 | 34 | import org.jruby.ir.operands.Complex; |
33 | 35 | import org.jruby.ir.operands.CurrentScope; |
34 | 36 | import org.jruby.ir.operands.Fixnum; |
@@ -1435,7 +1437,7 @@ private RegexpOptions calculateRegexpOptions(short flags) { |
1435 | 1437 | } |
1436 | 1438 |
|
1437 | 1439 | private Operand buildInterpolatedString(Variable result, InterpolatedStringNode node) { |
1438 | | - return buildDStr(result, node.parts, getEncoding(), false, getLine(node)); |
| 1440 | + return buildDStr(result, node.parts, getEncoding(), StringStyle.Chilled, getLine(node)); |
1439 | 1441 | } |
1440 | 1442 |
|
1441 | 1443 | private Operand buildInterpolatedSymbol(Variable result, InterpolatedSymbolNode node) { |
@@ -1954,11 +1956,10 @@ private Operand buildSplat(Operand value) { |
1954 | 1956 | } |
1955 | 1957 |
|
1956 | 1958 | private Operand buildString(StringNode node) { |
1957 | | - if (node.isFrozen()) { |
1958 | | - return new FrozenString(bytelistFrom(node), CR_UNKNOWN, scope.getFile(), getLine(node)); |
1959 | | - } else { |
1960 | | - return copy(temp(), new MutableString(bytelistFrom(node), CR_UNKNOWN, scope.getFile(), getLine(node))); |
1961 | | - } |
| 1959 | + if (node.isMutable()) return copy(temp(), new MutableString(bytelistFrom(node), CR_UNKNOWN, scope.getFile(), getLine(node))); |
| 1960 | + if (node.isFrozen()) return new FrozenString(bytelistFrom(node), CR_UNKNOWN, scope.getFile(), getLine(node)); |
| 1961 | + |
| 1962 | + return new ChilledString(bytelistFrom(node), CR_UNKNOWN, scope.getFile(), getLine(node)); |
1962 | 1963 | } |
1963 | 1964 |
|
1964 | 1965 | private Operand buildFrozenString(StringNode node) { |
|
0 commit comments