IRSend.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 30 Mar 2009 17:49:01 +0000
changeset 10 0fd549e0c784
parent 5 b94aea1d3710
child 23 377bc46cad12
permissions -rw-r--r--
First simple block works. See IRBuilderTest>>testBlock_blockTempArg. More tests are comming.

"{ Package: 'stx:goodies/newcompiler' }"

IRInstruction subclass:#IRSend
	instanceVariableNames:'selector numArgs superOf'
	classVariableNames:''
	poolDictionaries:''
	category:'NewCompiler-IR'
!

IRSend comment:'Instruction "send: selector" or "send: selector toSuperOf: behavior"'
!


!IRSend methodsFor:'accessing'!

numArgs
    ^ numArgs

    "Created: / 01-12-2008 / 19:33:49 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

numArgs:anInteger
    numArgs := anInteger.

    "Created: / 01-12-2008 / 19:33:49 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

selector
	^selector
!

selector: symbol

	selector _ symbol
!

senderselector
	^self method selector
!

superOf

	^ superOf
!

superOf: behavior

	superOf _ behavior
! !

!IRSend methodsFor:'interpret'!

executeOn: interpreter

    numArgs ifNil:[numArgs := selector numArgs].

    ^ superOf
        ifNil: [interpreter send: selector numArgs: numArgs]
        ifNotNil: [interpreter send: selector numArgs: numArgs toSuperOf: superOf ]

    "Modified: / 01-12-2008 / 19:39:51 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !

!IRSend methodsFor:'testing'!

isMessageSend
	^true.
!

isSend
	^true.
!

isSuperSend
    ^superOf notNil
! !

!IRSend class methodsFor:'documentation'!

version
    ^'$Id$'
! !