Skip to content

Commit a470d79

Browse files
committed
Remove duplicated temporary variable declaration for for-loop operator
1 parent e93c4d7 commit a470d79

17 files changed

+94
-97
lines changed

spec/truffle/parsing/fixtures/for/multi_assignment/with_multiple_variables.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ast: |
1111
arityForCheck = Arity{preRequired = 0, optional = 0, hasRest = true, isImplicitRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = false}
1212
callTarget = <top (required)>
1313
checkArityProfile = false
14-
frameDescriptor = FrameDescriptor@...{#0:(self), #1:%$~_, #2:%for_0, #3:%frame_on_stack_marker_1, #4:a, #5:b, #6:c, #7:array}
14+
frameDescriptor = FrameDescriptor@...{#0:(self), #1:%$~_, #2:%frame_on_stack_marker_1, #3:a, #4:b, #5:c, #6:array}
1515
instrumentationBits = 0
1616
keywordArguments = false
1717
localReturnProfile = false
@@ -55,7 +55,7 @@ ast: |
5555
FrameOnStackNode
5656
attributes:
5757
flags = 0
58-
frameOnStackMarkerSlot = 3
58+
frameOnStackMarkerSlot = 2
5959
children:
6060
child =
6161
RubyCallNode
@@ -79,7 +79,7 @@ ast: |
7979
breakID = org.truffleruby.language.control.BreakID@...
8080
callTargets = ProcCallTargets(callTargetForProc = block in <top (required)>, callTargetForLambda = null, altCallTargetCompiler = ...$$Lambda$.../0x...@...)
8181
flags = 0
82-
frameOnStackMarkerSlot = 3
82+
frameOnStackMarkerSlot = 2
8383
sharedMethodInfo = SharedMethodInfo(staticLexicalScope = :: Object, arity = Arity{preRequired = 1, optional = 0, hasRest = false, isImplicitRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = false}, originName = block in <top (required)>, blockDepth = 1, parseName = block in <top (required)>, notes = <top (required)>, argumentDescriptors = [ArgumentDescriptor(name = %for_0, type = req)])
8484
type = PROC
8585
call targets:
@@ -143,17 +143,17 @@ ast: |
143143
attributes:
144144
flags = 0
145145
frameDepth = 1
146-
frameSlot = 4
146+
frameSlot = 3
147147
WriteDeclarationVariableNode
148148
attributes:
149149
flags = 0
150150
frameDepth = 1
151-
frameSlot = 5
151+
frameSlot = 4
152152
WriteDeclarationVariableNode
153153
attributes:
154154
flags = 0
155155
frameDepth = 1
156-
frameSlot = 6
156+
frameSlot = 5
157157
]
158158
rhsNode =
159159
ReadLocalVariableNode
@@ -172,7 +172,7 @@ ast: |
172172
attributes:
173173
flags = 1
174174
frameDepth = 1
175-
frameSlot = 7
175+
frameSlot = 6
176176
children:
177177
valueNode =
178178
ArrayLiteralNode$UninitialisedArrayLiteralNode
@@ -185,19 +185,19 @@ ast: |
185185
attributes:
186186
flags = 0
187187
frameDepth = 1
188-
frameSlot = 4
188+
frameSlot = 3
189189
type = FRAME_LOCAL
190190
ReadDeclarationVariableNode
191191
attributes:
192192
flags = 0
193193
frameDepth = 1
194-
frameSlot = 5
194+
frameSlot = 4
195195
type = FRAME_LOCAL
196196
ReadDeclarationVariableNode
197197
attributes:
198198
flags = 0
199199
frameDepth = 1
200-
frameSlot = 6
200+
frameSlot = 5
201201
type = FRAME_LOCAL
202202
]
203203
]

spec/truffle/parsing/fixtures/for/multi_assignment/with_nested_multi_assignment.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ast: |
1111
arityForCheck = Arity{preRequired = 0, optional = 0, hasRest = true, isImplicitRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = false}
1212
callTarget = <top (required)>
1313
checkArityProfile = false
14-
frameDescriptor = FrameDescriptor@...{#0:(self), #1:%$~_, #2:%for_0, #3:%frame_on_stack_marker_1, #4:a, #5:b, #6:c, #7:array}
14+
frameDescriptor = FrameDescriptor@...{#0:(self), #1:%$~_, #2:%frame_on_stack_marker_1, #3:a, #4:b, #5:c, #6:array}
1515
instrumentationBits = 0
1616
keywordArguments = false
1717
localReturnProfile = false
@@ -55,7 +55,7 @@ ast: |
5555
FrameOnStackNode
5656
attributes:
5757
flags = 0
58-
frameOnStackMarkerSlot = 3
58+
frameOnStackMarkerSlot = 2
5959
children:
6060
child =
6161
RubyCallNode
@@ -79,7 +79,7 @@ ast: |
7979
breakID = org.truffleruby.language.control.BreakID@...
8080
callTargets = ProcCallTargets(callTargetForProc = block in <top (required)>, callTargetForLambda = null, altCallTargetCompiler = ...$$Lambda$.../0x...@...)
8181
flags = 0
82-
frameOnStackMarkerSlot = 3
82+
frameOnStackMarkerSlot = 2
8383
sharedMethodInfo = SharedMethodInfo(staticLexicalScope = :: Object, arity = Arity{preRequired = 1, optional = 0, hasRest = false, isImplicitRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = false}, originName = block in <top (required)>, blockDepth = 1, parseName = block in <top (required)>, notes = <top (required)>, argumentDescriptors = [ArgumentDescriptor(name = %for_0, type = req)])
8484
type = PROC
8585
call targets:
@@ -143,7 +143,7 @@ ast: |
143143
attributes:
144144
flags = 0
145145
frameDepth = 1
146-
frameSlot = 4
146+
frameSlot = 3
147147
MultipleAssignmentNode
148148
attributes:
149149
flags = 0
@@ -153,12 +153,12 @@ ast: |
153153
attributes:
154154
flags = 0
155155
frameDepth = 1
156-
frameSlot = 5
156+
frameSlot = 4
157157
WriteDeclarationVariableNode
158158
attributes:
159159
flags = 0
160160
frameDepth = 1
161-
frameSlot = 6
161+
frameSlot = 5
162162
]
163163
splatCastNode =
164164
SplatCastNodeGen
@@ -185,7 +185,7 @@ ast: |
185185
attributes:
186186
flags = 1
187187
frameDepth = 1
188-
frameSlot = 7
188+
frameSlot = 6
189189
children:
190190
valueNode =
191191
ArrayLiteralNode$UninitialisedArrayLiteralNode
@@ -198,19 +198,19 @@ ast: |
198198
attributes:
199199
flags = 0
200200
frameDepth = 1
201-
frameSlot = 4
201+
frameSlot = 3
202202
type = FRAME_LOCAL
203203
ReadDeclarationVariableNode
204204
attributes:
205205
flags = 0
206206
frameDepth = 1
207-
frameSlot = 5
207+
frameSlot = 4
208208
type = FRAME_LOCAL
209209
ReadDeclarationVariableNode
210210
attributes:
211211
flags = 0
212212
frameDepth = 1
213-
frameSlot = 6
213+
frameSlot = 5
214214
type = FRAME_LOCAL
215215
]
216216
]

0 commit comments

Comments
 (0)