Henrik,
It's entirely possible to do this but it has quite a number of implications. Such as, you have to ensure that the message you're invoking does not return outside the receiver's frame (e.g. through a non-local return). If it does (or gets prematurely terminated from a debugger) you are in deep trouble. In other words - don't even think about it unless you have 180% fool-proof exception and unwind handling system. Then, there is also quite a bit of a problem when you think about invoking multiple messages like this - if you invoke message A in process A then message B in process B and then (after the process switch) message A tries to return, you'd have to return through the C stack frame of message B. Good luck :-)
Messy. That stuff's so messy. I thought about it when doing the FFI stuff but the possible complications were just way to much for me...
- Andreas
-----Original Message----- From: Henrik Gedenryd [mailto:Henrik.Gedenryd@lucs.lu.se] Sent: Wednesday, November 01, 2000 1:38 AM To: squeak@cs.uiuc.edu Cc: recipient list not shown Subject: Re: [VM] Hooks from module into platform support code?
Forgive me if I am overlooking something really obvious, but while we're almost on the topic, what is it prevents one from doing ordinary message sends from C code by having the equivalent of the exact bytecodes of a message send as a sequence of (Slang-generated) C code? This is what I thought that exception code was doing when it triggers a method for block unwinding or something.
Is it something like the interpreter not being reentrant?
Henrik
squeak-dev@lists.squeakfoundation.org