Paolo Bonzini wrote:
Maybe I can reuse the existing parameter stuff around #cCall: for
inbound calls.
If you want to warm up with that code, you might start converting this
part of it to Smalltalk:
desc->returnType = classify_type_symbol (returnTypeOOP, true);
if (desc->returnType == _gst_nil_oop)
goto error;
for (i = 1; i <= numArgs; i++)
{
OOP type;
type = desc->argTypes[i - 1] =
classify_type_symbol (ARRAY_AT (argsOOP, i), false);
if (type == _gst_nil_oop)
goto error;
}
... together with symbol_type_map, type_map, classify_type_symbol.
Actually, what I meant is that this code is duplicated in C and
Smalltalk (kernel/CFuncs.st). It would be interesting to use only the
Smalltalk one. To this end, the C primitive VMpr_CFuncDescriptor_create
(defined in prims.def and cint.c) should be simplified to just return
the address of a C function. Everything else can be done in Smalltalk.
Paolo
_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk