5#ifndef INCLUDE_V8_CONTEXT_H_
6#define INCLUDE_V8_CONTEXT_H_
34 : name_count_(name_count), names_(names) {}
36 const char**
begin()
const {
return &names_[0]; }
37 const char**
end()
const {
return &names_[name_count_]; }
40 const int name_count_;
164 Isolate* isolate,
size_t context_snapshot_index,
307 V8_INLINE void* GetAlignedPointerFromEmbedderData(
int index);
409 friend class internal::Isolate;
411 uintptr_t JSStackComparableAddressPrivate()
const {
412 return js_stack_comparable_address_;
416 uintptr_t js_stack_comparable_address_ = 0;
428 static void CheckCast(
Data* obj);
433 void* SlowGetAlignedPointerFromEmbedderData(
int index);
439#ifndef V8_ENABLE_CHECKS
444 I::ReadTaggedPointerField(ctx, I::kNativeContextEmbedderDataOffset);
446 I::kEmbedderDataArrayHeaderSize + (I::kEmbedderDataSlotSize * index);
447 A value = I::ReadRawField<A>(embedder_data, value_offset);
448#ifdef V8_COMPRESS_POINTERS
451 value = I::DecompressTaggedField(embedder_data,
static_cast<uint32_t
>(value));
458 return SlowGetEmbedderData(index);
463#if !defined(V8_ENABLE_CHECKS)
468 I::ReadTaggedPointerField(ctx, I::kNativeContextEmbedderDataOffset);
469 int value_offset = I::kEmbedderDataArrayHeaderSize +
470 (I::kEmbedderDataSlotSize * index) +
471 I::kEmbedderDataSlotExternalPointerOffset;
472 return reinterpret_cast<void*
>(
473 I::ReadExternalPointerField<internal::kEmbedderDataSlotPayloadTag>(
474 isolate, embedder_data, value_offset));
476 return SlowGetAlignedPointerFromEmbedderData(index);
481#if !defined(V8_ENABLE_CHECKS)
486 I::ReadTaggedPointerField(ctx, I::kNativeContextEmbedderDataOffset);
487 int value_offset = I::kEmbedderDataArrayHeaderSize +
488 (I::kEmbedderDataSlotSize * index) +
489 I::kEmbedderDataSlotExternalPointerOffset;
490 Isolate* isolate = I::GetIsolateForSandbox(ctx);
491 return reinterpret_cast<void*
>(
492 I::ReadExternalPointerField<internal::kEmbedderDataSlotPayloadTag>(
493 isolate, embedder_data, value_offset));
495 return SlowGetAlignedPointerFromEmbedderData(index);
510#ifdef V8_ENABLE_CHECKS
513 return static_cast<Context*
>(data);
Definition: v8-context.h:399
BackupIncumbentScope(Local< Context > backup_incumbent_context)
Definition: v8-context.h:226
virtual bool FreezeEmbedderObjectAndGetChildren(Local< Object > obj, LocalVector< Object > &children_out)=0
Definition: v8-context.h:383
Scope(Local< Context > context)
Definition: v8-context.h:385
~Scope()
Definition: v8-context.h:388
Definition: v8-context.h:48
static MaybeLocal< Object > NewRemoteContext(Isolate *isolate, Local< ObjectTemplate > global_template, MaybeLocal< Value > global_object=MaybeLocal< Value >())
Local< Object > GetExtrasBindingObject()
void SetErrorMessageForWasmCodeGeneration(Local< String > message)
void SetEmbedderData(int index, Local< Value > value)
void SetPromiseHooks(Local< Function > init_hook, Local< Function > before_hook, Local< Function > after_hook, Local< Function > resolve_hook)
void SetSecurityToken(Local< Value > token)
static Local< Context > New(Isolate *isolate, ExtensionConfiguration *extensions=nullptr, MaybeLocal< ObjectTemplate > global_template=MaybeLocal< ObjectTemplate >(), MaybeLocal< Value > global_object=MaybeLocal< Value >(), DeserializeInternalFieldsCallback internal_fields_deserializer=DeserializeInternalFieldsCallback(), MicrotaskQueue *microtask_queue=nullptr, DeserializeContextDataCallback context_data_deserializer=DeserializeContextDataCallback(), DeserializeAPIWrapperCallback api_wrapper_deserializer=DeserializeAPIWrapperCallback())
bool IsCodeGenerationFromStringsAllowed() const
void * GetAlignedPointerFromEmbedderData(Isolate *isolate, int index)
Definition: v8-context.h:462
static Context * Cast(Data *data)
Definition: v8-context.h:509
void SetAlignedPointerInEmbedderData(int index, void *value)
MicrotaskQueue * GetMicrotaskQueue()
void SetAbortScriptExecution(AbortScriptExecutionCallback callback)
Maybe< void > DeepFreeze(DeepFreezeDelegate *delegate=nullptr)
bool HasTemplateLiteralObject(Local< Value > object)
void AllowCodeGenerationFromStrings(bool allow)
Local< Value > GetSecurityToken()
MaybeLocal< T > GetDataFromSnapshotOnce(size_t index)
Definition: v8-context.h:500
void SetErrorMessageForCodeGenerationFromStrings(Local< String > message)
EmbedderDataFields
Definition: v8-context.h:271
uint32_t GetNumberOfEmbedderDataFields()
Local< Value > GetEmbedderData(int index)
Definition: v8-context.h:438
void SetMicrotaskQueue(MicrotaskQueue *queue)
void UseDefaultSecurityToken()
void(*)(Isolate *isolate, Local< Context > context) AbortScriptExecutionCallback
Definition: v8-context.h:364
static MaybeLocal< Context > FromSnapshot(Isolate *isolate, size_t context_snapshot_index, DeserializeInternalFieldsCallback internal_fields_deserializer=DeserializeInternalFieldsCallback(), ExtensionConfiguration *extensions=nullptr, MaybeLocal< Value > global_object=MaybeLocal< Value >(), MicrotaskQueue *microtask_queue=nullptr, DeserializeContextDataCallback context_data_deserializer=DeserializeContextDataCallback(), DeserializeAPIWrapperCallback api_wrapper_deserializer=DeserializeAPIWrapperCallback())
Definition: v8-context.h:30
ExtensionConfiguration(int name_count, const char *names[])
Definition: v8-context.h:33
ExtensionConfiguration()
Definition: v8-context.h:32
const char ** begin() const
Definition: v8-context.h:36
const char ** end() const
Definition: v8-context.h:37
Definition: v8-function.h:26
Definition: v8-isolate.h:261
Definition: v8-local-handle.h:492
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-microtask-queue.h:40
Definition: v8-object.h:233
Definition: v8-script.h:353
Definition: v8-value.h:32
Definition: v8-internal.h:794
static Address ValueAsAddress(const T *value)
Definition: v8-internal.h:1625
internal::Address * InternalRepresentationType
Definition: v8-internal.h:1579
static constexpr InternalRepresentationType kEmpty
Definition: v8-internal.h:1580
internal::Isolate * IsolateFromNeverReadOnlySpaceObject(Address obj)
uintptr_t Address
Definition: v8-internal.h:52
void PerformCastCheck(T *data)
Definition: v8-internal.h:1290
Definition: libplatform.h:15
Definition: v8-snapshot.h:116
Definition: v8-snapshot.h:106
Definition: v8-snapshot.h:91
#define V8_EXPORT
Definition: v8config.h:793
#define V8_INLINE
Definition: v8config.h:499
#define V8_NODISCARD
Definition: v8config.h:682