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

Unified Diff: src/IceRegAlloc.h

Issue 781683002: Subzero: Improve the memory-related performance of the register allocator. (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 | « no previous file | src/IceRegAlloc.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceRegAlloc.h
diff --git a/src/IceRegAlloc.h b/src/IceRegAlloc.h
index 9b9992cdfcd443c507d0f424fd23e239a2d5145e..4ecae52fa4823b8a668ca5623b6ca7ee36d3b60a 100644
--- a/src/IceRegAlloc.h
+++ b/src/IceRegAlloc.h
@@ -33,12 +33,24 @@ public:
void dump(Cfg *Func) const;
private:
+ typedef std::vector<Variable *> OrderedRanges;
+ typedef std::vector<Variable *> UnorderedRanges;
+
void initForGlobal();
void initForInfOnly();
+ // Move an item from the From set to the To set. From[Index] is
+ // pushed onto the end of To[], then the item is efficiently removed
+ // from From[] by effectively swapping it with the last item in
+ // From[] and then popping it from the back. As such, the caller is
+ // best off iterating over From[] in reverse order to avoid the need
+ // for special handling of the iterator.
+ void moveItem(UnorderedRanges &From, SizeT Index, UnorderedRanges &To) {
+ To.push_back(From[Index]);
+ From[Index] = From.back();
+ From.pop_back();
+ }
Cfg *const Func;
- typedef std::vector<Variable *> OrderedRanges;
- typedef std::list<Variable *> UnorderedRanges;
OrderedRanges Unhandled;
// UnhandledPrecolored is a subset of Unhandled, specially collected
// for faster processing.
« no previous file with comments | « no previous file | src/IceRegAlloc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698