... | ... | @@ -61,8 +61,13 @@ All of this takes quite a lot of code, so we pre-generate a whole bunch of gener |
|
|
For example, if we find a call to an unknown function applied to two (boxed) `Int` arguments, load the function and its two arguments as for the standard entry convention and jump to `stg_ap_pp_fast`. This latter code is in `rts/AutoApply.cmm`, generated by the `genapply` tool. The "`pp`" part is the bit that says the code is specialised for two pointer arguments.
|
|
|
|
|
|
|
|
|
|
|
|
In addition to the family of `stg_ap_<pattern>_fast` functions for making calls to unknown functions with various argument patterns, there is a corresponding family of return addresses `stg_ap_<pattern>_info`. The idea is that you can push a continuation that will make a call to the function that is returned to it. For example, to push a continuation that will apply a single pointer argument, we would push the following words on the stack:
|
|
|
|
|
|
|
|
|
<table><tr><th> arg
|
|
|
</th></tr>
|
|
|
<tr><th>`stg_ap_p_info`</th></tr></table> |
|
|
\ No newline at end of file |
|
|
<tr><th> <tt>stg_ap_p_info</tt>
|
|
|
</th></tr></table>
|
|
|
|
|
|
|