Spaces:
Running
Running
| inlining | |
| inlineCodeOrNilForStatement: aNode in: aCodeGen | |
| "If the given statement node can be inlined, answer the statements that replace it. Otherwise, answer nil." | |
| | stmts | | |
| aNode isReturn ifTrue: [ | |
| (self inlineableSend: aNode expression in: aCodeGen) ifTrue: [ | |
| stmts := self inlineSend: aNode expression | |
| directReturn: true exitVar: nil in: aCodeGen. | |
| ^stmts | |
| ]. | |
| ]. | |
| aNode isAssignment ifTrue: [ | |
| (self inlineableSend: aNode expression in: aCodeGen) ifTrue: [ | |
| ^self inlineSend: aNode expression | |
| directReturn: false exitVar: aNode variable name in: aCodeGen | |
| ]. | |
| ]. | |
| aNode isSend ifTrue: [ | |
| (self inlineableSend: aNode in: aCodeGen) ifTrue: [ | |
| ^self inlineSend: aNode | |
| directReturn: false exitVar: nil in: aCodeGen | |
| ]. | |
| ]. | |
| ^nil |