--- a/MessageNode.st Wed Apr 17 13:42:56 1996 +0200
+++ b/MessageNode.st Wed Apr 17 22:40:34 1996 +0200
@@ -481,21 +481,21 @@
|nargs isBuiltIn code codeL litIndex cls clsLitIndex|
argArray isNil ifTrue:[
- nargs := 0
+ nargs := 0
] ifFalse:[
- nargs := argArray size
+ nargs := argArray size
].
isBuiltIn := false.
(nargs == 0) ifTrue:[
- isBuiltIn := aCompiler isBuiltInUnarySelector:selector
+ isBuiltIn := aCompiler isBuiltInUnarySelector:selector forReceiver:receiver
].
(nargs == 1) ifTrue:[
- isBuiltIn := aCompiler isBuiltIn1ArgSelector:selector
+ isBuiltIn := aCompiler isBuiltIn1ArgSelector:selector forReceiver:receiver
].
(nargs == 2) ifTrue:[
- isBuiltIn := aCompiler isBuiltIn2ArgSelector:selector
+ isBuiltIn := aCompiler isBuiltIn2ArgSelector:selector forReceiver:receiver
].
receiver codeOn:aStream inBlock:b for:aCompiler.
@@ -503,66 +503,66 @@
"can we use a send-bytecode ?"
isBuiltIn ifTrue:[
- receiver isSuper ifFalse:[
- (nargs > 0) ifTrue:[
- (argArray at:1) codeOn:aStream inBlock:b for:aCompiler.
- (nargs > 1) ifTrue:[
- (argArray at:2) codeOn:aStream inBlock:b for:aCompiler
- ]
- ].
- aStream nextPut:selector.
- (aCompiler hasLineNumber:selector) ifTrue:[
- aStream nextPut:lineNr.
- ].
- aStream nextPut:#drop.
- ^ self
- ]
+ receiver isSuper ifFalse:[
+ (nargs > 0) ifTrue:[
+ (argArray at:1) codeOn:aStream inBlock:b for:aCompiler.
+ (nargs > 1) ifTrue:[
+ (argArray at:2) codeOn:aStream inBlock:b for:aCompiler
+ ]
+ ].
+ aStream nextPut:selector.
+ (aCompiler hasLineNumber:selector) ifTrue:[
+ aStream nextPut:lineNr.
+ ].
+ aStream nextPut:#drop.
+ ^ self
+ ]
].
"no - generate a send"
argArray notNil ifTrue:[
- argArray do:[:arg |
- arg codeOn:aStream inBlock:b for:aCompiler
- ]
+ argArray do:[:arg |
+ arg codeOn:aStream inBlock:b for:aCompiler
+ ]
].
litIndex := aCompiler addLiteral:selector.
receiver isSuper ifTrue:[
- cls := aCompiler targetClass.
- receiver isHere ifTrue:[
- code := #hereSend.
- codeL := #hereSendL.
- ] ifFalse:[
- code := #superSend.
- codeL := #superSendL.
- cls := cls superclass.
- ].
- clsLitIndex := aCompiler addLiteral:cls.
+ cls := aCompiler targetClass.
+ receiver isHere ifTrue:[
+ code := #hereSend.
+ codeL := #hereSendL.
+ ] ifFalse:[
+ code := #superSend.
+ codeL := #superSendL.
+ cls := cls superclass.
+ ].
+ clsLitIndex := aCompiler addLiteral:cls.
- (litIndex <= 255 and:[clsLitIndex <= 255]) ifTrue:[
- aStream nextPut:code; nextPut:lineNr; nextPut:litIndex; nextPut:nargs; nextPut:clsLitIndex; nextPut:#drop.
- ^ self
- ].
+ (litIndex <= 255 and:[clsLitIndex <= 255]) ifTrue:[
+ aStream nextPut:code; nextPut:lineNr; nextPut:litIndex; nextPut:nargs; nextPut:clsLitIndex; nextPut:#drop.
+ ^ self
+ ].
- "need 16bit litIndex"
- aStream nextPut:codeL; nextPut:lineNr; nextPut:litIndex; nextPut:0; nextPut:nargs; nextPut:clsLitIndex; nextPut:0; nextPut:#drop.
- ^ self
+ "need 16bit litIndex"
+ aStream nextPut:codeL; nextPut:lineNr; nextPut:litIndex; nextPut:0; nextPut:nargs; nextPut:clsLitIndex; nextPut:0; nextPut:#drop.
+ ^ self
].
litIndex <= 255 ifTrue:[
- (nargs <= 3) ifTrue:[
- code := #(sendDrop0 sendDrop1 sendDrop2 sendDrop3) at:(nargs+1).
- aStream nextPut:code; nextPut:lineNr; nextPut:litIndex.
- ^ self
- ].
+ (nargs <= 3) ifTrue:[
+ code := #(sendDrop0 sendDrop1 sendDrop2 sendDrop3) at:(nargs+1).
+ aStream nextPut:code; nextPut:lineNr; nextPut:litIndex.
+ ^ self
+ ].
- aStream nextPut:#sendDrop; nextPut:lineNr; nextPut:litIndex; nextPut:nargs.
- ^ self
+ aStream nextPut:#sendDrop; nextPut:lineNr; nextPut:litIndex; nextPut:nargs.
+ ^ self
].
"need 16bit litIndex"
aStream nextPut:#sendDropL; nextPut:lineNr; nextPut:litIndex; nextPut:0; nextPut:nargs
- "Modified: 11.1.1996 / 16:51:40 / cg"
+ "Modified: 17.4.1996 / 22:33:24 / cg"
!
codeForSideEffectOn:aStream inBlock:b for:aCompiler
@@ -762,7 +762,7 @@
^ self
].
].
- isBuiltIn := aCompiler isBuiltInUnarySelector:selector.
+ isBuiltIn := aCompiler isBuiltInUnarySelector:selector forReceiver:receiver.
isBuiltIn ifFalse:[
isSpecial := aCompiler isSpecialSendSelector:selector
]
@@ -806,7 +806,7 @@
]
]
].
- isBuiltIn := aCompiler isBuiltIn1ArgSelector:selector
+ isBuiltIn := aCompiler isBuiltIn1ArgSelector:selector forReceiver:receiver
].
(nargs == 2) ifTrue:[
@@ -820,7 +820,7 @@
]
]
].
- isBuiltIn := aCompiler isBuiltIn2ArgSelector:selector
+ isBuiltIn := aCompiler isBuiltIn2ArgSelector:selector forReceiver:receiver
].
"can we use a send-bytecode ?"
@@ -977,7 +977,7 @@
].
"Modified: 3.9.1995 / 12:55:42 / claus"
- "Modified: 14.4.1996 / 01:05:40 / cg"
+ "Modified: 17.4.1996 / 22:34:02 / cg"
!
codeOrIfOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler
@@ -1075,114 +1075,114 @@
|nargs isBuiltIn code codeL litIndex cls clsLitIndex|
argArray isNil ifTrue:[
- nargs := 0
+ nargs := 0
] ifFalse:[
- nargs := argArray size
+ nargs := argArray size
].
isBuiltIn := false.
(nargs == 0) ifTrue:[
- isBuiltIn := aCompiler isBuiltInUnarySelector:selector
+ isBuiltIn := aCompiler isBuiltInUnarySelector:selector forReceiver:receiver
].
(nargs == 1) ifTrue:[
- isBuiltIn := aCompiler isBuiltIn1ArgSelector:selector
+ isBuiltIn := aCompiler isBuiltIn1ArgSelector:selector forReceiver:receiver
].
(nargs == 2) ifTrue:[
- isBuiltIn := aCompiler isBuiltIn2ArgSelector:selector
+ isBuiltIn := aCompiler isBuiltIn2ArgSelector:selector forReceiver:receiver
].
"can we use a send-bytecode ?"
isBuiltIn ifTrue:[
- receiver isSuper ifFalse:[
- (nargs > 0) ifTrue:[
- (argArray at:1) codeOn:aStream inBlock:b for:aCompiler.
- (nargs > 1) ifTrue:[
- (argArray at:2) codeOn:aStream inBlock:b for:aCompiler
- ]
- ].
- aStream nextPut:selector.
- (aCompiler hasLineNumber:selector) ifTrue:[
- aStream nextPut:lineNr.
- ].
- valueNeeded ifFalse:[
- aStream nextPut:#drop
- ].
- ^ self
- ]
+ receiver isSuper ifFalse:[
+ (nargs > 0) ifTrue:[
+ (argArray at:1) codeOn:aStream inBlock:b for:aCompiler.
+ (nargs > 1) ifTrue:[
+ (argArray at:2) codeOn:aStream inBlock:b for:aCompiler
+ ]
+ ].
+ aStream nextPut:selector.
+ (aCompiler hasLineNumber:selector) ifTrue:[
+ aStream nextPut:lineNr.
+ ].
+ valueNeeded ifFalse:[
+ aStream nextPut:#drop
+ ].
+ ^ self
+ ]
].
argArray notNil ifTrue:[
- argArray do:[:arg |
- arg codeOn:aStream inBlock:b for:aCompiler
- ]
+ argArray do:[:arg |
+ arg codeOn:aStream inBlock:b for:aCompiler
+ ]
].
receiver isSuper ifTrue:[
- cls := aCompiler targetClass.
- receiver isHere ifTrue:[
- code := #hereSend.
- codeL := #hereSendL
- ] ifFalse:[
- code := #superSend.
- codeL := #superSend.
- cls := cls superclass.
- ].
- clsLitIndex := aCompiler addLiteral:cls.
+ cls := aCompiler targetClass.
+ receiver isHere ifTrue:[
+ code := #hereSend.
+ codeL := #hereSendL
+ ] ifFalse:[
+ code := #superSend.
+ codeL := #superSend.
+ cls := cls superclass.
+ ].
+ clsLitIndex := aCompiler addLiteral:cls.
- litIndex := aCompiler addLiteral:selector.
- (litIndex <= 255 and:[clsLitIndex <= 255]) ifTrue:[
- aStream nextPut:code; nextPut:lineNr; nextPut:litIndex; nextPut:nargs; nextPut:clsLitIndex.
- ] ifFalse:[
- aStream nextPut:codeL; nextPut:lineNr; nextPut:litIndex; nextPut:0; nextPut:nargs; nextPut:clsLitIndex; nextPut:0.
- ].
- valueNeeded ifFalse:[
- aStream nextPut:#drop
- ].
- ^ self
+ litIndex := aCompiler addLiteral:selector.
+ (litIndex <= 255 and:[clsLitIndex <= 255]) ifTrue:[
+ aStream nextPut:code; nextPut:lineNr; nextPut:litIndex; nextPut:nargs; nextPut:clsLitIndex.
+ ] ifFalse:[
+ aStream nextPut:codeL; nextPut:lineNr; nextPut:litIndex; nextPut:0; nextPut:nargs; nextPut:clsLitIndex; nextPut:0.
+ ].
+ valueNeeded ifFalse:[
+ aStream nextPut:#drop
+ ].
+ ^ self
].
(nargs == 0) ifTrue:[
- (selector == #yourself) ifTrue:[
- "yourself is often added to get the receiver -
- we get it without the yourself-message"
+ (selector == #yourself) ifTrue:[
+ "yourself is often added to get the receiver -
+ we get it without the yourself-message"
- valueNeeded ifFalse:[
- aStream nextPut:#drop
- ].
- ^ self
- ].
+ valueNeeded ifFalse:[
+ aStream nextPut:#drop
+ ].
+ ^ self
+ ].
].
litIndex := aCompiler addLiteral:selector.
litIndex <= 255 ifTrue:[
- (nargs <= 3) ifTrue:[
- valueNeeded ifTrue:[
- code := #(send0 send1 send2 send3) at:(nargs+1).
- ] ifFalse:[
- code := #(sendDrop0 sendDrop1 sendDrop2 sendDrop3) at:(nargs+1).
- ].
- aStream nextPut:code; nextPut:lineNr; nextPut:litIndex.
- ^ self
- ].
+ (nargs <= 3) ifTrue:[
+ valueNeeded ifTrue:[
+ code := #(send0 send1 send2 send3) at:(nargs+1).
+ ] ifFalse:[
+ code := #(sendDrop0 sendDrop1 sendDrop2 sendDrop3) at:(nargs+1).
+ ].
+ aStream nextPut:code; nextPut:lineNr; nextPut:litIndex.
+ ^ self
+ ].
- valueNeeded ifTrue:[
- code := #send
- ] ifFalse:[
- code := #sendDrop
- ].
- aStream nextPut:code; nextPut:lineNr; nextPut:litIndex; nextPut:nargs.
- ^ self
+ valueNeeded ifTrue:[
+ code := #send
+ ] ifFalse:[
+ code := #sendDrop
+ ].
+ aStream nextPut:code; nextPut:lineNr; nextPut:litIndex; nextPut:nargs.
+ ^ self
].
valueNeeded ifTrue:[
- code := #sendL
+ code := #sendL
] ifFalse:[
- code := #sendDropL
+ code := #sendDropL
].
aStream nextPut:code; nextPut:lineNr; nextPut:litIndex; nextPut:0; nextPut:nargs
- "Modified: 11.1.1996 / 16:46:41 / cg"
+ "Modified: 17.4.1996 / 22:33:35 / cg"
!
codeTimesRepeatOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler
@@ -1575,5 +1575,5 @@
!MessageNode class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libcomp/MessageNode.st,v 1.44 1996-04-13 23:05:55 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libcomp/MessageNode.st,v 1.45 1996-04-17 20:40:34 cg Exp $'
! !