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

Unified Diff: src/zone-containers.h

Issue 726513002: [turbofan] Smartify the GraphReducer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE Created 6 years, 1 month 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/compiler/pipeline.cc ('k') | test/cctest/compiler/test-changes-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/zone-containers.h
diff --git a/src/zone-containers.h b/src/zone-containers.h
index 4998cbf3fe990b08208e93da5a49491d96ee5064..887ac1c54cab561d8c74acced2c539131f697da5 100644
--- a/src/zone-containers.h
+++ b/src/zone-containers.h
@@ -7,6 +7,7 @@
#include <deque>
#include <queue>
+#include <stack>
#include <vector>
#include "src/zone-allocator.h"
@@ -36,29 +37,45 @@ class ZoneVector : public std::vector<T, zone_allocator<T> > {
}
};
+
// A wrapper subclass std::deque to make it easy to construct one
// that uses a zone allocator.
template <typename T>
class ZoneDeque : public std::deque<T, zone_allocator<T> > {
public:
+ // Constructs an empty deque.
explicit ZoneDeque(Zone* zone)
: std::deque<T, zone_allocator<T> >(zone_allocator<T>(zone)) {}
};
+
// A wrapper subclass for std::queue to make it easy to construct one
// that uses a zone allocator.
template <typename T>
-class ZoneQueue : public std::queue<T, std::deque<T, zone_allocator<T> > > {
+class ZoneQueue : public std::queue<T, ZoneDeque<T>> {
public:
// Constructs an empty queue.
explicit ZoneQueue(Zone* zone)
- : std::queue<T, std::deque<T, zone_allocator<T> > >(
- std::deque<T, zone_allocator<T> >(zone_allocator<T>(zone))) {}
+ : std::queue<T, ZoneDeque<T>>(ZoneDeque<T>(zone)) {}
};
+
+// A wrapper subclass for std::stack to make it easy to construct one that uses
+// a zone allocator.
+template <typename T>
+class ZoneStack : public std::stack<T, ZoneDeque<T>> {
+ public:
+ // Constructs an empty stack.
+ explicit ZoneStack(Zone* zone)
+ : std::stack<T, ZoneDeque<T>>(ZoneDeque<T>(zone)) {}
+};
+
+
// Typedefs to shorten commonly used vectors.
typedef ZoneVector<bool> BoolVector;
typedef ZoneVector<int> IntVector;
-} } // namespace v8::internal
+
+} // namespace internal
+} // namespace v8
#endif // V8_ZONE_CONTAINERS_H_
« no previous file with comments | « src/compiler/pipeline.cc ('k') | test/cctest/compiler/test-changes-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698