summaryrefslogtreecommitdiff
path: root/deps/v8/src/objects/property-array.h
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2018-12-04 08:20:37 +0100
committerMichaël Zasso <targos@protonmail.com>2018-12-06 15:23:33 +0100
commit9b4bf7de6c9a7c25f116c7a502384c20b5cfaea3 (patch)
tree2b0c843168dafb939d8df8a15b2aa72b76dee51d /deps/v8/src/objects/property-array.h
parentb8fbe69db1292307adb2c2b2e0d5ef48c4ab2faf (diff)
downloadnode-new-9b4bf7de6c9a7c25f116c7a502384c20b5cfaea3.tar.gz
deps: update V8 to 7.1.302.28
PR-URL: https://github.com/nodejs/node/pull/23423 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'deps/v8/src/objects/property-array.h')
-rw-r--r--deps/v8/src/objects/property-array.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/deps/v8/src/objects/property-array.h b/deps/v8/src/objects/property-array.h
new file mode 100644
index 0000000000..70f535a8f0
--- /dev/null
+++ b/deps/v8/src/objects/property-array.h
@@ -0,0 +1,73 @@
+// Copyright 2018 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_OBJECTS_PROPERTY_ARRAY_H_
+#define V8_OBJECTS_PROPERTY_ARRAY_H_
+
+#include "src/objects.h"
+
+// Has to be the last include (doesn't have include guards):
+#include "src/objects/object-macros.h"
+
+namespace v8 {
+namespace internal {
+
+class PropertyArray : public HeapObject {
+ public:
+ // [length]: length of the array.
+ inline int length() const;
+
+ // Get the length using acquire loads.
+ inline int synchronized_length() const;
+
+ // This is only used on a newly allocated PropertyArray which
+ // doesn't have an existing hash.
+ inline void initialize_length(int length);
+
+ inline void SetHash(int hash);
+ inline int Hash() const;
+
+ inline Object* get(int index) const;
+
+ inline void set(int index, Object* value);
+ // Setter with explicit barrier mode.
+ inline void set(int index, Object* value, WriteBarrierMode mode);
+
+ // Gives access to raw memory which stores the array's data.
+ inline Object** data_start();
+
+ // Garbage collection support.
+ static constexpr int SizeFor(int length) {
+ return kHeaderSize + length * kPointerSize;
+ }
+
+ DECL_CAST(PropertyArray)
+ DECL_PRINTER(PropertyArray)
+ DECL_VERIFIER(PropertyArray)
+
+ // Layout description.
+ static const int kLengthAndHashOffset = HeapObject::kHeaderSize;
+ static const int kHeaderSize = kLengthAndHashOffset + kPointerSize;
+
+ // Garbage collection support.
+ typedef FlexibleBodyDescriptor<kHeaderSize> BodyDescriptor;
+
+ static const int kLengthFieldSize = 10;
+ class LengthField : public BitField<int, 0, kLengthFieldSize> {};
+ static const int kMaxLength = LengthField::kMax;
+ class HashField : public BitField<int, kLengthFieldSize,
+ kSmiValueSize - kLengthFieldSize - 1> {};
+
+ static const int kNoHashSentinel = 0;
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(PropertyArray);
+};
+
+} // namespace internal
+} // namespace v8
+
+#include "src/objects/object-macros-undef.h"
+
+#endif // V8_OBJECTS_PROPERTY_ARRAY_H_