[Vm-dev] Re: Uploaded squeak-vm 3.11.3

John M McIntosh johnmci at smalltalkconsulting.com
Wed Jan 27 17:47:37 UTC 2010


On 2010-01-27, at 9:28 AM, Eliot Miranda wrote:

> # define DECL_MAYBE_SQ_GLOBAL_STRUCT register struct foo * foo = &fum;
> # define DECL_MAYBE_VOLATILE_SQ_GLOBAL_STRUCT volatile register struct foo * foo = &fum;

BTW the register struct foo * foo = &fum stuck in the different procedures, (interp() can be different btw), 
was based on usage, I think use of > twice or something then it was inserted, otherwise it was not. 

At the time on the PowerPC the compiler would need 2 instructions to reference foo->erk, loading foo out of the global area, then doing foo->fum
If foo was local to the procedure then it was one instruction taking foo in register N and loading with offset.  So you needed > 2 references to 
justify the cost of loading into a register then using. The use of register keyword over time is respected or not by the compiler and compiler version.

For interp() the construct for referring to foo can significantly effect bytecode rates again depending on the compiler etc. 


--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20100127/e7572329/attachment-0001.htm


More information about the Vm-dev mailing list