Extracting native code from C

John M McIntosh johnmci at smalltalkconsulting.com
Wed Mar 13 17:32:06 UTC 2002


>John M McIntosh <johnmci at smalltalkconsulting.com> wrote:
>>  Normally you need to indicate to the hosting OS and processor that
>>  this chunk of data is now instructions. This becomes very important
>>  where you have hardware architectures that have different cache lines
>>  for data and for instructions.
>>  You should take a look at the jitter 3 stuff.
>
>I did but I could not find where it was doing anything like this.  Is there
>a C system call that we can use for designating memory as code or data? 
>If there is maybe we can #ifdef it out for platforms that don't need it and
>don't understand it.
>
>Bert Freudenberg <bert at isg.cs.uni-magdeburg.de> wrote:
>>  SunOS: works
>  > IRIX: crash
>
>Thanks, Bert.  Do you think the IRIX crash is related to what John is
>saying above?


Ah, when I was helping Ian with the jitter 3 ppc stuff amazingly 
enough I found at the time there was NO call you could make in Linux 
to indicate this set of memory address is now instructions. I 
snatched some code from BSD with some careful reading of the 
instruction manual to made it a bit better. This code now runs in 
*all* smalltalks that do JIT translation on ppc.

Of course if you know what the magic assembler instructions are you 
too can grep the BSD or Linux source code hunting for an example.
-- 
--
===========================================================================
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