|
From: Andreas R. <and...@gm...> - 2004-04-08 22:47:21
|
Tim,
> That could save time in the primitive code, but what would it cost in
> the calling code? Outside of a translator, how would we load up the
> registers (and think of the platform differences in which registers and
> how many etc)? Wouldn't it end up with primitiveResponse looking like
>
> switch(numArgs) {
> case 1: (prim)(*sp); break;
> case 2: (prim)(*sp, *s--p); break;
> etc
> which surely wouldn't net much benfit?
The idea was that you would specify primitives with arguments (like FFI
and/or SmartInterpreterplugin) and then glue gets generated for the
interpreter. So it would actually look somewhat along the lines of:
int gluePrimitiveAt() {
return primitiveAt(stackTop())
}
int primitiveAt(oop index) {
/* yaddaya */
}
Cheers,
- Andreas
|