Skip to content

Commit 3b0a28c

Browse files
committed
Optimise interpolated String and use frozen String literals for static parts
1 parent 1b3ceb5 commit 3b0a28c

File tree

33 files changed

+166
-146
lines changed

33 files changed

+166
-146
lines changed

spec/truffle/parsing/fixtures/aliases/with_dynamic_symbols_and_interpolation_arbitrary_expression.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ ast: |
3737
ToSNodeGen
3838
children:
3939
valueNode_ =
40-
StringLiteralNode
40+
FrozenStringLiteralNode
4141
attributes:
42-
encoding = UTF-8
42+
definition = "expression" (ASCII-8BIT)
4343
flags = 0
44+
frozenString = "ab" (UTF-8)
4445
sourceCharIndex = 13
4546
sourceLength = 2
46-
tstring = ab
4747
ToSNodeGen
4848
children:
4949
valueNode_ =
@@ -56,11 +56,11 @@ ast: |
5656
ToSNodeGen
5757
children:
5858
valueNode_ =
59-
StringLiteralNode
59+
FrozenStringLiteralNode
6060
attributes:
61-
encoding = UTF-8
61+
definition = "expression" (ASCII-8BIT)
6262
flags = 0
63+
frozenString = "cd" (UTF-8)
6364
sourceCharIndex = 22
6465
sourceLength = 2
65-
tstring = cd
6666
]

spec/truffle/parsing/fixtures/hashes/with_symbol_syntax_when_dynamic_symbol_and_interpolation.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ ast: |
3030
ToSNodeGen
3131
children:
3232
valueNode_ =
33-
StringLiteralNode
33+
FrozenStringLiteralNode
3434
attributes:
35-
encoding = UTF-8
35+
definition = "expression" (ASCII-8BIT)
3636
flags = 0
37+
frozenString = "foo" (UTF-8)
3738
sourceCharIndex = 2
3839
sourceLength = 3
39-
tstring = foo
4040
ToSNodeGen
4141
children:
4242
valueNode_ =

spec/truffle/parsing/fixtures/regexps/in_boolean_context_with_interpolation.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ ast: |
6464
ToSNodeGen
6565
children:
6666
valueNode_ =
67-
StringLiteralNode
67+
FrozenStringLiteralNode
6868
attributes:
69-
encoding = UTF-8
69+
definition = "expression" (ASCII-8BIT)
7070
flags = 1
71+
frozenString = "foo " (UTF-8)
7172
sourceCharIndex = 1
7273
sourceLength = 4
73-
tstring = foo
7474
ToSNodeGen
7575
children:
7676
valueNode_ =
@@ -100,11 +100,11 @@ ast: |
100100
ToSNodeGen
101101
children:
102102
valueNode_ =
103-
StringLiteralNode
103+
FrozenStringLiteralNode
104104
attributes:
105-
encoding = UTF-8
105+
definition = "expression" (ASCII-8BIT)
106106
flags = 0
107+
frozenString = " baz" (UTF-8)
107108
sourceCharIndex = 11
108109
sourceLength = 4
109-
tstring = baz
110110
]

spec/truffle/parsing/fixtures/regexps/with_embedded_class_variable.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ ast: |
2626
ToSNodeGen
2727
children:
2828
valueNode_ =
29-
StringLiteralNode
29+
FrozenStringLiteralNode
3030
attributes:
31-
encoding = UTF-8
31+
definition = "expression" (ASCII-8BIT)
3232
flags = 1
33+
frozenString = "foo " (UTF-8)
3334
sourceCharIndex = 1
3435
sourceLength = 4
35-
tstring = foo
3636
ToSNodeGen
3737
children:
3838
valueNode_ =

spec/truffle/parsing/fixtures/regexps/with_embedded_global_variable.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ ast: |
2626
ToSNodeGen
2727
children:
2828
valueNode_ =
29-
StringLiteralNode
29+
FrozenStringLiteralNode
3030
attributes:
31-
encoding = UTF-8
31+
definition = "expression" (ASCII-8BIT)
3232
flags = 1
33+
frozenString = "foo " (UTF-8)
3334
sourceCharIndex = 1
3435
sourceLength = 4
35-
tstring = foo
3636
ToSNodeGen
3737
children:
3838
valueNode_ =

spec/truffle/parsing/fixtures/regexps/with_embedded_instance_variable.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ ast: |
2626
ToSNodeGen
2727
children:
2828
valueNode_ =
29-
StringLiteralNode
29+
FrozenStringLiteralNode
3030
attributes:
31-
encoding = UTF-8
31+
definition = "expression" (ASCII-8BIT)
3232
flags = 1
33+
frozenString = "foo " (UTF-8)
3334
sourceCharIndex = 1
3435
sourceLength = 4
35-
tstring = foo
3636
ToSNodeGen
3737
children:
3838
valueNode_ =

