17 | | * Add lots of documentation about signature strings, CallSignature, dispatch, etc |
18 | | |
19 | | * ~~Change the default vtable function generator for Object PMC to generate 'Parrot_pcc_invoke_sub_from_c_args' calls instead of 'Parrot_runops_fromc_args*' calls.~~ |
20 | | |
21 | | == CallSignature PMC Refactor == |
22 | | |
23 | | * Refactor CallSignature to store arguments as a typed array, instead of as a PMC array. The types we know from the signature, so can store and retrieve the elements in a type-safe way. (Suggestion from IRC discussion was to use a union for the value storage.) This will reduce the number of PMCs created, since integer, number, and string arguments can be stored directly instead of boxed in PMCs. |
24 | | |
25 | | * Refactor CallSignature to store arguments directly in CallSignature data structure, instead of creating two additional PMCs (array for positionals and hash for named) to hold them. This refactor can be done at the same time as the typed array refactor. |
26 | | |
27 | | * Refactor CallSignature to no longer store returns at all (after the args/returns unification above). Returns will reuse the arg/param call signature object, or create a new one. |
28 | | |
29 | | * Refactor CallSignature to merge it with Context, only need one PMC to hold all that information. (Question: what's the implication of this combined with the previous refactor? Do returns get passed out in the same struct members that the arguments came in on?) |
| 22 | * Remove sections of CallContext PMC that were used for storing and manipulating returns inside the parameters signature. (Returns will reuse the arg/param call context object, or create a new one.) |
| 23 | - 'results_signature', 'current_results', 'returns_values', 'returns_size', and 'returns_resize_threshold' ATTRs |
| 24 | - 'results' and 'return_flags' accessors in set_attr_str and get_attr_str |
32 | | == API Cleanups == |
| 27 | |
| 28 | == General tasks == |
| 29 | |
| 30 | * Remove 'Parrot_call_*' functions (deprecated in TT # 1145) |
| 31 | |
| 32 | * Remove 'Parrot_PCCINVOKE', it has been replaced by 'Parrot_pcc_invoke_method_from_c_args' (the bodies of the two functions are exact copies). (falls under blanket deprecation in TT #443, may deserve its own deprecation ticket) |
| 33 | |
| 34 | * Move static 'csr_*' functions (src/call/args.c) that define an interface to manipulating the CallContext PMC into src/call/context.c. |
| 35 | |
| 36 | * Review the current functions in src/call/context.c and src/call/context_accessors.c, to see what's still useful after the move to the CallContext PMC. |
| 37 | |
| 38 | * Optimize PCC dispatch, refactor to slim down the code (much of that will happen in the args/returns refactor, but worth another look after that's done). |
| 39 | |
| 40 | * Enable dispatching by CallContext PMC everywhere (check if there are places it isn't enabled where it should be possible). |
| 41 | |
| 42 | * Add lots of documentation about signature strings, CallContext, dispatch, etc |
| 43 | |
| 44 | - Make sure the API and documentation consistently uses "args" and "returns" to mean "the things passed into the call or return" and "params" and "results" to mean "the things extracted from the call or return". |
| 76 | |
| 77 | * ~~Modify Parrot_build_sig_object_from_varargs to check if an invocant is present and if "Pi" doesn't already exist at the beginning of the string.~~ |
| 78 | |
| 79 | * ~~Delete all old call-related functions that are no longer used.~~ |
| 80 | |
| 81 | * ~~Convert all calls to 'Parrot_runops_fromc_args*' into calls to 'Parrot_pcc_invoke_sub_from_c_args'.~~ |
| 82 | |
| 83 | - ~~The Parrot_call_sub_* and Parrot_call_method_* variants in src/extend.c don't all have the necessary changes to allow them to work with the new calling conventions (these are temporary implementations for backward compatibility before they're removed at the next deprecation point). Parrot_call_sub does have the right changes, and the others can be largely copied from it.~~ |
| 84 | |
| 85 | - ~~NCI hasn't been fully updated on caller and receiver side to use the new argument passing style.~~ |
| 86 | |
| 87 | * ~~There's a huge hodge-podge of functions that do basically the same thing. Trim these down to a logical set that handle the basic cases. (calling from PIR, calling from C, calling from a CallSignature PMC).~~ |
| 88 | |
| 89 | * ~~Converge on one calling convention for all invocation. Different entry points for calling from PIR, C, or CallSignature PMC. Different exit points, depending on whether the call is a Sub (Closure, Contintuation, etc) or a CFunction. But same code pattern, and same core routines for all.~~ |
| 90 | |
| 91 | * ~~Refactor to remove code duplication between the various dispatch systems.~~ |
| 92 | |
| 93 | * ~~Add adverb modifier "i" to signature string for an invocant.~~ |
| 94 | |
| 95 | * ~~Change the default vtable function generator for Object PMC to generate 'Parrot_pcc_invoke_sub_from_c_args' calls instead of 'Parrot_runops_fromc_args*' calls.~~ |
| 96 | |
| 97 | * ~~Refactor CallSignature to store arguments as a typed array, instead of as a PMC array. The types we know from the signature, so can store and retrieve the elements in a type-safe way. (Suggestion from IRC discussion was to use a union for the value storage.) This will reduce the number of PMCs created, since integer, number, and string arguments can be stored directly instead of boxed in PMCs.~~ |
| 98 | |
| 99 | * ~~Refactor CallSignature to store arguments directly in CallSignature data structure, instead of creating two additional PMCs (array for positionals and hash for named) to hold them. This refactor can be done at the same time as the typed array refactor.~~ |
| 100 | |
| 101 | * ~~Refactor CallSignature to merge it with Context, only need one PMC to hold all that information. (Question: what's the implication of this combined with the previous refactor? Do returns get passed out in the same struct members that the arguments came in on?)~~ |
| 102 | |
| 103 | |
| 104 | - ~~Return argument processing (Parrot_pcc_fill_returns_from_op and Parrot_pcc_fill_returns_from_c_args) doesn't currently support :named, :slurpy, :flatten, :optional, :opt_flag etc. (t/compilers/imcc/syn/tail.t, t/pmc/coroutine.t)~~ |
| 105 | |
| 106 | - ~~Parrot_pcc_fill_params_from_op and Parrot_pcc_fill_params_from_c_args are monolithic functions (basically finite state machines iterating over the arguments), that contain a great deal of nearly repeated code (one or two things different each time). Parrot_pcc_fill_returns_from_op and Parrot_pcc_fill_returns_from_c_args will be just as bad once they support all the options. Not a requirement before the merge, but these should be refactored into smaller subroutines. Needs to be thought through carefully though, it was a similar plan that lead to the current mess.~~ |
| 107 | |
| 108 | - ~~Flattening an argument doesn't alter the signature string stored, so multiple dispatch can't handle the resulting string. Need to modify the signature string while building the CallSignature object. (t/pmc/multisub.t and t/pmc/multidispatch.t)~~ |
| 109 | |
| 110 | - ~~Edge cases on auto boxing/unboxing argument types, e.g. "Unable to set PMC value, the pointer is not a PMC" (t/oo/methods.t, t/oo/subclass.t, t/pmc/hashiteratorkey.t, t/pmc/object-meths.t, t/pmc/resizablestringarray.t, t/pmc/string.t)~~ |
| 111 | |
| 112 | - ~~GC attempting to mark a bad variable (t/op/box.t) (Actually IMCC creates bad PackFile_Constants segment for box.t)~~ |
| 113 | |
| 114 | - ~~Insufficient checking on positional arguments passed inside named arguments (t/op/calling.t)~~ |
| 115 | |
| 116 | - ~~Insufficient checking on missing named arguments (t/op/cc_state.t)~~ |
| 117 | |
| 118 | - ~~Insufficient checking on too many arguments passed (t/pmc/exporter.t)~~ |
| 119 | |
| 120 | - ~~Some tests need to be updated to match the current error messages (t/op/calling.t, t/op/cc_params.t)~~ |
| 121 | |
| 122 | - ~~Segfault in set_returns, possibly a null call object? (t/op/gc.t, t/pmc/exceptionhandler.t)~~ |
| 123 | |
| 124 | - ~~Probably a problem with argument handling (t/op/lexicals.t, t/pmc/class.t, t/pmc/codestring.t, t/pmc/object-meths.t, t/pmc/sub.t)~~ |
| 125 | |
| 126 | - ~~Two NCI edge cases (t/pmc/nci.t)~~ |
| 127 | |
| 128 | - ~~Likely cases of code still calling into the old functions for invoking from C, instead of the new functions (t/pmc/sub.t, t/pmc/threads.t)~~ |
| 129 | |
| 130 | - ~~Likely bug in Parrot_call_sub reimplementation (t/src/embed.t)~~ |
| 131 | |
| 132 | - ~~miniparrot fails to compile if an installed parrot is not already present, because it has -lparrot in the compile options~~ |
| 133 | |
| 134 | - ~~Currently, test_more.pir cannot be used on pcc_reapply. Attempting to use test_more.pir results in~~ |
| 135 | {{{ |
| 136 | FixedIntegerArray: index out of bounds! |
| 137 | current instr.: 'parrot;Test;Builder;Test;_initialize' pc 44 (runtime/parrot/library/Test/Builder/Test.pir:46) |
| 138 | called from Sub 'parrot;Test;Builder;_initialize' pc 0 (runtime/parrot/library/Test/Builder.pir:51) |
| 139 | ... call repeated 1 times |
| 140 | }}} |