Upgrade V8 to version 4.9.385.28
https://chromium.googlesource.com/v8/v8/+/4.9.385.28
FPIIM-449
Change-Id: I4b2e74289d4bf3667f2f3dc8aa2e541f63e26eb4
diff --git a/src/zone-containers.h b/src/zone-containers.h
index b0ff7b6..79b168c 100644
--- a/src/zone-containers.h
+++ b/src/zone-containers.h
@@ -7,7 +7,9 @@
#include <deque>
#include <list>
+#include <map>
#include <queue>
+#include <set>
#include <stack>
#include <vector>
@@ -27,12 +29,12 @@
// Constructs a new vector and fills it with {size} elements, each
// constructed via the default constructor.
- ZoneVector(int size, Zone* zone)
+ ZoneVector(size_t size, Zone* zone)
: std::vector<T, zone_allocator<T>>(size, T(), zone_allocator<T>(zone)) {}
// Constructs a new vector and fills it with {size} elements, each
// having the value {def}.
- ZoneVector(int size, T def, Zone* zone)
+ ZoneVector(size_t size, T def, Zone* zone)
: std::vector<T, zone_allocator<T>>(size, def, zone_allocator<T>(zone)) {}
};
@@ -61,6 +63,19 @@
};
+// A wrapper subclass std::priority_queue to make it easy to construct one
+// that uses a zone allocator.
+template <typename T, typename Compare = std::less<T>>
+class ZonePriorityQueue
+ : public std::priority_queue<T, ZoneVector<T>, Compare> {
+ public:
+ // Constructs an empty list.
+ explicit ZonePriorityQueue(Zone* zone)
+ : std::priority_queue<T, ZoneVector<T>, Compare>(Compare(),
+ ZoneVector<T>(zone)) {}
+};
+
+
// A wrapper subclass for std::queue to make it easy to construct one
// that uses a zone allocator.
template <typename T>
@@ -83,6 +98,31 @@
};
+// A wrapper subclass for std::set to make it easy to construct one that uses
+// a zone allocator.
+template <typename K, typename Compare = std::less<K>>
+class ZoneSet : public std::set<K, Compare, zone_allocator<K>> {
+ public:
+ // Constructs an empty set.
+ explicit ZoneSet(Zone* zone)
+ : std::set<K, Compare, zone_allocator<K>>(Compare(),
+ zone_allocator<K>(zone)) {}
+};
+
+
+// A wrapper subclass for std::map to make it easy to construct one that uses
+// a zone allocator.
+template <typename K, typename V, typename Compare = std::less<K>>
+class ZoneMap
+ : public std::map<K, V, Compare, zone_allocator<std::pair<const K, V>>> {
+ public:
+ // Constructs an empty map.
+ explicit ZoneMap(Zone* zone)
+ : std::map<K, V, Compare, zone_allocator<std::pair<const K, V>>>(
+ Compare(), zone_allocator<std::pair<const K, V>>(zone)) {}
+};
+
+
// Typedefs to shorten commonly used vectors.
typedef ZoneVector<bool> BoolVector;
typedef ZoneVector<int> IntVector;