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@smalltalkconsulting.com>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com