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

Unified Diff: src/IceGlobalContext.cpp

Issue 1747333002: Subzero: Print constant pool info with --szstats. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 years, 10 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 | « src/IceGlobalContext.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceGlobalContext.cpp
diff --git a/src/IceGlobalContext.cpp b/src/IceGlobalContext.cpp
index 3bec3c3c22bf7c0ab1770f528d3c3f690998e02e..af3e6c7065e657aa98a4c989f89d64c5a120bc28 100644
--- a/src/IceGlobalContext.cpp
+++ b/src/IceGlobalContext.cpp
@@ -160,6 +160,7 @@ public:
std::sort(Constants.begin(), Constants.end(), KeyCompareLess<ValueType>());
return Constants;
}
+ size_t size() const { return Pool.size(); }
private:
// Use the default hash function, and a custom key comparison function. The
@@ -215,9 +216,11 @@ public:
UndefPool Undefs;
};
-void GlobalContext::CodeStats::dump(const IceString &Name, Ostream &Str) {
+void GlobalContext::CodeStats::dump(const IceString &Name, GlobalContext *Ctx) {
Eric Holk 2016/03/01 19:26:39 Optional, but I'd consider passing Ctx as a refere
John 2016/03/01 20:02:09 Please, do not pass non-const references to method
if (!BuildDefs::dump())
return;
+ OstreamLocker _(Ctx);
+ Ostream &Str = Ctx->getStrDump();
#define X(str, tag) \
Str << "|" << Name << "|" str "|" << Stats[CS_##tag] << "\n";
CODESTATS_TABLE
@@ -230,6 +233,20 @@ void GlobalContext::CodeStats::dump(const IceString &Name, Ostream &Str) {
else
Str << "(requires '-track-memory')";
Str << "\n";
+ Str << "|" << Name << "|CPool Sizes ";
+ {
+ auto Pool = Ctx->getConstPool();
+ Str << "|f32=" << Pool->Floats.size();
+ Str << "|f64=" << Pool->Doubles.size();
+ Str << "|i1=" << Pool->Integers1.size();
+ Str << "|i8=" << Pool->Integers8.size();
+ Str << "|i16=" << Pool->Integers16.size();
+ Str << "|i32=" << Pool->Integers32.size();
+ Str << "|i64=" << Pool->Integers64.size();
+ Str << "|Rel=" << Pool->Relocatables.size();
+ Str << "|ExtRel=" << Pool->ExternRelocatables.size();
+ }
+ Str << "\n";
}
GlobalContext::GlobalContext(Ostream *OsDump, Ostream *OsEmit, Ostream *OsError,
@@ -997,11 +1014,10 @@ EmitterWorkItem *GlobalContext::emitQueueBlockingPop() {
void GlobalContext::dumpStats(const IceString &Name, bool Final) {
if (!getFlags().getDumpStats())
return;
- OstreamLocker OL(this);
if (Final) {
- getStatsCumulative()->dump(Name, getStrDump());
+ getStatsCumulative()->dump(Name, this);
} else {
- ICE_TLS_GET_FIELD(TLS)->StatsFunction.dump(Name, getStrDump());
+ ICE_TLS_GET_FIELD(TLS)->StatsFunction.dump(Name, this);
}
}
« no previous file with comments | « src/IceGlobalContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698