Please sign in to comment.
Fix profile counters for non-s-expression source
Check both the beginning file pointer (bfp) and end file pointer (efp) of the source location associated with a profile counter when updating its count. Assuming that each expression has a unique bfp with respect to profiling seems to give accurate execution counts for s-expression-based source locations as in Scheme, but causes problems when targeting other kinds of syntax. For instance, a C-style function call, referencing the called function by name, such as "fn(arg)", can logically have profile counters associated with 1) the function name reference ("fn") and 2) the entire function call expression ("fn(arg)"), both of which begin at the same source location. Only the bfp is checked when updating profile counters, so the two source locations are conflated, and only one counter is incremented, which gives inaccurate execution counts for both locations; approximately twice as many for one, and zero for the other.
- Loading branch information...