Extracting native code from C

Tim Rowledge tim at sumeru.stanford.edu
Wed Mar 13 18:08:49 UTC 2002


Anthony's suggestion seems extremely similar to how Eliot Miranda's
threaded code sorta-jit worked about fifteen years ago. I vaguley recall
some trickery to persuade the compiler (I think it only really worked
for SUN, but this is a _long_ time ago) to deal with the
data/instruction stuff. I also used a similar type of trick for a self
compiling BitBlt on the ARM, but that was easy; no caches _at all_ to
worry about :-)

These days, with so many processors having separate data and instruction
caches and wildly varying ways of handling them it is a really difficult
thing to get exactly right for all cpus.

Warning: ancient greybeard story on horizon, skip if bored!

A long time ago in a valley far away there was a company making a really
neat Smalltalk system. They had a jolly good dynamic translator for it,
back way before the Silly Unuchs of Nowhere claimed to have invented
JITtering. Then, something went wrong on a new machine and it mightily
strained the braincells of the great warriors of the company. It turned
out that the precise detail of the instruction cache fluching
instruction had altered and nobody thought to document it. Instead of
"flush A to E" meaning flush addresses A,B,C,D & E it had changed to
mean flush A,B,C & D. Thus the newly generated block of code did not get
cached properly and Odd Things Happened.

tim
-- 
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Host System Not Responding, Probably Down.  Do you want to wait?  (Y/N)




More information about the Squeak-dev mailing list