v8 13.6.233 (node 24.1.0)
V8 is Google's open source JavaScript engine
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;
23template <typename T>
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
101
102 // AccessorDescriptor
104
106
108 bool has_value() const;
109
111 bool has_get() const;
113 bool has_set() const;
114
116 bool enumerable() const;
117 bool has_enumerable() const;
118
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
148};
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.")
172 AccessControl {
173 DEFAULT V8_ENUM_DEPRECATE_SOON("not used") = 0,
174 };
175
187
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,
406
413 Local<Context> context);
414
422 Local<Context> context, PropertyFilter filter,
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
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,
455
464
470
477 Local<Context> context);
478
483
488
491
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
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
707 V8_DEPRECATE_SOON("Use the version with the isolate argument.")
709
716 V8_DEPRECATE_SOON("Use the version with the isolate argument.")
718
721 v8::Isolate* isolate, const PersistentBase<Object>& object) {
722 return object.template value<Object>()->GetCreationContext(isolate);
723 }
724 V8_DEPRECATE_SOON("Use the version with the isolate argument.")
726 const PersistentBase<Object>& object);
727
743 int index);
745
751 bool IsCallable() const;
752
756 bool IsConstructor() const;
757
769 bool IsApiWrapper() const;
770
776 bool IsUndetectable() const;
777
783 Local<Value> recv,
784 int argc,
785 Local<Value> argv[]);
786
793 Local<Context> context, int argc, Local<Value> argv[]);
794
799
800 V8_INLINE static Isolate* GetIsolate(const TracedReference<Object>& handle) {
801 return handle.template value<Object>()->GetIsolate();
802 }
803
814
815 static Local<Object> New(Isolate* isolate);
816
825 static Local<Object> New(Isolate* isolate, Local<Value> prototype_or_null,
826 Local<Name>* names, Local<Value>* values,
827 size_t length);
828
829 V8_INLINE static Object* Cast(Value* obj);
830
839 bool IsCodeLike(Isolate* isolate) const;
840
841 private:
842 static void* Unwrap(v8::Isolate* isolate, internal::Address wrapper_obj,
843 CppHeapPointerTagRange tag_range);
844 static void Wrap(v8::Isolate* isolate, internal::Address wrapper_obj,
845 CppHeapPointerTag tag, void* wrappable);
846
847 Object();
848 static void CheckCast(Value* obj);
849 Local<Data> SlowGetInternalField(int index);
850 void* SlowGetAlignedPointerFromInternalField(int index);
851 void* SlowGetAlignedPointerFromInternalField(v8::Isolate* isolate, int index);
852};
853
854// --- Implementation ---
855
857#ifndef V8_ENABLE_CHECKS
858 using A = internal::Address;
859 using I = internal::Internals;
861 // Fast path: If the object is a plain JSObject, which is the common case, we
862 // know where to find the internal fields and can return the value directly.
863 int instance_type = I::GetInstanceType(obj);
864 if (I::CanHaveInternalField(instance_type)) {
865 int offset = I::kJSAPIObjectWithEmbedderSlotsHeaderSize +
866 (I::kEmbedderDataSlotSize * index);
867 A value = I::ReadRawField<A>(obj, offset);
868#ifdef V8_COMPRESS_POINTERS
869 // We read the full pointer value and then decompress it in order to avoid
870 // dealing with potential endiannes issues.
871 value = I::DecompressTaggedField(obj, static_cast<uint32_t>(value));
872#endif
873
874 auto isolate = reinterpret_cast<v8::Isolate*>(
876 return Local<Data>::New(isolate, value);
877 }
878#endif
879 return SlowGetInternalField(index);
880}
881
883 int index) {
884#if !defined(V8_ENABLE_CHECKS)
885 using A = internal::Address;
886 using I = internal::Internals;
888 // Fast path: If the object is a plain JSObject, which is the common case, we
889 // know where to find the internal fields and can return the value directly.
890 auto instance_type = I::GetInstanceType(obj);
891 if (V8_LIKELY(I::CanHaveInternalField(instance_type))) {
892 int offset = I::kJSAPIObjectWithEmbedderSlotsHeaderSize +
893 (I::kEmbedderDataSlotSize * index) +
894 I::kEmbedderDataSlotExternalPointerOffset;
895 A value =
896 I::ReadExternalPointerField<internal::kEmbedderDataSlotPayloadTag>(
897 isolate, obj, offset);
898 return reinterpret_cast<void*>(value);
899 }
900#endif
901 return SlowGetAlignedPointerFromInternalField(isolate, index);
902}
903
905#if !defined(V8_ENABLE_CHECKS)
906 using A = internal::Address;
907 using I = internal::Internals;
909 // Fast path: If the object is a plain JSObject, which is the common case, we
910 // know where to find the internal fields and can return the value directly.
911 auto instance_type = I::GetInstanceType(obj);
912 if (V8_LIKELY(I::CanHaveInternalField(instance_type))) {
913 int offset = I::kJSAPIObjectWithEmbedderSlotsHeaderSize +
914 (I::kEmbedderDataSlotSize * index) +
915 I::kEmbedderDataSlotExternalPointerOffset;
916 Isolate* isolate = I::GetIsolateForSandbox(obj);
917 A value =
918 I::ReadExternalPointerField<internal::kEmbedderDataSlotPayloadTag>(
919 isolate, obj, offset);
920 return reinterpret_cast<void*>(value);
921 }
922#endif
923 return SlowGetAlignedPointerFromInternalField(index);
924}
925
926// static
927template <CppHeapPointerTag tag, typename T>
929 CppHeapPointerTagRange tag_range(tag, tag);
930 auto obj = internal::ValueHelper::ValueAsAddress(*wrapper);
931#if !defined(V8_ENABLE_CHECKS)
932 return internal::ReadCppHeapPointerField<T>(
933 isolate, obj, internal::Internals::kJSObjectHeaderSize, tag_range);
934#else // defined(V8_ENABLE_CHECKS)
935 return reinterpret_cast<T*>(Unwrap(isolate, obj, tag_range));
936#endif // defined(V8_ENABLE_CHECKS)
937}
938
939// static
940template <CppHeapPointerTag tag, typename T>
942 CppHeapPointerTagRange tag_range(tag, tag);
943 auto obj =
944 internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
945#if !defined(V8_ENABLE_CHECKS)
946 return internal::ReadCppHeapPointerField<T>(
947 isolate, obj, internal::Internals::kJSObjectHeaderSize, tag_range);
948#else // defined(V8_ENABLE_CHECKS)
949 return reinterpret_cast<T*>(Unwrap(isolate, obj, tag_range));
950#endif // defined(V8_ENABLE_CHECKS)
951}
952
953// static
954template <CppHeapPointerTag tag, typename T>
956 const BasicTracedReference<Object>& wrapper) {
957 CppHeapPointerTagRange tag_range(tag, tag);
958 auto obj =
959 internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
960#if !defined(V8_ENABLE_CHECKS)
961 return internal::ReadCppHeapPointerField<T>(
962 isolate, obj, internal::Internals::kJSObjectHeaderSize, tag_range);
963#else // defined(V8_ENABLE_CHECKS)
964 return reinterpret_cast<T*>(Unwrap(isolate, obj, tag_range));
965#endif // defined(V8_ENABLE_CHECKS)
966}
967
968// static
969template <typename T>
971 CppHeapPointerTagRange tag_range) {
972 auto obj = internal::ValueHelper::ValueAsAddress(*wrapper);
973#if !defined(V8_ENABLE_CHECKS)
974 return internal::ReadCppHeapPointerField<T>(
975 isolate, obj, internal::Internals::kJSObjectHeaderSize, tag_range);
976#else // defined(V8_ENABLE_CHECKS)
977 return reinterpret_cast<T*>(Unwrap(isolate, obj, tag_range));
978#endif // defined(V8_ENABLE_CHECKS)
979}
980
981// static
982template <typename T>
984 CppHeapPointerTagRange tag_range) {
985 auto obj =
986 internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
987#if !defined(V8_ENABLE_CHECKS)
988 return internal::ReadCppHeapPointerField<T>(
989 isolate, obj, internal::Internals::kJSObjectHeaderSize, tag_range);
990#else // defined(V8_ENABLE_CHECKS)
991
992 return reinterpret_cast<T*>(Unwrap(isolate, obj, tag_range));
993#endif // defined(V8_ENABLE_CHECKS)
994}
995
996// static
997template <typename T>
999 const BasicTracedReference<Object>& wrapper,
1000 CppHeapPointerTagRange tag_range) {
1001 auto obj =
1002 internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
1003#if !defined(V8_ENABLE_CHECKS)
1004 return internal::ReadCppHeapPointerField<T>(
1005 isolate, obj, internal::Internals::kJSObjectHeaderSize, tag_range);
1006#else // defined(V8_ENABLE_CHECKS)
1007 return reinterpret_cast<T*>(Unwrap(isolate, obj, tag_range));
1008#endif // defined(V8_ENABLE_CHECKS)
1009}
1010
1011// static
1012template <CppHeapPointerTag tag>
1013void Object::Wrap(v8::Isolate* isolate, const v8::Local<v8::Object>& wrapper,
1014 void* wrappable) {
1015 auto obj = internal::ValueHelper::ValueAsAddress(*wrapper);
1016 Wrap(isolate, obj, tag, wrappable);
1017}
1018
1019// static
1020template <CppHeapPointerTag tag>
1022 void* wrappable) {
1023 auto obj =
1024 internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
1025 Wrap(isolate, obj, tag, wrappable);
1026}
1027
1028// static
1029template <CppHeapPointerTag tag>
1031 const BasicTracedReference<Object>& wrapper,
1032 void* wrappable) {
1033 auto obj =
1034 internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
1035 Wrap(isolate, obj, tag, wrappable);
1036}
1037
1038// static
1039void Object::Wrap(v8::Isolate* isolate, const v8::Local<v8::Object>& wrapper,
1040 void* wrappable, CppHeapPointerTag tag) {
1041 auto obj = internal::ValueHelper::ValueAsAddress(*wrapper);
1042 Wrap(isolate, obj, tag, wrappable);
1043}
1044
1045// static
1047 void* wrappable, CppHeapPointerTag tag) {
1048 auto obj =
1049 internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
1050 Wrap(isolate, obj, tag, wrappable);
1051}
1052
1053// static
1055 const BasicTracedReference<Object>& wrapper, void* wrappable,
1056 CppHeapPointerTag tag) {
1057 auto obj =
1058 internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
1059 Wrap(isolate, obj, tag, wrappable);
1060}
1061
1062Private* Private::Cast(Data* data) {
1063#ifdef V8_ENABLE_CHECKS
1064 CheckCast(data);
1065#endif
1066 return reinterpret_cast<Private*>(data);
1067}
1068
1069Object* Object::Cast(v8::Value* value) {
1070#ifdef V8_ENABLE_CHECKS
1071 CheckCast(value);
1072#endif
1073 return static_cast<Object*>(value);
1074}
1075
1076} // namespace v8
1077
1078#endif // INCLUDE_V8_OBJECT_H_
static V8_INLINE Local< T > New(Isolate *isolate, Local< T > that)
bool HasNamedLookupInterceptor() const
V8_WARN_UNUSED_RESULT MaybeLocal< Array > GetPropertyNames(Local< Context > context, KeyCollectionMode mode, PropertyFilter property_filter, IndexFilter index_filter, KeyConversionMode key_conversion=KeyConversionMode::kKeepNumbers)
V8_WARN_UNUSED_RESULT Maybe< bool > HasOwnProperty(Local< Context > context, uint32_t index)
bool HasIndexedLookupInterceptor() const
V8_WARN_UNUSED_RESULT Maybe< bool > Set(Local< Context > context, Local< Value > key, Local< Value > value, MaybeLocal< Object > receiver)
bool IsCallable() const
V8_WARN_UNUSED_RESULT Maybe< PropertyAttribute > GetPropertyAttributes(Local< Context > context, Local< Value > key)
V8_WARN_UNUSED_RESULT Maybe< bool > Has(Local< Context > context, Local< Value > key)
V8_WARN_UNUSED_RESULT Maybe< bool > SetPrototypeV2(Local< Context > context, Local< Value > prototype)
V8_WARN_UNUSED_RESULT MaybeLocal< Array > GetOwnPropertyNames(Local< Context > context)
static V8_INLINE int InternalFieldCount(const BasicTracedReference< Object > &object)
Definition v8-object.h:499
V8_WARN_UNUSED_RESULT MaybeLocal< Value > CallAsConstructor(Local< Context > context, int argc, Local< Value > argv[])
V8_WARN_UNUSED_RESULT Maybe< bool > HasRealNamedProperty(Local< Context > context, Local< Name > key)
Local< Object > Clone()
int GetIdentityHash()
Isolate * GetIsolate()
V8_WARN_UNUSED_RESULT Maybe< bool > Delete(Local< Context > context, Local< Value > key)
V8_WARN_UNUSED_RESULT 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)
Maybe< bool > SetIntegrityLevel(Local< Context > context, IntegrityLevel level)
V8_WARN_UNUSED_RESULT 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)
static V8_INLINE void * GetAlignedPointerFromInternalField(const BasicTracedReference< Object > &object, int index)
Definition v8-object.h:536
V8_WARN_UNUSED_RESULT Maybe< bool > DefineOwnProperty(Local< Context > context, Local< Name > key, Local< Value > value, PropertyAttribute attributes=None)
V8_INLINE void * GetAlignedPointerFromInternalField(int index)
Definition v8-object.h:904
V8_INLINE Local< Data > GetInternalField(int index)
Definition v8-object.h:856
bool IsApiWrapper() const
static V8_INLINE T * Unwrap(v8::Isolate *isolate, const v8::Local< v8::Object > &wrapper)
Local< String > GetConstructorName()
V8_WARN_UNUSED_RESULT MaybeLocal< Array > GetOwnPropertyNames(Local< Context > context, PropertyFilter filter, KeyConversionMode key_conversion=KeyConversionMode::kKeepNumbers)
Local< Object > Clone(v8::Isolate *isolate)
Maybe< bool > DeletePrivate(Local< Context > context, Local< Private > key)
V8_WARN_UNUSED_RESULT Maybe< PropertyAttribute > GetRealNamedPropertyAttributes(Local< Context > context, Local< Name > key)
V8_DEPRECATE_SOON("V8 will stop providing access to hidden prototype (i.e. " "JSGlobalObject). Use GetPrototypeV2() instead. " "See http://crbug.com/333672197.") Local< Value > GetPrototype()
void * GetAlignedPointerFromEmbedderDataInCreationContext(v8::Isolate *isolate, int index)
Maybe< bool > HasPrivate(Local< Context > context, Local< Private > key)
static V8_INLINE T * Unwrap(v8::Isolate *isolate, const BasicTracedReference< Object > &wrapper)
static V8_INLINE T * Unwrap(v8::Isolate *isolate, const BasicTracedReference< Object > &wrapper, CppHeapPointerTagRange tag_range)
void SetInternalField(int index, Local< Data > data)
V8_WARN_UNUSED_RESULT Maybe< bool > CreateDataProperty(Local< Context > context, uint32_t index, Local< Value > value)
MaybeLocal< Array > PreviewEntries(bool *is_key_value)
bool IsCodeLike(Isolate *isolate) const
Local< Value > prototype
Definition v8-object.h:454
Local< Value > GetPrototypeV2()
V8_WARN_UNUSED_RESULT MaybeLocal< String > ObjectProtoToString(Local< Context > context)
bool IsConstructor() const
static V8_INLINE Object * Cast(Value *obj)
Definition v8-object.h:1069
void SetAccessorProperty(Local< Name > name, Local< Function > getter, Local< Function > setter=Local< Function >(), PropertyAttribute attributes=None)
V8_WARN_UNUSED_RESULT Maybe< bool > HasRealIndexedProperty(Local< Context > context, uint32_t index)
static V8_INLINE T * Unwrap(v8::Isolate *isolate, const PersistentBase< Object > &wrapper)
void SetAlignedPointerInInternalField(int index, void *value)
V8_WARN_UNUSED_RESULT MaybeLocal< Value > Get(Local< Context > context, Local< Value > key)
V8_WARN_UNUSED_RESULT MaybeLocal< Array > GetPropertyNames(Local< Context > context)
static V8_INLINE void Wrap(v8::Isolate *isolate, const BasicTracedReference< Object > &wrapper, void *wrappable)
void SetAlignedPointerInInternalFields(int argc, int indices[], void *values[])
V8_WARN_UNUSED_RESULT MaybeLocal< Value > CallAsFunction(Local< Context > context, Local< Value > recv, int argc, Local< Value > argv[])
Maybe< bool > SetPrivate(Local< Context > context, Local< Private > key, Local< Value > value)
static V8_INLINE void Wrap(v8::Isolate *isolate, const PersistentBase< Object > &wrapper, void *wrappable)
V8_WARN_UNUSED_RESULT MaybeLocal< Value > GetOwnPropertyDescriptor(Local< Context > context, Local< Name > key)
static V8_INLINE void * GetAlignedPointerFromInternalField(const PersistentBase< Object > &object, int index)
Definition v8-object.h:529
V8_WARN_UNUSED_RESULT Maybe< bool > Set(Local< Context > context, uint32_t index, Local< Value > value)
V8_WARN_UNUSED_RESULT Maybe< bool > HasOwnProperty(Local< Context > context, Local< Name > key)
V8_WARN_UNUSED_RESULT Maybe< bool > Delete(Local< Context > context, uint32_t index)
V8_WARN_UNUSED_RESULT Maybe< bool > CreateDataProperty(Local< Context > context, Local< Name > key, Local< Value > value)
MaybeLocal< Context > GetCreationContext(v8::Isolate *isolate)
V8_WARN_UNUSED_RESULT MaybeLocal< Value > Get(Local< Context > context, uint32_t index)
V8_WARN_UNUSED_RESULT Maybe< bool > HasRealNamedCallbackProperty(Local< Context > context, Local< Name > key)
static V8_INLINE T * Unwrap(v8::Isolate *isolate, const v8::Local< v8::Object > &wrapper, CppHeapPointerTagRange tag_range)
V8_WARN_UNUSED_RESULT MaybeLocal< Value > Get(Local< Context > context, Local< Value > key, MaybeLocal< Object > receiver)
Local< Object > FindInstanceInPrototypeChain(Local< FunctionTemplate > tmpl)
static Local< Object > New(Isolate *isolate)
static Local< Object > New(Isolate *isolate, Local< Value > prototype_or_null, Local< Name > *names, Local< Value > *values, size_t length)
V8_WARN_UNUSED_RESULT Maybe< bool > DefineProperty(Local< Context > context, Local< Name > key, PropertyDescriptor &descriptor)
bool IsUndetectable() const
V8_WARN_UNUSED_RESULT Maybe< PropertyAttribute > GetRealNamedPropertyAttributesInPrototypeChain(Local< Context > context, Local< Name > key)
V8_WARN_UNUSED_RESULT Maybe< bool > Has(Local< Context > context, uint32_t index)
V8_WARN_UNUSED_RESULT MaybeLocal< Value > GetRealNamedProperty(Local< Context > context, Local< Name > key)
static V8_INLINE T * Unwrap(v8::Isolate *isolate, const PersistentBase< Object > &wrapper, CppHeapPointerTagRange tag_range)
static V8_INLINE void Wrap(v8::Isolate *isolate, const v8::Local< v8::Object > &wrapper, void *wrappable)
Local< Context > GetCreationContextChecked(v8::Isolate *isolate)
MaybeLocal< Value > GetPrivate(Local< Context > context, Local< Private > key)
V8_WARN_UNUSED_RESULT Maybe< bool > Set(Local< Context > context, Local< Value > key, Local< Value > value)
V8_WARN_UNUSED_RESULT MaybeLocal< Value > GetRealNamedPropertyInPrototypeChain(Local< Context > context, Local< Name > key)
int InternalFieldCount() const
Local< Value > Name() const
static Local< Private > ForApi(Isolate *isolate, Local< String > name)
static V8_INLINE Private * Cast(Data *data)
Definition v8-object.h:1062
static Local< Private > New(Isolate *isolate, Local< String > name=Local< String >())
PrivateData * get_private() const
Definition v8-object.h:127
bool has_configurable() const
PropertyDescriptor(const PropertyDescriptor &)=delete
bool has_enumerable() const
Local< Value > set() const
void set_configurable(bool configurable)
bool has_value() const
void operator=(const PropertyDescriptor &)=delete
PropertyDescriptor(Local< Value > get, Local< Value > set)
bool has_writable() const
bool enumerable() const
PropertyDescriptor(Local< Value > value)
Local< Value > value() const
void set_enumerable(bool enumerable)
Local< Value > get() const
PropertyDescriptor(Local< Value > value, bool writable)
bool configurable() const
static const int kJSObjectHeaderSize
static V8_INLINE Address ValueAsAddress(const T *value)
V8_EXPORT internal::Isolate * IsolateFromNeverReadOnlySpaceObject(Address obj)
uintptr_t Address
Definition v8-internal.h:52
void(*)(Local< Name > property, const PropertyCallbackInfo< Value > &info) AccessorNameGetterCallback
Definition v8-object.h:155
CppHeapPointerTag
Definition v8-sandbox.h:28
SideEffectType
Definition v8-object.h:198
PropertyFilter
Definition v8-object.h:179
@ SKIP_SYMBOLS
Definition v8-object.h:185
@ ALL_PROPERTIES
Definition v8-object.h:180
@ ONLY_CONFIGURABLE
Definition v8-object.h:183
@ ONLY_WRITABLE
Definition v8-object.h:181
@ ONLY_ENUMERABLE
Definition v8-object.h:182
@ SKIP_STRINGS
Definition v8-object.h:184
IntegrityLevel
Definition v8-object.h:228
void(*)(Local< Name > property, Local< Value > value, const PropertyCallbackInfo< void > &info) AccessorNameSetterCallback
Definition v8-object.h:158
PropertyAttribute
Definition v8-object.h:139
@ DontDelete
Definition v8-object.h:147
@ DontEnum
Definition v8-object.h:145
@ None
Definition v8-object.h:141
@ ReadOnly
Definition v8-object.h:143
IndexFilter
Definition v8-object.h:217
KeyCollectionMode
Definition v8-object.h:211
KeyConversionMode
Definition v8-object.h:223
#define V8_EXPORT
Definition v8config.h:800
#define V8_INLINE
Definition v8config.h:500
#define V8_DEPRECATE_SOON(message)
Definition v8config.h:614
#define V8_LIKELY(condition)
Definition v8config.h:661
#define V8_WARN_UNUSED_RESULT
Definition v8config.h:671