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
799 "Use Isolate::GetCurrent() instead, which is guaranteed to return the "
800 "same isolate since https://crrev.com/c/6458560.")
801 Isolate* GetIsolate();
802
804 "Use Isolate::GetCurrent() instead, which is guaranteed to return the "
805 "same isolate since https://crrev.com/c/6458560.")
806 V8_INLINE static Isolate* GetIsolate(const TracedReference<Object>& handle) {
807 return handle.template value<Object>()->GetIsolate();
808 }
809
820
821 static Local<Object> New(Isolate* isolate);
822
831 static Local<Object> New(Isolate* isolate, Local<Value> prototype_or_null,
832 Local<Name>* names, Local<Value>* values,
833 size_t length);
834
835 V8_INLINE static Object* Cast(Value* obj);
836
845 bool IsCodeLike(Isolate* isolate) const;
846
847 private:
848 static void* Unwrap(v8::Isolate* isolate, internal::Address wrapper_obj,
849 CppHeapPointerTagRange tag_range);
850 static void Wrap(v8::Isolate* isolate, internal::Address wrapper_obj,
851 CppHeapPointerTag tag, void* wrappable);
852
853 Object();
854 static void CheckCast(Value* obj);
855 Local<Data> SlowGetInternalField(int index);
856 void* SlowGetAlignedPointerFromInternalField(int index);
857 void* SlowGetAlignedPointerFromInternalField(v8::Isolate* isolate, int index);
858};
859
860// --- Implementation ---
861
863#ifndef V8_ENABLE_CHECKS
864 using A = internal::Address;
865 using I = internal::Internals;
867 // Fast path: If the object is a plain JSObject, which is the common case, we
868 // know where to find the internal fields and can return the value directly.
869 int instance_type = I::GetInstanceType(obj);
870 if (I::CanHaveInternalField(instance_type)) {
871 int offset = I::kJSAPIObjectWithEmbedderSlotsHeaderSize +
872 (I::kEmbedderDataSlotSize * index);
873 A value = I::ReadRawField<A>(obj, offset);
874#ifdef V8_COMPRESS_POINTERS
875 // We read the full pointer value and then decompress it in order to avoid
876 // dealing with potential endiannes issues.
877 value = I::DecompressTaggedField(obj, static_cast<uint32_t>(value));
878#endif
879
880 auto* isolate = I::GetCurrentIsolate();
881 return Local<Data>::New(isolate, value);
882 }
883#endif
884 return SlowGetInternalField(index);
885}
886
888 int index) {
889#if !defined(V8_ENABLE_CHECKS)
890 using A = internal::Address;
891 using I = internal::Internals;
893 // Fast path: If the object is a plain JSObject, which is the common case, we
894 // know where to find the internal fields and can return the value directly.
895 auto instance_type = I::GetInstanceType(obj);
896 if (V8_LIKELY(I::CanHaveInternalField(instance_type))) {
897 int offset = I::kJSAPIObjectWithEmbedderSlotsHeaderSize +
898 (I::kEmbedderDataSlotSize * index) +
899 I::kEmbedderDataSlotExternalPointerOffset;
900 A value =
901 I::ReadExternalPointerField<internal::kEmbedderDataSlotPayloadTag>(
902 isolate, obj, offset);
903 return reinterpret_cast<void*>(value);
904 }
905#endif
906 return SlowGetAlignedPointerFromInternalField(isolate, index);
907}
908
910#if !defined(V8_ENABLE_CHECKS)
911 using A = internal::Address;
912 using I = internal::Internals;
914 // Fast path: If the object is a plain JSObject, which is the common case, we
915 // know where to find the internal fields and can return the value directly.
916 auto instance_type = I::GetInstanceType(obj);
917 if (V8_LIKELY(I::CanHaveInternalField(instance_type))) {
918 int offset = I::kJSAPIObjectWithEmbedderSlotsHeaderSize +
919 (I::kEmbedderDataSlotSize * index) +
920 I::kEmbedderDataSlotExternalPointerOffset;
921 Isolate* isolate = I::GetCurrentIsolateForSandbox();
922 A value =
923 I::ReadExternalPointerField<internal::kEmbedderDataSlotPayloadTag>(
924 isolate, obj, offset);
925 return reinterpret_cast<void*>(value);
926 }
927#endif
928 return SlowGetAlignedPointerFromInternalField(index);
929}
930
931// static
932template <CppHeapPointerTag tag, typename T>
934 CppHeapPointerTagRange tag_range(tag, tag);
935 auto obj = internal::ValueHelper::ValueAsAddress(*wrapper);
936#if !defined(V8_ENABLE_CHECKS)
937 return internal::ReadCppHeapPointerField<T>(
938 isolate, obj, internal::Internals::kJSObjectHeaderSize, tag_range);
939#else // defined(V8_ENABLE_CHECKS)
940 return reinterpret_cast<T*>(Unwrap(isolate, obj, tag_range));
941#endif // defined(V8_ENABLE_CHECKS)
942}
943
944// static
945template <CppHeapPointerTag tag, typename T>
947 CppHeapPointerTagRange tag_range(tag, tag);
948 auto obj =
949 internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
950#if !defined(V8_ENABLE_CHECKS)
951 return internal::ReadCppHeapPointerField<T>(
952 isolate, obj, internal::Internals::kJSObjectHeaderSize, tag_range);
953#else // defined(V8_ENABLE_CHECKS)
954 return reinterpret_cast<T*>(Unwrap(isolate, obj, tag_range));
955#endif // defined(V8_ENABLE_CHECKS)
956}
957
958// static
959template <CppHeapPointerTag tag, typename T>
961 const BasicTracedReference<Object>& wrapper) {
962 CppHeapPointerTagRange tag_range(tag, tag);
963 auto obj =
964 internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
965#if !defined(V8_ENABLE_CHECKS)
966 return internal::ReadCppHeapPointerField<T>(
967 isolate, obj, internal::Internals::kJSObjectHeaderSize, tag_range);
968#else // defined(V8_ENABLE_CHECKS)
969 return reinterpret_cast<T*>(Unwrap(isolate, obj, tag_range));
970#endif // defined(V8_ENABLE_CHECKS)
971}
972
973// static
974template <typename T>
976 CppHeapPointerTagRange tag_range) {
977 auto obj = internal::ValueHelper::ValueAsAddress(*wrapper);
978#if !defined(V8_ENABLE_CHECKS)
979 return internal::ReadCppHeapPointerField<T>(
980 isolate, obj, internal::Internals::kJSObjectHeaderSize, tag_range);
981#else // defined(V8_ENABLE_CHECKS)
982 return reinterpret_cast<T*>(Unwrap(isolate, obj, tag_range));
983#endif // defined(V8_ENABLE_CHECKS)
984}
985
986// static
987template <typename T>
989 CppHeapPointerTagRange tag_range) {
990 auto obj =
991 internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
992#if !defined(V8_ENABLE_CHECKS)
993 return internal::ReadCppHeapPointerField<T>(
994 isolate, obj, internal::Internals::kJSObjectHeaderSize, tag_range);
995#else // defined(V8_ENABLE_CHECKS)
996
997 return reinterpret_cast<T*>(Unwrap(isolate, obj, tag_range));
998#endif // defined(V8_ENABLE_CHECKS)
999}
1000
1001// static
1002template <typename T>
1004 const BasicTracedReference<Object>& wrapper,
1005 CppHeapPointerTagRange tag_range) {
1006 auto obj =
1007 internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
1008#if !defined(V8_ENABLE_CHECKS)
1009 return internal::ReadCppHeapPointerField<T>(
1010 isolate, obj, internal::Internals::kJSObjectHeaderSize, tag_range);
1011#else // defined(V8_ENABLE_CHECKS)
1012 return reinterpret_cast<T*>(Unwrap(isolate, obj, tag_range));
1013#endif // defined(V8_ENABLE_CHECKS)
1014}
1015
1016// static
1017template <CppHeapPointerTag tag>
1018void Object::Wrap(v8::Isolate* isolate, const v8::Local<v8::Object>& wrapper,
1019 void* wrappable) {
1020 auto obj = internal::ValueHelper::ValueAsAddress(*wrapper);
1021 Wrap(isolate, obj, tag, wrappable);
1022}
1023
1024// static
1025template <CppHeapPointerTag tag>
1027 void* wrappable) {
1028 auto obj =
1029 internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
1030 Wrap(isolate, obj, tag, wrappable);
1031}
1032
1033// static
1034template <CppHeapPointerTag tag>
1036 const BasicTracedReference<Object>& wrapper,
1037 void* wrappable) {
1038 auto obj =
1039 internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
1040 Wrap(isolate, obj, tag, wrappable);
1041}
1042
1043// static
1044void Object::Wrap(v8::Isolate* isolate, const v8::Local<v8::Object>& wrapper,
1045 void* wrappable, CppHeapPointerTag tag) {
1046 auto obj = internal::ValueHelper::ValueAsAddress(*wrapper);
1047 Wrap(isolate, obj, tag, wrappable);
1048}
1049
1050// static
1052 void* wrappable, CppHeapPointerTag tag) {
1053 auto obj =
1054 internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
1055 Wrap(isolate, obj, tag, wrappable);
1056}
1057
1058// static
1060 const BasicTracedReference<Object>& wrapper, void* wrappable,
1061 CppHeapPointerTag tag) {
1062 auto obj =
1063 internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
1064 Wrap(isolate, obj, tag, wrappable);
1065}
1066
1068#ifdef V8_ENABLE_CHECKS
1069 CheckCast(data);
1070#endif
1071 return reinterpret_cast<Private*>(data);
1072}
1073
1075#ifdef V8_ENABLE_CHECKS
1076 CheckCast(value);
1077#endif
1078 return static_cast<Object*>(value);
1079}
1080
1081} // namespace v8
1082
1083#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:583
Definition: v8-isolate.h:274
Definition: v8-local-handle.h:267
static Local< T > New(Isolate *isolate, Local< T > that)
Definition: v8-local-handle.h:349
Definition: v8-local-handle.h:635
Definition: v8-maybe.h:33
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:1018
static Object * Cast(Value *obj)
Definition: v8-object.h:1074
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:909
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:862
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:933
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:93
Definition: v8-object.h:31
static Private * Cast(Data *data)
Definition: v8-object.h:1067
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:187
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:848
static const int kJSObjectHeaderSize
Definition: v8-internal.h:865
static Address ValueAsAddress(const T *value)
Definition: v8-internal.h:1716
uintptr_t Address
Definition: v8-internal.h:52
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:70
#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
#define V8_ENUM_DEPRECATE_SOON(message)
Definition: v8config.h:651