IRSend.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 30 Oct 2014 21:43:54 +0000
changeset 41 f3898a3b378d
parent 37 be8c2dd09dff
child 42 acdc3ec6d152
permissions -rw-r--r--
Package renamed from cvut:stx/goodies/newcompiler to ctu:ircompiler

"{ Package: 'ctu:ircompiler' }"

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$'
!

version_CVS
    ^ 'Header: /cvs/stx/cvut/stx/goodies/newcompiler/IRSend.st,v 1.3 2009/10/08 12:03:48 fm Exp '
!

version_SVN
    ^ '$Id::                                                                                                                        $'
! !