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

Side by Side Diff: src/zone-containers.h

Issue 1061923005: Reland: Introducing the LLVM greedy register allocator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 unified diff | Download patch
« src/compiler/register-allocator.cc ('K') | « src/flag-definitions.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_ZONE_CONTAINERS_H_ 5 #ifndef V8_ZONE_CONTAINERS_H_
6 #define V8_ZONE_CONTAINERS_H_ 6 #define V8_ZONE_CONTAINERS_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <list> 9 #include <list>
10 #include <map> 10 #include <map>
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // own home-grown ZoneList that actually is a ZoneVector. 56 // own home-grown ZoneList that actually is a ZoneVector.
57 template <typename T> 57 template <typename T>
58 class ZoneLinkedList : public std::list<T, zone_allocator<T>> { 58 class ZoneLinkedList : public std::list<T, zone_allocator<T>> {
59 public: 59 public:
60 // Constructs an empty list. 60 // Constructs an empty list.
61 explicit ZoneLinkedList(Zone* zone) 61 explicit ZoneLinkedList(Zone* zone)
62 : std::list<T, zone_allocator<T>>(zone_allocator<T>(zone)) {} 62 : std::list<T, zone_allocator<T>>(zone_allocator<T>(zone)) {}
63 }; 63 };
64 64
65 65
66 // A wrapper subclass std::priority_queue to make it easy to construct one
67 // that uses a zone allocator.
68 template <typename T, typename Compare = std::less<T>>
69 class ZonePriorityQueue : public std::priority_queue<T, ZoneVector<T>> {
70 public:
71 // Constructs an empty list.
72 explicit ZonePriorityQueue(Zone* zone)
73 : std::priority_queue<T, ZoneVector<T>>(Compare(), ZoneVector<T>(zone)) {}
74 };
75
76
66 // A wrapper subclass for std::queue to make it easy to construct one 77 // A wrapper subclass for std::queue to make it easy to construct one
67 // that uses a zone allocator. 78 // that uses a zone allocator.
68 template <typename T> 79 template <typename T>
69 class ZoneQueue : public std::queue<T, ZoneDeque<T>> { 80 class ZoneQueue : public std::queue<T, ZoneDeque<T>> {
70 public: 81 public:
71 // Constructs an empty queue. 82 // Constructs an empty queue.
72 explicit ZoneQueue(Zone* zone) 83 explicit ZoneQueue(Zone* zone)
73 : std::queue<T, ZoneDeque<T>>(ZoneDeque<T>(zone)) {} 84 : std::queue<T, ZoneDeque<T>>(ZoneDeque<T>(zone)) {}
74 }; 85 };
75 86
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 122
112 123
113 // Typedefs to shorten commonly used vectors. 124 // Typedefs to shorten commonly used vectors.
114 typedef ZoneVector<bool> BoolVector; 125 typedef ZoneVector<bool> BoolVector;
115 typedef ZoneVector<int> IntVector; 126 typedef ZoneVector<int> IntVector;
116 127
117 } // namespace internal 128 } // namespace internal
118 } // namespace v8 129 } // namespace v8
119 130
120 #endif // V8_ZONE_CONTAINERS_H_ 131 #endif // V8_ZONE_CONTAINERS_H_
OLDNEW
« src/compiler/register-allocator.cc ('K') | « src/flag-definitions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698