# HG changeset patch # User Jan Vrany # Date 1242492665 0 # Node ID 7d49846b36bdd42e92e3feaa57c423d21704eb67 # Parent 3bb7360f9dff1f02bffb698370124d4967eab691 pushLiteral: instruction optimized diff -r 3bb7360f9dff -r 7d49846b36bd IRBytecodeGenerator.st --- a/IRBytecodeGenerator.st Wed May 13 09:30:49 2009 +0000 +++ b/IRBytecodeGenerator.st Sat May 16 16:51:05 2009 +0000 @@ -271,26 +271,36 @@ "Modified: / 11-06-2008 / 14:19:57 / Jan Vrany " ! -pushLiteral: object - - stack push. +pushLiteral:object + stack push. - self - nextPut: #pushLitS; - nextPut: (self addLiteral: object). + object == nil ifTrue:[^self nextPut: #pushNil]. + object == 0 ifTrue:[^self nextPut: #push0]. + object == 1 ifTrue:[^self nextPut: #push1]. + object == 2 ifTrue:[^self nextPut: #push2]. + object == -1 ifTrue:[^self nextPut: #pushMinus1]. + object == true ifTrue:[^self nextPut: #pushTrue]. + object == false ifTrue:[^self nextPut: #pushFalse]. - "Modified: / 03-11-2008 / 14:32:04 / Jan Vrany " + self + nextPut:#pushLitS; + nextPut:(self addLiteral:object). + + "Modified: / 16-05-2009 / 18:16:26 / Jan Vrany " ! -pushLiteralVariable: object +pushLiteralVariable:object - stack push. + self + assert: object isSymbol + message: 'Literal variables are identified by symbols!!'. - self - nextPut: #pushGlobalS; - nextPut: (self addLiteral: object) + stack push. + self + nextPut:#pushGlobalS; + nextPut:(self addLiteral:object) - "Modified: / 11-06-2008 / 14:13:42 / Jan Vrany " + "Modified: / 16-05-2009 / 18:00:17 / Jan Vrany " ! pushMethodArg: index