IRJumpIf.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 13 May 2009 09:30:49 +0000
changeset 19 3bb7360f9dff
parent 1 0dd36941955f
child 23 377bc46cad12
permissions -rw-r--r--
- method stackSize is now correctly initialized - #makeBlock offsets are now patched when serializing basic blocks

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

IRJump subclass:#IRJumpIf
	instanceVariableNames:'boolean otherwise'
	classVariableNames:''
	poolDictionaries:''
	category:'NewCompiler-IR'
!

IRJumpIf comment:'Instruction "if: boolean goto: labelNum1 otherwise: labelNum2"'
!


!IRJumpIf methodsFor:'acessing'!

boolean

	^ boolean
!

boolean: bool

	boolean _ bool
!

otherwise

	^ otherwise
!

otherwise: aSequence

	otherwise := aSequence
!

successorSequences

	^ {destination. otherwise}
! !

!IRJumpIf methodsFor:'interpret'!

executeOn: interpreter

	^ interpreter if: boolean goto: destination orderNumber otherwise: otherwise orderNumber
! !

!IRJumpIf methodsFor:'testing'!

isGoto
	"is unconditional jump"

	^ false
!

isIf

	^ true
! !

!IRJumpIf class methodsFor:'documentation'!

version
    ^'$Id$'
! !