UnaryNode.st
changeset 110 96fc5c3540f1
parent 104 2016bfa4cd45
child 135 aa4f7b8f121e
--- a/UnaryNode.st	Thu Aug 17 18:10:39 1995 +0200
+++ b/UnaryNode.st	Sat Aug 19 03:44:18 1995 +0200
@@ -21,7 +21,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libcomp/UnaryNode.st,v 1.15 1995-08-11 20:28:36 claus Exp $
+$Header: /cvs/stx/stx/libcomp/UnaryNode.st,v 1.16 1995-08-19 01:44:18 claus Exp $
 '!
 
 !UnaryNode class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libcomp/UnaryNode.st,v 1.15 1995-08-11 20:28:36 claus Exp $
+$Header: /cvs/stx/stx/libcomp/UnaryNode.st,v 1.16 1995-08-19 01:44:18 claus Exp $
 "
 !
 
@@ -214,6 +214,21 @@
 	]
     ].
 
+    "
+     optimize 
+	Float pi
+    "
+    (selector == #pi) ifTrue:[
+	(receiver isGlobal) ifTrue:[
+	    receiver name = 'Float' ifTrue:[
+		aCompiler addLiteral:#Float; addLiteral:selector.
+		(ConstantNode type:#Float value:(Float pi))
+		    codeOn:aStream inBlock:b for:aCompiler.
+		^ self
+	    ]
+	]
+    ].
+
     ^ super codeOn:aStream inBlock:b for:aCompiler
 ! !