Open krlmlr opened 4 years ago
Yes, here are a few observations from my experience:
Matching on Rf_eval
itself sometimes has issues because that function actually does slightly more than just evaluate R code (e.g. finding the function). As a result, I tried to match only on the combination of Rf_eval
+ R_execClosure
, which is actually where R pushes the new function onto its own stack.
Some "generic" functions are dispatched in C code (by tryDispatch
) and skip the Rf_eval
entirely, so I also had to match on those as well.
Some R "functions" are handled by the interpreter itself and do not appear in the Rprof stack at all, but show up in the C stack. For example c()
usage appears with the do_c
C symbol, and <-
appears with the do_set
C symbol.
I could only get sensible mixed-mode stacks if I deduplicated R-level calls to eval()
. I was never able to determine why.
@atheriel: Would you like to share your experience?