Leopold Toetsch wrote:

Sam Ruby wrote:

But I need to do more than that. I need to do what Parrot_run_meth_fromc_args is attempting to do (i.e., create a return continuation and do argument or returnvalue passing.), but correctly.

1) runops_fromc and friends are running *opcodes*, nothing else 2) the functions are working, nothing needs fixing here.

I've made a clone of these functions, and made the relevant fixes to my copy. Hopefully someday this will get refactored back into Parrot.


For the record, in the test case I provided, I was calling Parrot_run_meth_fromc_args twice. The first time with a real Sub. One implemented with opcodes. Or, as you prefer to say it, *opcodes*. It was this call that did not restore the context interpreter->ctx.bp. As near as I can tell, this path is identical to the usage in classes/delegate.c. In other words, it is an accident waiting to happen.

Take a look at Parrot_PyClass_runops_fromc. If you do, you will see that I am only restoring the value of interpreter->ctx.bp if dest is non-zero. Think about it.

The second time I called Parrot_run_meth_fromc_args, it was with an NCI method. The only problem is that in this call, the parameters were set into registers after the invoke call. I believe it to be customary to set the parameters into registers prior to the invoke call. In fact, I have logic in PyFunc.pmc (again which is used to invoke Python functions which are implemented in opcodes, er, I mean *opcodes*), which depends on things happening in this order in order to handle defaults and varargs.

I've already stated several times: let's adjust Parrot's method dispatch and overloaded method signatures, so that it's directly usable for target languages. When that is done, you can get rid of all the additional dispatch functions.

I am not interested in discussing this any more.

The current Parrot has bugs. I've notified you of a number of them. You are apparently not interested as you would prefer to rewrite Parrot instead. Undoubtably, at that time it will have a different set of bugs. At which point, undoubtably, the process will repeat.

Onward.

- Sam Ruby

Reply via email to