[ENH] Fwd: fetchClassOf & commonSend?

John M McIntosh johnmci at smalltalkconsulting.com
Tue Feb 5 22:58:16 UTC 2002


>
>At 3:02 AM -0400 10/5/01, Scott A Crosby wrote:
>>Date: Sat, 22 Sep 2001 12:40:00 -0700
>>From: Andreas Raab <Andreas.Raab at gmx.de>
>>Reply-To: squeak-dev at lists.squeakfoundation.org
>>To: squeak-dev at lists.squeakfoundation.org
>>Subject: RE: Performance profiling results...
>>
>>Scott,
>>
>>Interesting results!
>>
>>  > Over 99% of the invocations of the function 'fetchClassOf' are when
>>>  invoked from 'commonSend' in the interpreter. (approximately
>>>  350 million).
>>
>>Yup. I see the culprit, it's
>>
>>	receiverClass := lkupClass := self fetchClassOf: rcvr.
>>
>>which doesn't get inlined properly. Should be rewritten as
>>
>>	lkupClass := self fetchClassOf: rcvr.
>>	receiverClass := lkupClass.
>>
>>to eliminate the call.


As far as I can see from the latest update, this change has never 
made it into the image?

normalSend
	"Send a message, starting lookup with the receiver's class."
	"Assume: messageSelector and argumentCount have been set, and 
that the receiver and arguments have been pushed onto the stack,"
	"Note: This method is inlined into the interpreter dispatch loop."

	| rcvr |
	self inline: true.
	self sharedCodeNamed: 'commonSend' inCase: 131.

	rcvr _ self internalStackValue: argumentCount.
	lkupClass _ self fetchClassOf: rcvr.
	receiverClass _ lkupClass.
	self internalFindNewMethod.
	self internalExecuteNewMethod.
	self fetchNextBytecode.

-- 
--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================



More information about the Squeak-dev mailing list