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

Unified Diff: src/IceGlobalContext.h

Issue 788713002: Subzero: Disable stats and timers under the MINIMAL build. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes Created 6 years 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 | « src/IceConverter.cpp ('k') | src/IceGlobalContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceGlobalContext.h
diff --git a/src/IceGlobalContext.h b/src/IceGlobalContext.h
index a08262589d64c60ecb34a0030167661d95033a87..3998b5301493157a71ce435cc0b95339e023c06b 100644
--- a/src/IceGlobalContext.h
+++ b/src/IceGlobalContext.h
@@ -161,25 +161,38 @@ public:
ELFObjectWriter *getObjectWriter() const { return ObjectWriter.get(); }
// Reset stats at the beginning of a function.
- void resetStats() { StatsFunction.reset(); }
+ void resetStats() {
+ if (ALLOW_DUMP)
+ StatsFunction.reset();
+ }
void dumpStats(const IceString &Name, bool Final = false);
void statsUpdateEmitted(uint32_t InstCount) {
+ if (!ALLOW_DUMP)
+ return;
StatsFunction.updateEmitted(InstCount);
StatsCumulative.updateEmitted(InstCount);
}
void statsUpdateRegistersSaved(uint32_t Num) {
+ if (!ALLOW_DUMP)
+ return;
StatsFunction.updateRegistersSaved(Num);
StatsCumulative.updateRegistersSaved(Num);
}
void statsUpdateFrameBytes(uint32_t Bytes) {
+ if (!ALLOW_DUMP)
+ return;
StatsFunction.updateFrameBytes(Bytes);
StatsCumulative.updateFrameBytes(Bytes);
}
void statsUpdateSpills() {
+ if (!ALLOW_DUMP)
+ return;
StatsFunction.updateSpills();
StatsCumulative.updateSpills();
}
void statsUpdateFills() {
+ if (!ALLOW_DUMP)
+ return;
StatsFunction.updateFills();
StatsCumulative.updateFills();
}
@@ -234,21 +247,24 @@ class TimerMarker {
public:
TimerMarker(TimerIdT ID, GlobalContext *Ctx)
- : ID(ID), Ctx(Ctx), Active(Ctx->getFlags().SubzeroTimingEnabled) {
- if (Active)
- Ctx->pushTimer(ID);
+ : ID(ID), Ctx(Ctx), Active(false) {
+ if (ALLOW_DUMP) {
+ Active = Ctx->getFlags().SubzeroTimingEnabled;
+ if (Active)
+ Ctx->pushTimer(ID);
+ }
}
TimerMarker(TimerIdT ID, const Cfg *Func);
~TimerMarker() {
- if (Active)
+ if (ALLOW_DUMP && Active)
Ctx->popTimer(ID);
}
private:
TimerIdT ID;
GlobalContext *const Ctx;
- const bool Active;
+ bool Active;
};
} // end of namespace Ice
« no previous file with comments | « src/IceConverter.cpp ('k') | src/IceGlobalContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698