summaryrefslogtreecommitdiff
path: root/deps/v8/src/objects/fixed-array.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/objects/fixed-array.h')
-rw-r--r--deps/v8/src/objects/fixed-array.h31
1 files changed, 11 insertions, 20 deletions
diff --git a/deps/v8/src/objects/fixed-array.h b/deps/v8/src/objects/fixed-array.h
index 13148b2099..97f9297ef7 100644
--- a/deps/v8/src/objects/fixed-array.h
+++ b/deps/v8/src/objects/fixed-array.h
@@ -9,7 +9,6 @@
#include "src/objects/instance-type.h"
#include "src/objects/objects.h"
#include "src/objects/smi.h"
-#include "torque-generated/class-definitions.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
@@ -65,6 +64,8 @@ enum FixedArraySubInstanceType {
LAST_FIXED_ARRAY_SUB_TYPE = WEAK_NEW_SPACE_OBJECT_TO_CODE_SUB_TYPE
};
+#include "torque-generated/src/objects/fixed-array-tq.inc"
+
// Common superclass for FixedArrays that allow implementations to share
// common accessors and some code paths.
class FixedArrayBase
@@ -100,7 +101,7 @@ class FixedArray
public:
// Setter and getter for elements.
inline Object get(int index) const;
- inline Object get(const Isolate* isolate, int index) const;
+ inline Object get(IsolateRoot isolate, int index) const;
static inline Handle<Object> get(FixedArray array, int index,
Isolate* isolate);
@@ -112,7 +113,7 @@ class FixedArray
// Synchronized setters and getters.
inline Object synchronized_get(int index) const;
- inline Object synchronized_get(const Isolate* isolate, int index) const;
+ inline Object synchronized_get(IsolateRoot isolate, int index) const;
// Currently only Smis are written with release semantics, hence we can avoid
// a write barrier.
inline void synchronized_set(int index, Smi value);
@@ -122,18 +123,7 @@ class FixedArray
inline bool is_the_hole(Isolate* isolate, int index);
// Setter that doesn't need write barrier.
-#if defined(_WIN32) && !defined(_WIN64)
- inline void set(int index, Smi value) {
- DCHECK_NE(map(), GetReadOnlyRoots().fixed_cow_array_map());
- DCHECK_LT(static_cast<unsigned>(index), static_cast<unsigned>(length()));
- DCHECK(Object(value).IsSmi());
- int offset = OffsetOfElementAt(index);
- RELAXED_WRITE_FIELD(*this, offset, value);
- }
-#else
inline void set(int index, Smi value);
-#endif
-
// Setter with explicit barrier mode.
inline void set(int index, Object value, WriteBarrierMode mode);
@@ -278,7 +268,7 @@ class WeakFixedArray
: public TorqueGeneratedWeakFixedArray<WeakFixedArray, HeapObject> {
public:
inline MaybeObject Get(int index) const;
- inline MaybeObject Get(const Isolate* isolate, int index) const;
+ inline MaybeObject Get(IsolateRoot isolate, int index) const;
inline void Set(
int index, MaybeObject value,
@@ -353,7 +343,7 @@ class WeakArrayList
V8_EXPORT_PRIVATE void Compact(Isolate* isolate);
inline MaybeObject Get(int index) const;
- inline MaybeObject Get(const Isolate* isolate, int index) const;
+ inline MaybeObject Get(IsolateRoot isolate, int index) const;
// Set the element at index to obj. The underlying array must be large enough.
// If you need to grow the WeakArrayList, use the static AddToEnd() method
@@ -366,7 +356,7 @@ class WeakArrayList
}
static constexpr int CapacityForLength(int length) {
- return length + Max(length / 2, 2);
+ return length + std::max(length / 2, 2);
}
// Gives access to raw memory which stores the array's data.
@@ -416,6 +406,8 @@ class WeakArrayList
class WeakArrayList::Iterator {
public:
explicit Iterator(WeakArrayList array) : index_(0), array_(array) {}
+ Iterator(const Iterator&) = delete;
+ Iterator& operator=(const Iterator&) = delete;
inline HeapObject Next();
@@ -425,7 +417,6 @@ class WeakArrayList::Iterator {
#ifdef DEBUG
DisallowHeapAllocation no_gc_;
#endif // DEBUG
- DISALLOW_COPY_AND_ASSIGN(Iterator);
};
// Generic array grows dynamically with O(1) amortized insertion.
@@ -454,7 +445,7 @@ class ArrayList : public TorqueGeneratedArrayList<ArrayList, FixedArray> {
// storage capacity, i.e., length().
inline void SetLength(int length);
inline Object Get(int index) const;
- inline Object Get(const Isolate* isolate, int index) const;
+ inline Object Get(IsolateRoot isolate, int index) const;
inline ObjectSlot Slot(int index);
// Set the element at index to obj. The underlying array must be large enough.
@@ -600,7 +591,7 @@ class TemplateList
static Handle<TemplateList> New(Isolate* isolate, int size);
inline int length() const;
inline Object get(int index) const;
- inline Object get(const Isolate* isolate, int index) const;
+ inline Object get(IsolateRoot isolate, int index) const;
inline void set(int index, Object value);
static Handle<TemplateList> Add(Isolate* isolate, Handle<TemplateList> list,
Handle<Object> value);