aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/src/zone/zone-allocator.h
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2019-08-16 11:32:46 +0200
committerMichaël Zasso <targos@protonmail.com>2019-08-19 09:25:23 +0200
commite31f0a7d25668d3c1531294d2ef44a9f3bde4ef4 (patch)
tree6c6bed9804be9df6162b2483f0a56f371f66464d /deps/v8/src/zone/zone-allocator.h
parentec16fdae540adaf710b1a86c620170b2880088f0 (diff)
downloadandroid-node-v8-e31f0a7d25668d3c1531294d2ef44a9f3bde4ef4.tar.gz
android-node-v8-e31f0a7d25668d3c1531294d2ef44a9f3bde4ef4.tar.bz2
android-node-v8-e31f0a7d25668d3c1531294d2ef44a9f3bde4ef4.zip
deps: update V8 to 7.7.299.4
PR-URL: https://github.com/nodejs/node/pull/28918 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'deps/v8/src/zone/zone-allocator.h')
-rw-r--r--deps/v8/src/zone/zone-allocator.h36
1 files changed, 16 insertions, 20 deletions
diff --git a/deps/v8/src/zone/zone-allocator.h b/deps/v8/src/zone/zone-allocator.h
index fe62d4bb4c..69928d5925 100644
--- a/deps/v8/src/zone/zone-allocator.h
+++ b/deps/v8/src/zone/zone-allocator.h
@@ -26,8 +26,18 @@ class ZoneAllocator {
using other = ZoneAllocator<O>;
};
-#ifdef V8_CC_MSVC
- // MSVS unfortunately requires the default constructor to be defined.
+#ifdef V8_OS_WIN
+ // The exported class ParallelMove derives from ZoneVector, which derives
+ // from std::vector. On Windows, the semantics of dllexport mean that
+ // a class's superclasses that are not explicitly exported themselves get
+ // implicitly exported together with the subclass, and exporting a class
+ // exports all its functions -- including the std::vector() constructors
+ // that don't take an explicit allocator argument, which in turn reference
+ // the vector allocator's default constructor. So this constructor needs
+ // to exist for linking purposes, even if it's never called.
+ // Other fixes would be to disallow subclasses of ZoneVector (etc) to be
+ // exported, or using composition instead of inheritance for either
+ // ZoneVector and friends or for ParallelMove.
ZoneAllocator() : ZoneAllocator(nullptr) { UNREACHABLE(); }
#endif
explicit ZoneAllocator(Zone* zone) : zone_(zone) {}
@@ -37,14 +47,8 @@ class ZoneAllocator {
template <typename U>
friend class ZoneAllocator;
- T* address(T& x) const { return &x; }
- const T* address(const T& x) const { return &x; }
-
- T* allocate(size_t n, const void* hint = nullptr) {
- return static_cast<T*>(zone_->NewArray<T>(static_cast<int>(n)));
- }
- void deallocate(T* p, size_t) { /* noop for Zones */
- }
+ T* allocate(size_t n) { return zone_->NewArray<T>(n); }
+ void deallocate(T* p, size_t) {} // noop for zones
size_t max_size() const {
return std::numeric_limits<int>::max() / sizeof(T);
@@ -84,13 +88,6 @@ class RecyclingZoneAllocator : public ZoneAllocator<T> {
using other = RecyclingZoneAllocator<O>;
};
-#ifdef V8_CC_MSVC
- // MSVS unfortunately requires the default constructor to be defined.
- RecyclingZoneAllocator()
- : ZoneAllocator(nullptr, nullptr), free_list_(nullptr) {
- UNREACHABLE();
- }
-#endif
explicit RecyclingZoneAllocator(Zone* zone)
: ZoneAllocator<T>(zone), free_list_(nullptr) {}
template <typename U>
@@ -100,16 +97,15 @@ class RecyclingZoneAllocator : public ZoneAllocator<T> {
template <typename U>
friend class RecyclingZoneAllocator;
- T* allocate(size_t n, const void* hint = nullptr) {
+ T* allocate(size_t n) {
// Only check top block in free list, since this will be equal to or larger
// than the other blocks in the free list.
if (free_list_ && free_list_->size >= n) {
T* return_val = reinterpret_cast<T*>(free_list_);
free_list_ = free_list_->next;
return return_val;
- } else {
- return ZoneAllocator<T>::allocate(n, hint);
}
+ return ZoneAllocator<T>::allocate(n);
}
void deallocate(T* p, size_t n) {