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
707 V8_DEPRECATE_SOON("Use the version with the isolate argument.")
708 MaybeLocal<Context> GetCreationContext();
709
715 Local<Context> GetCreationContextChecked(v8::Isolate* isolate);
716 V8_DEPRECATE_SOON("Use the version with the isolate argument.")
717 Local<Context> GetCreationContextChecked();
718
720 V8_INLINE static MaybeLocal<Context> GetCreationContext(
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.")
725 V8_INLINE static MaybeLocal<Context> GetCreationContext(
726 const PersistentBase<Object>& object);
727
742 void* GetAlignedPointerFromEmbedderDataInCreationContext(v8::Isolate* isolate,
743 int index);
744 void* GetAlignedPointerFromEmbedderDataInCreationContext(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
798 Isolate* GetIsolate();
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
1063#ifdef V8_ENABLE_CHECKS
1064 CheckCast(data);
1065#endif
1066 return reinterpret_cast<Private*>(data);
1067}
1068
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_
Definition: v8-traced-handle.h:124
Definition: v8-context.h:48
Definition: v8-data.h:18
Definition: v8-template.h:569
Definition: v8-isolate.h:212
Definition: v8-local-handle.h:266
static Local< T > New(Isolate *isolate, Local< T > that)
Definition: v8-local-handle.h:346
Definition: v8-local-handle.h:632
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)
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:1013
static Object * Cast(Value *obj)
Definition: v8-object.h:1069
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)
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:904
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)
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)
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)
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)
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:856
Maybe< PropertyAttribute > GetRealNamedPropertyAttributes(Local< Context > context, Local< Name > key)
Maybe< bool > HasPrivate(Local< Context > context, Local< Private > key)
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:928
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)
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:1062
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:165
Definition: v8-initialization.h:61
Definition: v8-value.h:32
Definition: v8-internal.h:855
static const int kJSObjectHeaderSize
Definition: v8-internal.h:872
static Address ValueAsAddress(const T *value)
Definition: v8-internal.h:1687
internal::Isolate * IsolateFromNeverReadOnlySpaceObject(Address obj)
uintptr_t Address
Definition: v8-internal.h:51
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:28
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:69
#define V8_EXPORT
Definition: v8config.h:793
#define V8_INLINE
Definition: v8config.h:499
#define V8_DEPRECATE_SOON(message)
Definition: v8config.h:603
#define V8_LIKELY(condition)
Definition: v8config.h:650
#define V8_WARN_UNUSED_RESULT
Definition: v8config.h:660
#define V8_ENUM_DEPRECATE_SOON(message)
Definition: v8config.h:640