#551: t/pmc/nci.t: 2 test failures
---------------------+------------------------------------------------------
Reporter: jkeenan | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: none | Version:
Severity: medium | Keywords: pmc nci pointer
Lang: | Patch:
Platform: |
---------------------+------------------------------------------------------
Comment(by donaldh):
Okay, so both Pointer and UnManagedStruct can be used to store an opaque
pointer that is managed by something else. Quite some time back, I hit a
bug with the custom mark() function in Pointer and discussed/submitted a
patch. It was recommended I try using UnManagedStruct instead so I did.
Anyway, if you modified Pointer PMC to have different semantics, then
you'd also have to change UnManagedStruct and maybe others. So, as you
said, maybe not a good idea.
You're right, I completely missed the fact that the offending tests are
todo-ed.
I applied the donthandle.patch re-enabled the tests which pass of course
because the required signatures are in config/gen/call_list/*. After
adding the call signatures for Sqlite to config/gen/call_list/sqlite3.in,
my code works fine.
For me, this confirms there is no need to modify Pointer.pmc or
nativecall.pl or nci_test.c - they are just a bunch of band aids around
broken jit.
I'm not entirely sure I understand what's happening in
src/jit/i386/jit_defs.c but I'm pretty sure that the problem stems from
not having any mechanism for postamble, which is required by V, 2, 3, and
4. In other words, there is a block of code for preparing the stack before
the function call and a block of code for handling the return value, but
no code for postprocessing the stack for out params.
What's needed is another block that iterates the signature and assigns the
stack value back to the PMC in the relevant cases. I also assume that V
requires a temporary for the pointer so that the address of the temporary
can be put on the stack instead of the pointer itself, since V represents
a void**.
My i386 assembly knowledge is non-existent so it would take me a while to
attempt this. Does my description make enough sense for someone else to
try?
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/551#comment:12>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets