#218: can't sort a PIR subclass of an RPA.
-------------------------+--------------------------------------------------
Reporter: coke | Owner: whiteknight
Type: bug | Status: reopened
Priority: normal | Milestone: 1.1
Component: core | Version:
Severity: high | Resolution:
Keywords: tcl blocker | Lang:
Patch: | Platform: all
-------------------------+--------------------------------------------------
Comment(by whiteknight):
I've added a quick patch here to demonstrate one possible way forward.
This creates two new opcodes, get_label and set_label. Uses:
*get_addr: Used to get a unique pointer value of the PMC. Probably
something like {{{$1 = PTR2OPCODE_T(SELF)}}}
*set_addr: I'm not sure I see a use for this anymore (doesn't make sense
to allow a user to arbitrarily set the memory address of a PMC)
*get_label: Calls {{{VTABLE_get_pointer()}}} to get the pointer value of a
PMC, does some rudimentary error checking to ensure the returned value is,
indeed, a valid pointer into the current packfile, and returns that. My
implementation doesn't currently do this error checking because I don't
know squat about packfiles.
*set_label: Calls {{{VTABLE_set_pointer(interp, $1, (CUR_OPCODE) + $2)}}},
after doing some rudimentary error checking to ensure the passed pointer
value is indeed a valid offset into bytecode. Again, I don't do any such
error checking in my patch.
With this change, we can migrate Sub, ExceptionHandler, and Continuation
PMCs to use get_label/set_label instead of get_addr/set_addr to set their
label values. Then we can change get_addr to return something like {{{ $1
= (INTVAL)$2; }}}, but with proper casting. Any objections if I start
editing DEPRECATED now to get this plan into motion?
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/218#comment:18>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets