diff -r de981640a2ec -r 0dd36941955f IRConstant.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/IRConstant.st Wed Jun 11 14:54:42 2008 +0000 @@ -0,0 +1,66 @@ +"{ Package: 'stx:goodies/newcompiler' }" + +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]. + type == #blockMethod ifTrue:[^interpreter pushBlockMethod: constant]. + self shouldNeverBeReached. + + "Modified: / 11-06-2008 / 01:03:20 / Jan Vrany " +! ! + +!IRConstant methodsFor:'testing'! + +isConstant + + ^ true +! + +isConstant: valueTest + + ^ valueTest value: constant +! ! + +!IRConstant class methodsFor:'documentation'! + +version + ^'$Id$' +! !