spec/truffle/parsing/fixtures/regexps/with_interpolation.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ ast: |
2626
ToSNodeGen
2727
children:
2828
valueNode_ =
29-
StringLiteralNode
29+
FrozenStringLiteralNode
3030
attributes:
31-
encoding = UTF-8
31+
definition = "expression" (ASCII-8BIT)
3232
flags = 1
33+
frozenString = "a" (UTF-8)
3334
sourceCharIndex = 1
3435
sourceLength = 1
35-
tstring = a
3636
ToSNodeGen
3737
children:
3838
valueNode_ =
@@ -45,11 +45,11 @@ ast: |
4545
ToSNodeGen
4646
children:
4747
valueNode_ =
48-
StringLiteralNode
48+
FrozenStringLiteralNode
4949
attributes:
50-
encoding = UTF-8
50+
definition = "expression" (ASCII-8BIT)
5151
flags = 0
52+
frozenString = "c" (UTF-8)
5253
sourceCharIndex = 9
5354
sourceLength = 1
54-
tstring = c
5555
]

spec/truffle/parsing/fixtures/regexps/with_interpolation_without_expression.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ ast: |
2929
ToSNodeGen
3030
children:
3131
valueNode_ =
32-
StringLiteralNode
32+
FrozenStringLiteralNode
3333
attributes:
34-
encoding = UTF-8
34+
definition = "expression" (ASCII-8BIT)
3535
flags = 1
36+
frozenString = "a" (UTF-8)
3637
sourceCharIndex = 1
3738
sourceLength = 1
38-
tstring = a
3939
ToSNodeGen
4040
children:
4141
valueNode_ =
@@ -48,11 +48,11 @@ ast: |
4848
ToSNodeGen
4949
children:
5050
valueNode_ =
51-
StringLiteralNode
51+
FrozenStringLiteralNode
5252
attributes:
53-
encoding = UTF-8
53+
definition = "expression" (ASCII-8BIT)
5454
flags = 0
55+
frozenString = "c" (UTF-8)
5556
sourceCharIndex = 5
5657
sourceLength = 1
57-
tstring = c
5858
]

spec/truffle/parsing/fixtures/rescue/backtrace_optimization/disabled/when_string_with_interpolation.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ ast: |
4040
ToSNodeGen
4141
children:
4242
valueNode_ =
43-
StringLiteralNode
43+
FrozenStringLiteralNode
4444
attributes:
45-
encoding = UTF-8
45+
definition = "expression" (ASCII-8BIT)
4646
flags = 1
47+
frozenString = "abc " (UTF-8)
4748
sourceCharIndex = 24
4849
sourceLength = 4
49-
tstring = abc
5050
ToSNodeGen
5151
children:
5252
valueNode_ =
@@ -59,13 +59,13 @@ ast: |
5959
ToSNodeGen
6060
children:
6161
valueNode_ =
62-
StringLiteralNode
62+
FrozenStringLiteralNode
6363
attributes:
64-
encoding = UTF-8
64+
definition = "expression" (ASCII-8BIT)
6565
flags = 0
66+
frozenString = " def" (UTF-8)
6667
sourceCharIndex = 35
6768
sourceLength = 4
68-
tstring = def
6969
]
7070
]
7171
tryPart =

spec/truffle/parsing/fixtures/rescue/backtrace_optimization/disabled/when_symbol_with_interpolation.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ ast: |
4747
ToSNodeGen
4848
children:
4949
valueNode_ =
50-
StringLiteralNode
50+
FrozenStringLiteralNode
5151
attributes:
52-
encoding = UTF-8
52+
definition = "expression" (ASCII-8BIT)
5353
flags = 1
54+
frozenString = "abc " (UTF-8)
5455
sourceCharIndex = 25
5556
sourceLength = 4
56-
tstring = abc
5757
ToSNodeGen
5858
children:
5959
valueNode_ =
@@ -66,13 +66,13 @@ ast: |
6666
ToSNodeGen
6767
children:
6868
valueNode_ =
69-
StringLiteralNode
69+
FrozenStringLiteralNode
7070
attributes:
71-
encoding = UTF-8
71+
definition = "expression" (ASCII-8BIT)
7272
flags = 0
73+
frozenString = " def" (UTF-8)
7374
sourceCharIndex = 36
7475
sourceLength = 4
75-
tstring = def
7676
]
7777
]
7878
tryPart =

0 commit comments

Comments
 (0)