Subzero: Fix timers for multithreaded translation.

Now that multithreaded parsing and translation is in place, timer operations have to be made thread-local.  After the non-main threads end, their thread-local timer data needs to be merged into the global timer data, which resides in the GlobalContext object.  The merge is a bit tricky because the internal timer stack structure is built up dynamically as items are pushed and popped.  Two threads may have radically different timing data:

1. The parser thread profile is completely different from a translator thread.

2. For -timing-funcs, two translator threads hold data for entirely different sets of functions.

A bit more tweaking will need to be done to make the timing output fully usable in a multithreaded run.  Because of multiple threads, times may add up to >100%.  Also, time spent blocked is being "unfairly" attributed to the caller of the blocking operation - we should either count the user time instead of wall-clock time, or add a special timer marker for blocking locking operations.

BUG= none
R=jvoung@chromium.org

Review URL: https://codereview.chromium.org/878383004
7 files changed