Loading...
Searching...
No Matches
v8-object.h
Go to the documentation of this file.
1// Copyright 2021 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef INCLUDE_V8_OBJECT_H_
6#define INCLUDE_V8_OBJECT_H_
7
8#include "v8-internal.h" // NOLINT(build/include_directory)
9#include "v8-local-handle.h" // NOLINT(build/include_directory)
10#include "v8-maybe.h" // NOLINT(build/include_directory)
11#include "v8-persistent-handle.h" // NOLINT(build/include_directory)
12#include "v8-primitive.h" // NOLINT(build/include_directory)
13#include "v8-sandbox.h" // NOLINT(build/include_directory)
14#include "v8-traced-handle.h" // NOLINT(build/include_directory)
15#include "v8-value.h" // NOLINT(build/include_directory)
16#include "v8config.h" // NOLINT(build/include_directory)
17
18namespace v8 {
19
20class Array;
21class Function;
22class FunctionTemplate;
23template <typename T>
24class PropertyCallbackInfo;
25
31class V8_EXPORT Private : public Data {
32 public:
37
41 static Local<Private> New(Isolate* isolate,
43
54
55 V8_INLINE static Private* Cast(Data* data);
56
57 private:
58 Private();
59
60 static void CheckCast(Data* that);
61};
62
92 public:
93 // GenericDescriptor
95
96 // DataDescriptor
98
99 // DataDescriptor with writable property
100 PropertyDescriptor(Local<Value> value, bool writable);
101
102 // AccessorDescriptor
104
106
108 bool has_value() const;
109
111 bool has_get() const;
113 bool has_set() const;
114
115 void set_enumerable(bool enumerable);
116 bool enumerable() const;
117 bool has_enumerable() const;
118
119 void set_configurable(bool configurable);
120 bool configurable() const;
121 bool has_configurable() const;
122
123 bool writable() const;
124 bool has_writable() const;
125
126 struct PrivateData;
127 PrivateData* get_private() const { return private_; }
128
130 void operator=(const PropertyDescriptor&) = delete;
131
132 private:
133 PrivateData* private_;
134};
135
141 None = 0,
143 ReadOnly = 1 << 0,
145 DontEnum = 1 << 1,
147 DontDelete = 1 << 2
149
156 void (*)(Local<Name> property, const PropertyCallbackInfo<Value>& info);
157
159 void (*)(Local<Name> property, Local<Value> value,
160 const PropertyCallbackInfo<void>& info);
161
171 "This enum is no longer used and will be removed in V8 12.9.")
174 };
175
185 SKIP_SYMBOLS = 16
187
198enum class SideEffectType {
202};
203
212
218
224
229
233class V8_EXPORT Object : public Value {
234 public:
240 Local<Value> key, Local<Value> value);
242 Local<Value> key, Local<Value> value,
243 MaybeLocal<Object> receiver);
244
246 Local<Value> value);
247
259 Local<Name> key,
260 Local<Value> value);
262 uint32_t index,
263 Local<Value> value);
264
275 Local<Context> context, Local<Name> key, Local<Value> value,
276 PropertyAttribute attributes = None);
277
295 Local<Context> context, Local<Name> key, PropertyDescriptor& descriptor);
296
298 Local<Value> key);
300 Local<Value> key,
301 MaybeLocal<Object> receiver);
302
304 uint32_t index);
305
312 Local<Context> context, Local<Value> key);
313
319 Local<Context> context, Local<Name> key);
320
337 Local<Value> key);
338
340 Local<Value> key);
341
343
345 uint32_t index);
346
353 PropertyAttribute attributes = None);
354
360 Local<Context> context, Local<Name> name,
362 AccessorNameSetterCallback setter = nullptr,
363 Local<Value> data = Local<Value>(), PropertyAttribute attributes = None,
364 SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
365 SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect);
366
376 Local<Context> context, Local<Name> name,
378 PropertyAttribute attributes = None,
379 SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
380 SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect);
381
390 Local<Value> value);
393
401 Local<Context> context);
403 Local<Context> context, KeyCollectionMode mode,
404 PropertyFilter property_filter, IndexFilter index_filter,
405 KeyConversionMode key_conversion = KeyConversionMode::kKeepNumbers);
406
413 Local<Context> context);
414
422 Local<Context> context, PropertyFilter filter,
423 KeyConversionMode key_conversion = KeyConversionMode::kKeepNumbers);
424
431 "V8 will stop providing access to hidden prototype (i.e. "
432 "JSGlobalObject). Use GetPrototypeV2() instead. "
433 "See http://crbug.com/333672197.")
434 Local<Value> GetPrototype();
435
442 Local<Value> GetPrototypeV2();
443
450 "V8 will stop providing access to hidden prototype (i.e. "
451 "JSGlobalObject). Use SetPrototypeV2() instead. "
452 "See http://crbug.com/333672197.")
453 V8_WARN_UNUSED_RESULT Maybe<bool> SetPrototype(Local<Context> context,
454 Local<Value> prototype);
455
462 V8_WARN_UNUSED_RESULT Maybe<bool> SetPrototypeV2(Local<Context> context,
463 Local<Value> prototype);
464
469 Local<Object> FindInstanceInPrototypeChain(Local<FunctionTemplate> tmpl);
470
477 Local<Context> context);
478
482 Local<String> GetConstructorName();
483
487 Maybe<bool> SetIntegrityLevel(Local<Context> context, IntegrityLevel level);
488
490 int InternalFieldCount() const;
491
493 V8_INLINE static int InternalFieldCount(
494 const PersistentBase<Object>& object) {
495 return object.template value<Object>()->InternalFieldCount();
496 }
497
500 const BasicTracedReference<Object>& object) {
501 return object.template value<Object>()->InternalFieldCount();
502 }
503
514 V8_INLINE Local<Data> GetInternalField(int index);
515
517 void SetInternalField(int index, Local<Data> data);
518
524 V8_INLINE void* GetAlignedPointerFromInternalField(int index);
525 V8_INLINE void* GetAlignedPointerFromInternalField(v8::Isolate* isolate,
526 int index);
527
530 const PersistentBase<Object>& object, int index) {
531 return object.template value<Object>()->GetAlignedPointerFromInternalField(
532 index);
533 }
534
537 const BasicTracedReference<Object>& object, int index) {
538 return object.template value<Object>()->GetAlignedPointerFromInternalField(
539 index);
540 }
541
547 void SetAlignedPointerInInternalField(int index, void* value);
548 void SetAlignedPointerInInternalFields(int argc, int indices[],
549 void* values[]);
550
561 template <CppHeapPointerTag tag, typename T = void>
562 static V8_INLINE T* Unwrap(v8::Isolate* isolate,
563 const v8::Local<v8::Object>& wrapper);
564 template <CppHeapPointerTag tag, typename T = void>
565 static V8_INLINE T* Unwrap(v8::Isolate* isolate,
566 const PersistentBase<Object>& wrapper);
567 template <CppHeapPointerTag tag, typename T = void>
568 static V8_INLINE T* Unwrap(v8::Isolate* isolate,
569 const BasicTracedReference<Object>& wrapper);
570
571 template <typename T = void>
572 static V8_INLINE T* Unwrap(v8::Isolate* isolate,
573 const v8::Local<v8::Object>& wrapper,
574 CppHeapPointerTagRange tag_range);
575 template <typename T = void>
576 static V8_INLINE T* Unwrap(v8::Isolate* isolate,
577 const PersistentBase<Object>& wrapper,
578 CppHeapPointerTagRange tag_range);
579 template <typename T = void>
580 static V8_INLINE T* Unwrap(v8::Isolate* isolate,
581 const BasicTracedReference<Object>& wrapper,
582 CppHeapPointerTagRange tag_range);
583
593 template <CppHeapPointerTag tag>
594 static V8_INLINE void Wrap(v8::Isolate* isolate,
595 const v8::Local<v8::Object>& wrapper,
596 void* wrappable);
597 template <CppHeapPointerTag tag>
598 static V8_INLINE void Wrap(v8::Isolate* isolate,
599 const PersistentBase<Object>& wrapper,
600 void* wrappable);
601 template <CppHeapPointerTag tag>
602 static V8_INLINE void Wrap(v8::Isolate* isolate,
603 const BasicTracedReference<Object>& wrapper,
604 void* wrappable);
605 static V8_INLINE void Wrap(v8::Isolate* isolate,
606 const v8::Local<v8::Object>& wrapper,
607 void* wrappable, CppHeapPointerTag tag);
608 static V8_INLINE void Wrap(v8::Isolate* isolate,
609 const PersistentBase<Object>& wrapper,
610 void* wrappable, CppHeapPointerTag tag);
611 static V8_INLINE void Wrap(v8::Isolate* isolate,
612 const BasicTracedReference<Object>& wrapper,
613 void* wrappable, CppHeapPointerTag tag);
614
622 Local<Name> key);
624 uint32_t index);
639 Local<Name> key);
641 Local<Context> context, uint32_t index);
643 Local<Context> context, Local<Name> key);
644
650 Local<Context> context, Local<Name> key);
651
659 Local<Name> key);
660
667 Local<Context> context, Local<Name> key);
668
675 Local<Context> context, Local<Name> key);
676
679
682
691
700
708
716
719 const PersistentBase<Object>& object) {
720 return object.template value<Object>()->GetCreationContext();
721 }
722
738 int index);
740
746 bool IsCallable() const;
747
751 bool IsConstructor() const;
752
764 bool IsApiWrapper() const;
765
771 bool IsUndetectable() const;
772
778 Local<Value> recv,
779 int argc,
780 Local<Value> argv[]);
781
788 Local<Context> context, int argc, Local<Value> argv[]);
789
794
796 return handle.template value<Object>()->GetIsolate();
797 }
798
809
810 static Local<Object> New(Isolate* isolate);
811
820 static Local<Object> New(Isolate* isolate, Local<Value> prototype_or_null,
821 Local<Name>* names, Local<Value>* values,
822 size_t length);
823
824 V8_INLINE static Object* Cast(Value* obj);
825
834 bool IsCodeLike(Isolate* isolate) const;
835
836 private:
837 static void* Unwrap(v8::Isolate* isolate, internal::Address wrapper_obj,
838 CppHeapPointerTagRange tag_range);
839 static void Wrap(v8::Isolate* isolate, internal::Address wrapper_obj,
840 CppHeapPointerTag tag, void* wrappable);
841
842 Object();
843 static void CheckCast(Value* obj);
844 Local<Data> SlowGetInternalField(int index);
845 void* SlowGetAlignedPointerFromInternalField(int index);
846 void* SlowGetAlignedPointerFromInternalField(v8::Isolate* isolate, int index);
847};
848
849// --- Implementation ---
850
852#ifndef V8_ENABLE_CHECKS
853 using A = internal::Address;
854 using I = internal::Internals;
856 // Fast path: If the object is a plain JSObject, which is the common case, we
857 // know where to find the internal fields and can return the value directly.
858 int instance_type = I::GetInstanceType(obj);
859 if (I::CanHaveInternalField(instance_type)) {
860 int offset = I::kJSAPIObjectWithEmbedderSlotsHeaderSize +
861 (I::kEmbedderDataSlotSize * index);
862 A value = I::ReadRawField<A>(obj, offset);
863#ifdef V8_COMPRESS_POINTERS
864 // We read the full pointer value and then decompress it in order to avoid
865 // dealing with potential endiannes issues.
866 value = I::DecompressTaggedField(obj, static_cast<uint32_t>(value));
867#endif
868
869 auto isolate = reinterpret_cast<v8::Isolate*>(
871 return Local<Data>::New(isolate, value);
872 }
873#endif
874 return SlowGetInternalField(index);
875}
876
878 int index) {
879#if !defined(V8_ENABLE_CHECKS)
880 using A = internal::Address;
881 using I = internal::Internals;
883 // Fast path: If the object is a plain JSObject, which is the common case, we
884 // know where to find the internal fields and can return the value directly.
885 auto instance_type = I::GetInstanceType(obj);
886 if (V8_LIKELY(I::CanHaveInternalField(instance_type))) {
887 int offset = I::kJSAPIObjectWithEmbedderSlotsHeaderSize +
888 (I::kEmbedderDataSlotSize * index) +
889 I::kEmbedderDataSlotExternalPointerOffset;
890 A value =
891 I::ReadExternalPointerField<internal::kEmbedderDataSlotPayloadTag>(
892 isolate, obj, offset);
893 return reinterpret_cast<void*>(value);
894 }
895#endif
896 return SlowGetAlignedPointerFromInternalField(isolate, index);
897}
898
900#if !defined(V8_ENABLE_CHECKS)
901 using A = internal::Address;
902 using I = internal::Internals;
904 // Fast path: If the object is a plain JSObject, which is the common case, we
905 // know where to find the internal fields and can return the value directly.
906 auto instance_type = I::GetInstanceType(obj);
907 if (V8_LIKELY(I::CanHaveInternalField(instance_type))) {
908 int offset = I::kJSAPIObjectWithEmbedderSlotsHeaderSize +
909 (I::kEmbedderDataSlotSize * index) +
910 I::kEmbedderDataSlotExternalPointerOffset;
911 Isolate* isolate = I::GetIsolateForSandbox(obj);
912 A value =
913 I::ReadExternalPointerField<internal::kEmbedderDataSlotPayloadTag>(
914 isolate, obj, offset);
915 return reinterpret_cast<void*>(value);
916 }
917#endif
918 return SlowGetAlignedPointerFromInternalField(index);
919}
920
921// static
922template <CppHeapPointerTag tag, typename T>
924 CppHeapPointerTagRange tag_range(tag, tag);
925 auto obj = internal::ValueHelper::ValueAsAddress(*wrapper);
926#if !defined(V8_ENABLE_CHECKS)
927 return internal::ReadCppHeapPointerField<T>(
928 isolate, obj, internal::Internals::kJSObjectHeaderSize, tag_range);
929#else // defined(V8_ENABLE_CHECKS)
930 return reinterpret_cast<T*>(Unwrap(isolate, obj, tag_range));
931#endif // defined(V8_ENABLE_CHECKS)
932}
933
934// static
935template <CppHeapPointerTag tag, typename T>
937 CppHeapPointerTagRange tag_range(tag, tag);
938 auto obj =
939 internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
940#if !defined(V8_ENABLE_CHECKS)
941 return internal::ReadCppHeapPointerField<T>(
942 isolate, obj, internal::Internals::kJSObjectHeaderSize, tag_range);
943#else // defined(V8_ENABLE_CHECKS)
944 return reinterpret_cast<T*>(Unwrap(isolate, obj, tag_range));
945#endif // defined(V8_ENABLE_CHECKS)
946}
947
948// static
949template <CppHeapPointerTag tag, typename T>
951 const BasicTracedReference<Object>& wrapper) {
952 CppHeapPointerTagRange tag_range(tag, tag);
953 auto obj =
954 internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
955#if !defined(V8_ENABLE_CHECKS)
956 return internal::ReadCppHeapPointerField<T>(
957 isolate, obj, internal::Internals::kJSObjectHeaderSize, tag_range);
958#else // defined(V8_ENABLE_CHECKS)
959 return reinterpret_cast<T*>(Unwrap(isolate, obj, tag_range));
960#endif // defined(V8_ENABLE_CHECKS)
961}
962
963// static
964template <typename T>
966 CppHeapPointerTagRange tag_range) {
967 auto obj = internal::ValueHelper::ValueAsAddress(*wrapper);
968#if !defined(V8_ENABLE_CHECKS)
969 return internal::ReadCppHeapPointerField<T>(
970 isolate, obj, internal::Internals::kJSObjectHeaderSize, tag_range);
971#else // defined(V8_ENABLE_CHECKS)
972 return reinterpret_cast<T*>(Unwrap(isolate, obj, tag_range));
973#endif // defined(V8_ENABLE_CHECKS)
974}
975
976// static
977template <typename T>
979 CppHeapPointerTagRange tag_range) {
980 auto obj =
981 internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
982#if !defined(V8_ENABLE_CHECKS)
983 return internal::ReadCppHeapPointerField<T>(
984 isolate, obj, internal::Internals::kJSObjectHeaderSize, tag_range);
985#else // defined(V8_ENABLE_CHECKS)
986
987 return reinterpret_cast<T*>(Unwrap(isolate, obj, tag_range));
988#endif // defined(V8_ENABLE_CHECKS)
989}
990
991// static
992template <typename T>
994 const BasicTracedReference<Object>& wrapper,
995 CppHeapPointerTagRange tag_range) {
996 auto obj =
997 internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
998#if !defined(V8_ENABLE_CHECKS)
999 return internal::ReadCppHeapPointerField<T>(
1000 isolate, obj, internal::Internals::kJSObjectHeaderSize, tag_range);
1001#else // defined(V8_ENABLE_CHECKS)
1002 return reinterpret_cast<T*>(Unwrap(isolate, obj, tag_range));
1003#endif // defined(V8_ENABLE_CHECKS)
1004}
1005
1006// static
1007template <CppHeapPointerTag tag>
1008void Object::Wrap(v8::Isolate* isolate, const v8::Local<v8::Object>& wrapper,
1009 void* wrappable) {
1010 auto obj = internal::ValueHelper::ValueAsAddress(*wrapper);
1011 Wrap(isolate, obj, tag, wrappable);
1012}
1013
1014// static
1015template <CppHeapPointerTag tag>
1017 void* wrappable) {
1018 auto obj =
1019 internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
1020 Wrap(isolate, obj, tag, wrappable);
1021}
1022
1023// static
1024template <CppHeapPointerTag tag>
1026 const BasicTracedReference<Object>& wrapper,
1027 void* wrappable) {
1028 auto obj =
1029 internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
1030 Wrap(isolate, obj, tag, wrappable);
1031}
1032
1033// static
1034void Object::Wrap(v8::Isolate* isolate, const v8::Local<v8::Object>& wrapper,
1035 void* wrappable, CppHeapPointerTag tag) {
1036 auto obj = internal::ValueHelper::ValueAsAddress(*wrapper);
1037 Wrap(isolate, obj, tag, wrappable);
1038}
1039
1040// static
1042 void* wrappable, CppHeapPointerTag tag) {
1043 auto obj =
1044 internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
1045 Wrap(isolate, obj, tag, wrappable);
1046}
1047
1048// static
1050 const BasicTracedReference<Object>& wrapper, void* wrappable,
1051 CppHeapPointerTag tag) {
1052 auto obj =
1053 internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
1054 Wrap(isolate, obj, tag, wrappable);
1055}
1056
1058#ifdef V8_ENABLE_CHECKS
1059 CheckCast(data);
1060#endif
1061 return reinterpret_cast<Private*>(data);
1062}
1063
1065#ifdef V8_ENABLE_CHECKS
1066 CheckCast(value);
1067#endif
1068 return static_cast<Object*>(value);
1069}
1070
1071} // namespace v8
1072
1073#endif // INCLUDE_V8_OBJECT_H_
Definition: v8-traced-handle.h:125
Definition: v8-context.h:48
Definition: v8-data.h:18
Definition: v8-template.h:570
Definition: v8-isolate.h:211
Definition: v8-local-handle.h:256
static Local< T > New(Isolate *isolate, Local< T > that)
Definition: v8-local-handle.h:336
Definition: v8-local-handle.h:614
Definition: v8-maybe.h:32
Definition: v8-object.h:233
Maybe< PropertyAttribute > GetRealNamedPropertyAttributesInPrototypeChain(Local< Context > context, Local< Name > key)
Maybe< PropertyAttribute > GetPropertyAttributes(Local< Context > context, Local< Value > key)
void SetAlignedPointerInInternalField(int index, void *value)
Maybe< bool > CreateDataProperty(Local< Context > context, uint32_t index, Local< Value > value)
Local< Context > GetCreationContextChecked(v8::Isolate *isolate)
MaybeLocal< Value > GetOwnPropertyDescriptor(Local< Context > context, Local< Name > key)
static void Wrap(v8::Isolate *isolate, const v8::Local< v8::Object > &wrapper, void *wrappable)
Definition: v8-object.h:1008
static Object * Cast(Value *obj)
Definition: v8-object.h:1064
bool HasNamedLookupInterceptor() const
Maybe< bool > SetPrivate(Local< Context > context, Local< Private > key, Local< Value > value)
Maybe< bool > HasRealNamedProperty(Local< Context > context, Local< Name > key)
MaybeLocal< Array > GetPropertyNames(Local< Context > context)
Maybe< bool > Delete(Local< Context > context, uint32_t index)
MaybeLocal< Value > GetRealNamedProperty(Local< Context > context, Local< Name > key)
Maybe< bool > DefineProperty(Local< Context > context, Local< Name > key, PropertyDescriptor &descriptor)
Maybe< bool > Delete(Local< Context > context, Local< Value > key)
bool IsConstructor() const
bool IsUndetectable() const
MaybeLocal< Value > CallAsFunction(Local< Context > context, Local< Value > recv, int argc, Local< Value > argv[])
Local< Object > Clone()
Maybe< bool > DefineOwnProperty(Local< Context > context, Local< Name > key, Local< Value > value, PropertyAttribute attributes=None)
void * GetAlignedPointerFromInternalField(int index)
Definition: v8-object.h:899
Maybe< bool > SetNativeDataProperty(Local< Context > context, Local< Name > name, AccessorNameGetterCallback getter, AccessorNameSetterCallback setter=nullptr, Local< Value > data=Local< Value >(), PropertyAttribute attributes=None, SideEffectType getter_side_effect_type=SideEffectType::kHasSideEffect, SideEffectType setter_side_effect_type=SideEffectType::kHasSideEffect)
void * GetAlignedPointerFromEmbedderDataInCreationContext(v8::Isolate *isolate, int index)
void * GetAlignedPointerFromEmbedderDataInCreationContext(int index)
MaybeLocal< Value > GetRealNamedPropertyInPrototypeChain(Local< Context > context, Local< Name > key)
static int InternalFieldCount(const BasicTracedReference< Object > &object)
Definition: v8-object.h:499
Maybe< bool > Has(Local< Context > context, Local< Value > key)
MaybeLocal< Array > GetOwnPropertyNames(Local< Context > context)
bool IsCodeLike(Isolate *isolate) const
Maybe< bool > Set(Local< Context > context, Local< Value > key, Local< Value > value)
MaybeLocal< Value > CallAsConstructor(Local< Context > context, int argc, Local< Value > argv[])
static void * GetAlignedPointerFromInternalField(const PersistentBase< Object > &object, int index)
Definition: v8-object.h:529
MaybeLocal< Value > GetPrivate(Local< Context > context, Local< Private > key)
void SetAccessorProperty(Local< Name > name, Local< Function > getter, Local< Function > setter=Local< Function >(), PropertyAttribute attributes=None)
Maybe< bool > CreateDataProperty(Local< Context > context, Local< Name > key, Local< Value > value)
Maybe< bool > HasRealIndexedProperty(Local< Context > context, uint32_t index)
Isolate * GetIsolate()
Maybe< bool > SetLazyDataProperty(Local< Context > context, Local< Name > name, AccessorNameGetterCallback getter, Local< Value > data=Local< Value >(), PropertyAttribute attributes=None, SideEffectType getter_side_effect_type=SideEffectType::kHasSideEffect, SideEffectType setter_side_effect_type=SideEffectType::kHasSideEffect)
bool IsApiWrapper() const
MaybeLocal< Value > Get(Local< Context > context, uint32_t index)
MaybeLocal< Array > GetPropertyNames(Local< Context > context, KeyCollectionMode mode, PropertyFilter property_filter, IndexFilter index_filter, KeyConversionMode key_conversion=KeyConversionMode::kKeepNumbers)
Local< Data > GetInternalField(int index)
Definition: v8-object.h:851
Maybe< PropertyAttribute > GetRealNamedPropertyAttributes(Local< Context > context, Local< Name > key)
static Isolate * GetIsolate(const TracedReference< Object > &handle)
Definition: v8-object.h:795
Local< Context > GetCreationContextChecked()
Maybe< bool > HasPrivate(Local< Context > context, Local< Private > key)
MaybeLocal< Context > GetCreationContext()
MaybeLocal< Value > Get(Local< Context > context, Local< Value > key)
static Local< Object > New(Isolate *isolate)
int GetIdentityHash()
MaybeLocal< Context > GetCreationContext(v8::Isolate *isolate)
void SetInternalField(int index, Local< Data > data)
static T * Unwrap(v8::Isolate *isolate, const v8::Local< v8::Object > &wrapper)
Definition: v8-object.h:923
MaybeLocal< Array > GetOwnPropertyNames(Local< Context > context, PropertyFilter filter, KeyConversionMode key_conversion=KeyConversionMode::kKeepNumbers)
Maybe< bool > Set(Local< Context > context, uint32_t index, Local< Value > value)
Local< Object > Clone(v8::Isolate *isolate)
Maybe< bool > HasOwnProperty(Local< Context > context, Local< Name > key)
Maybe< bool > Has(Local< Context > context, uint32_t index)
MaybeLocal< Array > PreviewEntries(bool *is_key_value)
static MaybeLocal< Context > GetCreationContext(const PersistentBase< Object > &object)
Definition: v8-object.h:718
bool IsCallable() const
Maybe< bool > DeletePrivate(Local< Context > context, Local< Private > key)
MaybeLocal< Value > Get(Local< Context > context, Local< Value > key, MaybeLocal< Object > receiver)
void SetAlignedPointerInInternalFields(int argc, int indices[], void *values[])
Maybe< bool > HasRealNamedCallbackProperty(Local< Context > context, Local< Name > key)
Maybe< bool > Set(Local< Context > context, Local< Value > key, Local< Value > value, MaybeLocal< Object > receiver)
static void * GetAlignedPointerFromInternalField(const BasicTracedReference< Object > &object, int index)
Definition: v8-object.h:536
Maybe< bool > HasOwnProperty(Local< Context > context, uint32_t index)
static Local< Object > New(Isolate *isolate, Local< Value > prototype_or_null, Local< Name > *names, Local< Value > *values, size_t length)
bool HasIndexedLookupInterceptor() const
Definition: v8-persistent-handle.h:89
Definition: v8-object.h:31
static Private * Cast(Data *data)
Definition: v8-object.h:1057
Local< Value > Name() const
static Local< Private > ForApi(Isolate *isolate, Local< String > name)
static Local< Private > New(Isolate *isolate, Local< String > name=Local< String >())
Definition: v8-function-callback.h:206
Definition: v8-object.h:91
void set_enumerable(bool enumerable)
bool has_writable() const
bool has_value() const
Local< Value > get() const
Local< Value > set() const
PropertyDescriptor(Local< Value > get, Local< Value > set)
bool has_enumerable() const
PropertyDescriptor(Local< Value > value)
PrivateData * get_private() const
Definition: v8-object.h:127
void operator=(const PropertyDescriptor &)=delete
Local< Value > value() const
bool enumerable() const
PropertyDescriptor(Local< Value > value, bool writable)
void set_configurable(bool configurable)
PropertyDescriptor(const PropertyDescriptor &)=delete
bool has_configurable() const
bool configurable() const
Definition: v8-primitive.h:124
Definition: v8-traced-handle.h:166
Definition: v8-initialization.h:61
Definition: v8-value.h:32
Definition: v8-internal.h:840
static const int kJSObjectHeaderSize
Definition: v8-internal.h:857
static Address ValueAsAddress(const T *value)
Definition: v8-internal.h:1595
internal::Isolate * IsolateFromNeverReadOnlySpaceObject(Address obj)
uintptr_t Address
Definition: v8-internal.h:33
Definition: libplatform.h:15
IntegrityLevel
Definition: v8-object.h:228
PropertyAttribute
Definition: v8-object.h:139
@ DontEnum
Definition: v8-object.h:145
@ None
Definition: v8-object.h:141
@ DontDelete
Definition: v8-object.h:147
@ ReadOnly
Definition: v8-object.h:143
KeyCollectionMode
Definition: v8-object.h:211
void(*)(Local< Name > property, const PropertyCallbackInfo< Value > &info) AccessorNameGetterCallback
Definition: v8-object.h:156
SideEffectType
Definition: v8-object.h:198
AccessControl
Definition: v8-object.h:172
@ DEFAULT
Definition: v8-object.h:173
IndexFilter
Definition: v8-object.h:217
KeyConversionMode
Definition: v8-object.h:223
CppHeapPointerTag
Definition: v8-sandbox.h:29
void(*)(Local< Name > property, Local< Value > value, const PropertyCallbackInfo< void > &info) AccessorNameSetterCallback
Definition: v8-object.h:160
PropertyFilter
Definition: v8-object.h:179
@ ONLY_CONFIGURABLE
Definition: v8-object.h:183
@ SKIP_SYMBOLS
Definition: v8-object.h:185
@ ONLY_WRITABLE
Definition: v8-object.h:181
@ ALL_PROPERTIES
Definition: v8-object.h:180
@ SKIP_STRINGS
Definition: v8-object.h:184
@ ONLY_ENUMERABLE
Definition: v8-object.h:182
Definition: v8-sandbox.h:70
#define V8_EXPORT
Definition: v8config.h:779
#define V8_INLINE
Definition: v8config.h:493
#define V8_DEPRECATE_SOON(message)
Definition: v8config.h:597
#define V8_LIKELY(condition)
Definition: v8config.h:644
#define V8_WARN_UNUSED_RESULT
Definition: v8config.h:654
#define V8_ENUM_DEPRECATE_SOON(message)
Definition: v8config.h:634