globals as structure

John M McIntosh johnmci at smalltalkconsulting.com
Thu Nov 21 06:11:34 UTC 2002


Marcel if you dig around a bit in the GCC compiler options you'll note  
a feature to hardwire a
register to a specific usage. IE you could define the global structure  
pointer to point to
register 25, then you tell GCC to compile everything, including all the  
plugins not to use register
25 for general purposes.

Tim has a change set that sets the register before things get started,  
in the past when I
spent an hour or two trying this I was defeated by some of the image  
loading code that initializes the
structure as part of opening the image file. Tims patch/changeset  
suggestion? make the
register initialization occur very early avoid these problems.

Certainly worth looking at.

Downside is that using an old plugin causes an immediate core dump.

On Wednesday, November 20, 2002, at 02:33  PM, Tim Rowledge wrote:

> Marcel Weiher <marcel at metaobject.com> is claimed by the authorities to  
> have written:
>
>> By the way, couldn't passing the pointer to the interpreter struct to
>> each function be faster still?  After all, registers are probably
>> plentyful, and that would eliminate access to the global structure
>> pointer.  Of course, that would mean altering the signature of the C
>> functions.
> It's likely to be very cpu specific - remember, x86s only have three  
> (or
> is it four, or five?) registers not already dedicated to something or
> other. PPC has quite a few, ARM has a modest surplus, Alpha has a
> gazillion etc etc. It's one of those details that one ought to be able
> to leave to a compiler but can't really trust completely.
>
> Notwithstanding that matter it would be nice to pass args etc to the
> primitives in a 'normal' manner so that we could take advantage of the
> cpus calling conventions properly.
>
> tim
>
> --  
> Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
> "Bother," said Pooh, as he fell into the nitric acid bath.
>
>
>
>
--
======================================================================== 
===
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