Improve use of CfgLocalAllocator and introduce containers that use it.
This doesn't make a big difference but does reduce the proportion of time spent
in malloc and free.
BUG=
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/1349833005 .
diff --git a/src/IceCfg.cpp b/src/IceCfg.cpp
index 4c703cf..02d4503 100644
--- a/src/IceCfg.cpp
+++ b/src/IceCfg.cpp
@@ -314,13 +314,13 @@
void Cfg::reorderNodes() {
// TODO(ascull): it would be nice if the switch tests were always followed by
// the default case to allow for fall through.
- using PlacedList = std::list<CfgNode *>;
+ using PlacedList = CfgList<CfgNode *>;
PlacedList Placed; // Nodes with relative placement locked down
PlacedList Unreachable; // Unreachable nodes
PlacedList::iterator NoPlace = Placed.end();
// Keep track of where each node has been tentatively placed so that we can
// manage insertions into the middle.
- std::vector<PlacedList::iterator> PlaceIndex(Nodes.size(), NoPlace);
+ CfgVector<PlacedList::iterator> PlaceIndex(Nodes.size(), NoPlace);
for (CfgNode *Node : Nodes) {
// The "do ... while(0);" construct is to factor out the --PlaceIndex and
// assert() statements before moving to the next node.