{"issue":{"state":"open","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"milestone":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/d1588981e0248aaa0174906c99df180e?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"d1588981e0248aaa0174906c99df180e","url":"https://api.github.com/users/petdance","login":"petdance","id":41100},"labels":[{"name":"core","color":"A37D9A","url":"https://api.github.com/repos/petdance/scratch/labels/core"},{"name":"Pri-normal","color":"64C2DA","url":"https://api.github.com/repos/petdance/scratch/labels/Pri-normal"},{"name":"rfc","color":"0CF239","url":"https://api.github.com/repos/petdance/scratch/labels/rfc"},{"name":"Sev-medium","color":"8F0079","url":"https://api.github.com/repos/petdance/scratch/labels/Sev-medium"}],"assignee":null,"updated_at":"2011-11-14T06:01:37Z","comments":0,"closed_at":null,"url":"https://api.github.com/repos/petdance/scratch/issues/700","body":"opcodes that take a variadic number of arguments are difficult to work with. Some examples of these (maybe the only examples of them) are set_args, get_params, set_returns, and get_results. These ops take lists of values to pass/receive in a call. The first arg to the op is a string or an FIA that contains information about the number of ops that follow.\nAt the very least, these ops should be flagged to identify them as being special. This way a PIR-based disassembler can identify them and produce a better listing.\r\n\r\nFar better idea, in my mind, would be refactoring these ops entirely so that they no longer take variadic lists of arguments. Instead, I suggest we could have IMCC build CallContext PMCs (or a new kind of proto-CallSignature PMC instead, depending on preprocessing requirements) at compile time and store them in the constants table. So set_args_p would change from taking an FIA with a series of flags and then a variadic argument list to taking a single \"CallArguments\" PMC which would contain all the same information, but in a form that was much easier to work with. Since information about the arguments to a function call are already stored as constants in the bytecode stream directly, we can easily convert this to a PMC constant with no loss of dynamicism. If anything we gain more dynamicism because we gain the ability to construct argument lists at runtime without having to explicitly use :flat.\r\n\r\nThese kinds of refactors would dovetail nicely with other PCC refactors currently planned.\r\n\r\nIdeas?\r\n\r\n\r\nOriginally http://trac.parrot.org/parrot/ticket/1468","html_url":"https://github.com/petdance/scratch/issues/700","number":700,"title":"variadic opcodes make assembly/disassembly difficult","id":2226060,"created_at":"2011-11-14T06:01:37Z"},"action":"opened"}