Skip to content

Commit 88e89c3

Browse files
committed
[GR-47834] Optimize interpolated String and use frozen String literals for static parts
PullRequest: truffleruby/4181
2 parents 4b7d81b + 2459cdd commit 88e89c3

File tree

45 files changed

+212
-175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+212
-175
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/case/with_expression_and_when/with_splat_operator_and_preceding_and_following_elements.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,16 @@ ast: |
105105
values = [
106106
FrozenStringLiteralNode
107107
attributes:
108-
definition = expression
108+
definition = "expression" (ASCII-8BIT)
109109
flags = 0
110-
frozenString = bar
110+
frozenString = "bar" (UTF-8)
111111
sourceCharIndex = 31
112112
sourceLength = 5
113113
FrozenStringLiteralNode
114114
attributes:
115-
definition = expression
115+
definition = "expression" (ASCII-8BIT)
116116
flags = 0
117-
frozenString = baz
117+
frozenString = "baz" (UTF-8)
118118
sourceCharIndex = 38
119119
sourceLength = 5
120120
]

spec/truffle/parsing/fixtures/case/with_expression_and_when/with_string_literal_in_when_clause.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ ast: |
2828
leftNode_ =
2929
FrozenStringLiteralNode
3030
attributes:
31-
definition = expression
31+
definition = "expression" (ASCII-8BIT)
3232
flags = 0
33-
frozenString = foo
33+
frozenString = "foo" (UTF-8)
3434
sourceCharIndex = 13
3535
sourceLength = 5
3636
rightNode_ =

spec/truffle/parsing/fixtures/case/without_expression_and_when/with_string_literal_in_when_clause.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ ast: |
1818
condition =
1919
FrozenStringLiteralNode
2020
attributes:
21-
definition = expression
21+
definition = "expression" (ASCII-8BIT)
2222
flags = 0
23-
frozenString = foo
23+
frozenString = "foo" (UTF-8)
2424
sourceCharIndex = 10
2525
sourceLength = 5
2626
elseBody =

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ ast: |
1515
keyValues = [
1616
FrozenStringLiteralNode
1717
attributes:
18-
definition = expression
18+
definition = "expression" (ASCII-8BIT)
1919
flags = 0
20-
frozenString = foo
20+
frozenString = "foo" (UTF-8)
2121
sourceCharIndex = 1
2222
sourceLength = 5
2323
IntegerFixnumLiteralNode

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/method_calls/special_cases/method_-@_when_string_literal.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ ruby: |
88
ast: |
99
FrozenStringLiteralNode
1010
attributes:
11-
definition = method
11+
definition = "method" (ASCII-8BIT)
1212
flags = 1
13-
frozenString = foobar
13+
frozenString = "foobar" (UTF-8)
1414
sourceCharIndex = 0
1515
sourceLength = 9

spec/truffle/parsing/fixtures/method_calls/special_cases/method_dedup_when_string_literal.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ ruby: |
88
ast: |
99
FrozenStringLiteralNode
1010
attributes:
11-
definition = method
11+
definition = "method" (ASCII-8BIT)
1212
flags = 1
13-
frozenString = foobar
13+
frozenString = "foobar" (UTF-8)
1414
sourceCharIndex = 0
1515
sourceLength = 14

spec/truffle/parsing/fixtures/method_calls/special_cases/method_freeze.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ ruby: |
88
ast: |
99
FrozenStringLiteralNode
1010
attributes:
11-
definition = method
11+
definition = "method" (ASCII-8BIT)
1212
flags = 1
13-
frozenString = foobar
13+
frozenString = "foobar" (UTF-8)
1414
sourceCharIndex = 0
1515
sourceLength = 15

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
]

0 commit comments

Comments
 (0)