IRConstant.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:#IRConstant
	instanceVariableNames:'constant type'
	classVariableNames:''
	poolDictionaries:''
	category:'NewCompiler-IR'
!

IRConstant comment:'Instruction "pushLiteral: object"'
!


!IRConstant methodsFor:'accessing'!

constant

	^ constant
!

constant: object

	constant _ object
!

type
	"type is nil, #block, or #blockMethod"

	^ type
!

type: symbol
	"symbol is nil, #block, or #blockMethod"

	type _ symbol
! !

!IRConstant methodsFor:'interpret'!

executeOn: interpreter

    type == nil ifTrue:[^interpreter pushLiteral: constant].
    type == #block ifTrue:[^interpreter pushBlock: constant].
    self shouldNeverBeReached.

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

!IRConstant methodsFor:'testing'!

isConstant

	^ true
!

isConstant: valueTest

	^ valueTest value: constant
! !

!IRConstant class methodsFor:'documentation'!

version
    ^ '$Id$'
!

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

version_SVN
    ^ '$Id::                                                                                                                        $'
! !