globals as structure

John M McIntosh johnmci at smalltalkconsulting.com
Thu Nov 21 18:45:58 UTC 2002


On Thursday, November 21, 2002, at 01:10  AM, Marcel Weiher wrote:

> However, my ulterior motive in all of this is still turning the Squeak  
> interpreter into a real object, and I wouldn't mind at all if it were  
> structurally equivalent to an Objective-C object.
>
> With all the globals in a structure, we are already part of the way  
> there ( adding an "isa" pointer to the start of that structure doesn't  
> seem like such a big deal).

You're welcome to look at the global structure code and tinker. Right  
now a variable or two is excluded from
the structure because it's hardcoded in a cCode: message send, the send  
should actually become a proper slang
message, there are a few variables which get initialized so that  
doesn't work. See Tim's code for setting the register and that  
initialization could occur there, and lastly I don't stick arrays in  
the structure. Why? Well the gcc compiler produces interesting ugly  
code on ppc if you do that. However I did not attempt to malloc space  
for the array, then have the variable in the structure be a pointer to  
that storage area, perhaps that would produce better code.

--
======================================================================== 
===
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