Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!nntp.sei.cmu.edu!news.psc.edu!wink.radian.com!gatech!news.mathworks.com!rill.news.pipex.net!pipex!blackbush.xlink.net!ins.net!heeg.de!uucp
From: Hans-Martin Mosner <hmm@heeg.de>
Subject: Re: Send bytecodes in VW2.51 - help needed
Content-Type: text/plain; charset=us-ascii
Message-ID: <3326DAED.43E2@heeg.de>
Sender: uucp@heeg.de
Content-Transfer-Encoding: 7bit
Organization: Georg Heeg Objektorientierte Systeme
References: <332539A6.158D@informatik.tu-ilmenau.de>
Mime-Version: 1.0
Date: Wed, 12 Mar 1997 16:33:49 GMT
X-Mailer: Mozilla 2.01I [de] (WinNT; I)
Lines: 32

Witold Wendrowski wrote:
> 
> Does anybody know the difference between:
>         - (simple) send,
>         - no-check send, and
>         - non-immediate send
> bytecodes in VW 2.51?
> 
> Thx, Witold Wendrowski

The VisualWorks VM uses the difference for optimization in the 
in-line-cache.

No-check sends are generated by the compiler for sends where 
it is known that the class of the receiver cannot change. 
Example: sending #at: to a literal array. (Yes I know that you 
could mess up the compiled method so that the class changes 
anyway... But you shouldn't!)
(Sends to super are translated similarly, as the class in 
which the super method will be found is fixed.)

Non-immediate sends are generated for sends to self where the 
compiler knows that the class in which the method is compiled 
does not have immediate subclasses (such as SmallInteger or 
Character). This is used to avoid checking the receiver for 
immediateness.

Both of these optimizations can save a few cycles in the 
native code, but not many. Even so, these cycles add up to 
measurable times...

Hans-Martin
