Re: [PATCH 1/2] kernel: Make >>#new/>>#new: go through >>#initialize

Paolo Bonzini <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.gnu.general
Message-ID <[email protected]>
Il 01/08/2014 21:04, Holger Hans Peter Freyther ha scritto:
> 
> a.) VMpr_Behavior_basicNewInitialize will lookup_selector (cache) and
> notice that Object>>#initialize is an empty method and we can skip the
> call.
> 
> b.) >>#initialize is custom with real code but I calling
> _gst_send_message_internal will not lead to the code being executed
> but we already return from the primitive. What would be nice is to
> have a PRIM_SEMI_SUCCEED and just call >>#initialize. This doesn't seem
> to be possible right now.

The primitive can send #initialize just like perform: does.  It does not
even need to check if it is empty, _gst_send_message_internal will do
that.  You save the creation of the MethodContext; the disadvantage is
that #new will not appear in the backtrace, and that the JIT will not be
able to use an inline cache.

Paolo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.