Torrie Fischer 6614a48418 Refactor PerfStepTimer to stop on destruct
This eliminates the need to remember to call PERF_TIMER_STOP when a section has
been timed. This allows more useful design with the perf timers and enables
possible return value optimizations. Simplistic example:

class Foo {
  public:
    Foo(int v) : m_v(v);
  private:
    int m_v;
}

Foo makeFrobbedFoo(int *errno)
{
  *errno = 0;
  return Foo();
}

Foo bar(int *errno)
{
  PERF_TIMER_GUARD(some_timer);

  return makeFrobbedFoo(errno);
}

int main(int argc, char[] argv)
{
  Foo f;
  int errno;

  f = bar(&errno);

  if (errno)
    return -1;
  return 0;
}

After bar() is called, perf_context.some_timer would be incremented as if
Stop(&perf_context.some_timer) was called at the end, and the compiler is still
able to produce optimizations on the return value from makeFrobbedFoo() through
to main().
2014-09-02 12:04:22 -07:00
..
2014-08-25 14:24:09 -07:00
2014-08-25 14:24:09 -07:00
2014-08-28 13:37:10 +08:00
2014-05-15 14:09:03 -07:00
2014-05-15 14:09:03 -07:00
2014-05-01 14:09:32 -04:00
2014-04-09 21:17:14 -07:00
2014-08-25 14:24:09 -07:00
2014-08-25 14:24:09 -07:00
2014-07-21 10:31:33 -07:00
2014-07-21 10:31:33 -07:00
2014-02-03 00:30:43 -08:00