Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: src/IceCfg.cpp

Issue 878383004: Subzero: Fix timers for multithreaded translation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Rebase. Add missing 'break'. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/IceGlobalContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCfg.cpp
diff --git a/src/IceCfg.cpp b/src/IceCfg.cpp
index f6deda0651fdc4cb382cf757230d6966ada495ad..53f9a9f76a46f7f0752c349540c246757a378fe5 100644
--- a/src/IceCfg.cpp
+++ b/src/IceCfg.cpp
@@ -81,13 +81,21 @@ bool Cfg::hasComputedFrame() const { return getTarget()->hasComputedFrame(); }
void Cfg::translate() {
if (hasError())
return;
+ // FunctionTimer conditionally pushes/pops a TimerMarker if
+ // TimeEachFunction is enabled.
+ std::unique_ptr<TimerMarker> FunctionTimer;
if (ALLOW_DUMP) {
const IceString &TimingFocusOn = getContext()->getFlags().TimingFocusOn;
- if (TimingFocusOn == "*" || TimingFocusOn == getFunctionName()) {
+ const IceString &Name = getFunctionName();
+ if (TimingFocusOn == "*" || TimingFocusOn == Name) {
setFocusedTiming();
getContext()->resetTimer(GlobalContext::TSK_Default);
- getContext()->setTimerName(GlobalContext::TSK_Default, getFunctionName());
+ getContext()->setTimerName(GlobalContext::TSK_Default, Name);
}
+ if (getContext()->getFlags().TimeEachFunction)
+ FunctionTimer.reset(new TimerMarker(
+ getContext()->getTimerID(GlobalContext::TSK_Funcs, Name),
+ getContext(), GlobalContext::TSK_Funcs));
}
TimerMarker T(TimerStack::TT_translate, this);
« no previous file with comments | « no previous file | src/IceGlobalContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698