IRClosure.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 30 Mar 2009 17:49:01 +0000
changeset 10 0fd549e0c784
parent 9 04518c7fb91c
child 11 0a50d475c1ff
permissions -rw-r--r--
First simple block works. See IRBuilderTest>>testBlock_blockTempArg. More tests are comming.

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

IRFunction subclass:#IRClosure
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'NewCompiler-IR'
!


!IRClosure methodsFor:'accessing'!

environmentIr
    ^ environmentIr
!

environmentIr:something
    environmentIr := something.
! !

!IRClosure methodsFor:'accessing - defaults'!

defaultCompiledCodeClass
    "raise an error: must be redefined in concrete subclass(es)"

    ^Block

    "Modified: / 30-03-2009 / 16:36:02 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !

!IRClosure methodsFor:'instructions - helpers'!

tempArgKindForLevel:level
    "Superclass IRFunction says that I am responsible to implement this method"

    ^level isZero 
        ifTrue: [#BArg]
        ifFalse:[#OBArg]

    "Modified: / 30-03-2009 / 18:36:30 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

tempVarKindForLevel:level
    "Superclass IRFunction says that I am responsible to implement this method"

    self shouldImplement
! !

!IRClosure methodsFor:'testing'!

isIRClosure
    ^ true
! !

!IRClosure class methodsFor:'documentation'!

version
    ^'$Id$'
! !