-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GSOC#2 compile-time expand pcc params and set the return result #1080
Comments
ZYROz
added a commit
to ZYROz/parrot
that referenced
this issue
Jun 20, 2014
ZYROz
added a commit
to ZYROz/parrot
that referenced
this issue
Jun 22, 2014
ZYROz
added a commit
to ZYROz/parrot
that referenced
this issue
Jun 22, 2014
ZYROz
added a commit
to ZYROz/parrot
that referenced
this issue
Jun 27, 2014
ZYROz
added a commit
to ZYROz/parrot
that referenced
this issue
Jun 27, 2014
rurban
pushed a commit
that referenced
this issue
Jun 29, 2014
optimize pmc2c to emit static fill_params from compile-time known params into the _call_object args array, ditto for the return values.
rurban
pushed a commit
that referenced
this issue
Jun 29, 2014
on method calls without optional args do one arity check, with the new exception message: "wrong number of arguments: %d passed, %d expected" Matching the old exception message too many/few would require two run-time checks, which costs ~2% in parrot-bench. fixes t/pmc/class.t
ZYROz
added a commit
to ZYROz/parrot
that referenced
this issue
Jun 29, 2014
ZYROz
added a commit
to ZYROz/parrot
that referenced
this issue
Jun 29, 2014
ZYROz
added a commit
to ZYROz/parrot
that referenced
this issue
Jun 29, 2014
rurban
pushed a commit
that referenced
this issue
Jun 29, 2014
optimize pmc2c to emit static fill_params from compile-time known params into the _call_object args array, ditto for the return values.
rurban
pushed a commit
that referenced
this issue
Jun 29, 2014
on method calls without optional args do one arity check, with the new exception message: "wrong number of arguments: %d passed, %d expected" Matching the old exception message too many/few would require two run-time checks, which costs ~2% in parrot-bench. fixes t/pmc/class.t
rurban
pushed a commit
that referenced
this issue
Jun 29, 2014
handle now also :optional and :opt_flag at compile-time, not at run-time. (o and p arg adverbs) Unprovided args get initialized with empty defaults. With optional args, fall back to the two-fold old too many and too few arguments checks, for backward compat. (about 2% slower)
rurban
pushed a commit
that referenced
this issue
Jul 1, 2014
Merged with commit 000a132
|
rurban
pushed a commit
that referenced
this issue
Jul 1, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PCCMETHODs can be optimized to omit the run-time call to
Parrot_pcc_fill_params_from_c_args(interp, _call_object, sig, &_self, args...);
and create the necessary C code to fill the params directly in pmc2c.
E.g. for "Pi"
_self = VTABLE_get_pmc_keyed_int(interp, _call_object, 0);
with_self
being the first arg and0
being the index for the first argument.Same for assigning the RETURN result:
Parrot_pcc_set_call_from_c_args(interp, _call_object, rettype, result);
which only sets one argument, so a call
set_call_from_varargs
is not needed, just the type-specific part fromset_call_from_varargs
.E.g.
VTABLE_set_integer_keyed_int(interp, _call_object, 0, retvar);
Unfortunately we have to check the number of provided arguments at run-time:
VTABLE_get_integer(interp, _call_object);
and throwEXCEPTION_INVALID_OPERATION
if too less or too many.:optional
and:opt_flag
handling can be left to the old slow method or also expanded. (seerurban/pcc-opt-gh1080
)The flags flatten, lookahead, name and slurpy and multiple return values are rarely used and should be left to the old method.
:constant
should be expanded, but is not used yet.This saves two unneccessary nested function calls, and one intermediate PMC creation just for holding the sig array and will lead to about 2-4% faster code with method calls. The arity check for the number of provided vs expected args is now the bottleneck.
The text was updated successfully, but these errors were encountered: