Bug 104102 - JSC profiler should not count executions of op_call_put_result because doing so changes DFG codegen
Summary: JSC profiler should not count executions of op_call_put_result because doing ...
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
Depends on:
Reported: 2012-12-05 01:46 PST by Filip Pizlo
Modified: 2012-12-05 11:20 PST (History)
7 users (show)

See Also:

the patch (12.42 KB, patch)
2012-12-05 01:59 PST, Filip Pizlo
oliver: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2012-12-05 01:46:58 PST
op_call_put_result is the return target for inlining. Imagine you have a function that has a jump target immediately following an inlined call, and the inlined call itself has an empty basic block contain just the return statement at its tail.  The DFG has the ability to merge the empty basic block at the end of the inlinee with the new basic block created just after the call in the inliner.  But, placing a CountExecution node at the return point of the call breaks this optimization, and can have unforeseen impact on codegen. This breaks the main principle of the profiler: to be able to tell us profiling data without affecting codegen.  (It may affect performance but the disassembly that you see will be faithful.)

The best approach to fixing this is to avoid profiling instructions like op_call_put_result that have this kind of behavior.  Doing so will not take away much from the profiler, since usually the counts for op_call_put_result itself are not interesting.
Comment 1 Filip Pizlo 2012-12-05 01:59:23 PST
Created attachment 177702 [details]
the patch
Comment 2 Filip Pizlo 2012-12-05 11:20:56 PST
Landed in http://trac.webkit.org/changeset/136720