Update V8 to version 4.1.0.21
This is a cherry-pick of all commits up to and including the
4.1.0.21 cherry-pick in Chromium.
Original commit message:
Version 4.1.0.21 (cherry-pick)
Merged 206e9136bde0f2b5ae8cb77afbb1e7833e5bd412
Unlink pages from the space page list after evacuation.
BUG=430201
LOG=N
R=jkummerow@chromium.org
Review URL: https://codereview.chromium.org/953813002
Cr-Commit-Position: refs/branch-heads/4.1@{#22}
Cr-Branched-From: 2e08d2a7aa9d65d269d8c57aba82eb38a8cb0a18-refs/heads/candidates@{#25353}
---
FPIIM-449
Change-Id: I8c23c7bbb70772b4858fe8a47b64fa97ee0d1f8c
diff --git a/src/zone-containers.h b/src/zone-containers.h
index 2ee1780..b0ff7b6 100644
--- a/src/zone-containers.h
+++ b/src/zone-containers.h
@@ -6,7 +6,9 @@
#define V8_ZONE_CONTAINERS_H_
#include <deque>
+#include <list>
#include <queue>
+#include <stack>
#include <vector>
#include "src/zone-allocator.h"
@@ -17,42 +19,75 @@
// A wrapper subclass for std::vector to make it easy to construct one
// that uses a zone allocator.
template <typename T>
-class ZoneVector : public std::vector<T, zone_allocator<T> > {
+class ZoneVector : public std::vector<T, zone_allocator<T>> {
public:
// Constructs an empty vector.
explicit ZoneVector(Zone* zone)
- : std::vector<T, zone_allocator<T> >(zone_allocator<T>(zone)) {}
+ : std::vector<T, zone_allocator<T>>(zone_allocator<T>(zone)) {}
+
+ // Constructs a new vector and fills it with {size} elements, each
+ // constructed via the default constructor.
+ ZoneVector(int 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)
- : std::vector<T, zone_allocator<T> >(size, def, zone_allocator<T>(zone)) {
- }
+ : std::vector<T, zone_allocator<T>>(size, def, zone_allocator<T>(zone)) {}
};
+
// 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> > {
+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)) {}
+ : std::deque<T, zone_allocator<T>>(zone_allocator<T>(zone)) {}
};
+
+// A wrapper subclass std::list to make it easy to construct one
+// that uses a zone allocator.
+// TODO(mstarzinger): This should be renamed to ZoneList once we got rid of our
+// own home-grown ZoneList that actually is a ZoneVector.
+template <typename T>
+class ZoneLinkedList : public std::list<T, zone_allocator<T>> {
+ public:
+ // Constructs an empty list.
+ explicit ZoneLinkedList(Zone* zone)
+ : std::list<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_