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

Unified Diff: src/IceCfgNode.h

Issue 1866463002: Subzero: Improve non-MINIMAL string performance. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 years, 8 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/IceCfg.cpp ('k') | src/IceCfgNode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCfgNode.h
diff --git a/src/IceCfgNode.h b/src/IceCfgNode.h
index cf3e83c987c674d6ad7c199061d291072dfc4b3b..6d7811c359554bd166c2774e9a3fb26891ee9969 100644
--- a/src/IceCfgNode.h
+++ b/src/IceCfgNode.h
@@ -37,7 +37,11 @@ public:
/// Access the label number and name for this node.
SizeT getIndex() const { return Number; }
void resetIndex(SizeT NewNumber) { Number = NewNumber; }
- NodeString getName() const { return Name; }
+ std::string getName() const {
+ if (Name.hasStdString())
+ return Name.toString();
+ return "__" + std::to_string(NumberOrig);
+ }
void setName(const std::string &NewName) {
if (NewName.empty())
return;
@@ -118,10 +122,13 @@ public:
}
private:
- CfgNode(Cfg *Func, SizeT Number);
+ CfgNode(Cfg *Func, SizeT Number)
+ : Func(Func), Number(Number), NumberOrig(Number),
+ Name(NodeString::createWithoutString(Func)) {}
bool livenessValidateIntervals(Liveness *Liveness) const;
Cfg *const Func;
- SizeT Number; /// invariant: Func->Nodes[Number]==this
+ SizeT Number; /// invariant: Func->Nodes[Number]==this
+ const SizeT NumberOrig; /// used for name auto-generation
NodeString Name;
SizeT LoopNestDepth = 0; /// the loop nest depth of this node
bool HasReturn = false; /// does this block need an epilog?
« no previous file with comments | « src/IceCfg.cpp ('k') | src/IceCfgNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698