compiler/PPCCodeGenerator.st
changeset 496 0433a9d7fbcd
parent 495 555f59e60886
child 497 501ba969803d
equal deleted inserted replaced
495:555f59e60886 496:0433a9d7fbcd
   209 !PPCCodeGenerator methodsFor:'visiting'!
   209 !PPCCodeGenerator methodsFor:'visiting'!
   210 
   210 
   211 visitActionNode: node
   211 visitActionNode: node
   212     | blockNode blockBody blockNodesVar blockNeedsCollection blockMatches childValueVars |
   212     | blockNode blockBody blockNodesVar blockNeedsCollection blockMatches childValueVars |
   213 
   213 
   214     blockNode := node block sourceNode deepCopy.
   214     blockNode := node block sourceNode copy.
   215     self assert: blockNode arguments size == 1.
   215     self assert: blockNode arguments size == 1.
   216     blockNodesVar := blockNode arguments first .
   216     blockNodesVar := blockNode arguments first .
   217     blockBody := blockNode body.
   217     blockBody := blockNode body.
   218 
   218 
   219     "Now, analyze block body, search for all references to
   219     "Now, analyze block body, search for all references to
   302         compiler codeReturn: 'failure'. 
   302         compiler codeReturn: 'failure'. 
   303     ] else: [
   303     ] else: [
   304         compiler code: blockBody.    
   304         compiler code: blockBody.    
   305     ]
   305     ]
   306 
   306 
   307     "Modified: / 17-06-2015 / 16:43:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   307     "Modified: / 16-06-2015 / 07:41:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   308 !
   308 !
   309 
   309 
   310 visitAndNode: node
   310 visitAndNode: node
   311     | mementoVar |
   311     | mementoVar |
   312     
   312     
   478 
   478 
   479 visitMappedActionNode: node
   479 visitMappedActionNode: node
   480     | child blockNode blockBody |
   480     | child blockNode blockBody |
   481 
   481 
   482     child := node child.
   482     child := node child.
   483     blockNode := node block sourceNode deepCopy.
   483     blockNode := node block sourceNode copy.
   484     blockBody := blockNode body.
   484     blockBody := blockNode body.
   485 
   485 
   486     "Block return value is return value of last statement.
   486     "Block return value is return value of last statement.
   487      So if the method is not inline, make last statement a return.
   487      So if the method is not inline, make last statement a return.
   488         if the method is inline, make it assignment to retvalVar."
   488         if the method is inline, make it assignment to retvalVar."