[NewCompiler] IRTranslator>>send:
Marcus Denker
denker at iam.unibe.ch
Tue Dec 12 12:24:47 UTC 2006
On 01.12.2006, at 21:57, Mathieu Suen wrote:
> Hi,
>
> What the first part of this method served for?
>
> ((#(#privGetInstVar: #privStoreIn:instVar: ) identityIncludes:
> selector)
> ...
>
Smalltalk level explanation: this is a pattern used instead of a more
complex(?)
((selector = #privGetInstVar) or: [selector #privStoreIn:instVar:])
When there are lots of things to test against, it's a nice pattern.
In this case, you could
ask if it is really needed.
Compiler level explanation:
In Closure mode, all instVar access is modeled (on the level of the
IR) as a "Field access"
in some environment (which can be the object or a closure environment
or...).
e.g. IRInstVarStore:
Preferences compileBlocksAsClosures
ifFalse: [interpreter storeInstVar: number]
ifTrue: [interpreter pushLiteral: number.
interpreter send: #privStoreIn:instVar:].
this send then is optimized away in IRTranslator>>#send in the case
it can be
modeled using a instVar access bytecode. This is not always the case,
e.g. when
privStoreIn:instVar: is called not on the receiver but on some
Closure Environemnt
for an escaping temp.
(see ITTranslator>>#storeTemp)
I'm sure all this can be cleaned up a bit...
Marcus
> I have see that is only use when the BlocksClosures are on(AFAIK)
> but I don't really understand what
> is going on.
>
> Thanks
>
> Math
>
>
>
>
>
> ______________________________________________________________________
> _____
> Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et
> son interface révolutionnaire.
> http://fr.mail.yahoo.com
More information about the Newcompiler
mailing list