"Just Curious" VM question

John M McIntosh johnmci at smalltalkconsulting.com
Tue Sep 16 03:17:52 UTC 2003


On Monday, September 15, 2003, at 04:50  PM, Andreas Raab wrote:

> Hi Tim,
>
>> Unless we want to make damn big table somewhere I'd suggest
>> putting the address of the relevant prim function in the cache
>> instead of the index we currently use. Slang isn't terribly
>> clean for this but never mind. Sure we can come up with something.
>
> Been there done that ;-) Turns out that some ABIs (==MacOS) have a  
> really
> stupid overhead when a function call goes "cross-fragment" and the  
> burden to
> determine this is with the caller and not the callee. In other words,  
> if you
> call a "function through pointer" you have a measurable overhead when  
> you do
> it often enough.

? I'm not sure what you are referring to here, When you invoke under  
os-x
static void *findExternalFunctionIn(char *functionName, ModuleEntry  
*module)
you get back the address of the code.

Now under os-9 in the past, say for 68K code you would get the address  
of a jumptable/stub
which would jump you to the real code, or jump you to a routine to load  
the code out
of the resource fork because you had code fragments that you  
could/would unload to
save space on your 128k! machine.

See
http://developer.apple.com/documentation/mac/pdf/ 
MacOS_RT_Architectures.pdf

For powerPc os-7-9 based CFM PEF based code resource, thus all the  
powerpc classic VMs, the exported
symbols, internal symbols are bound to addresses when the  
DLL/plugin/code fragment is loaded, so you didn't have jump tables  
involved anymore.

For os-x it's a mach-o based code resources. Basically a cleaner method  
of doing calls between DLLS
http://developer.apple.com/documentation/DeveloperTools/Conceptual/ 
MachORuntime/
MachORuntime.pdf a lot more interesting things can happen to resolve  
symbols and share code, but
address are rather direct, no jumptables. You do of course need to  
setup calling registers because
that is required to find global sections, code data sections etc. But I  
don't think that is what you
referred to, rather I think it was the 68K jump table logic? Yes?


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