5#ifndef INCLUDE_V8_CONTEXT_H_
6#define INCLUDE_V8_CONTEXT_H_
31 : name_count_(name_count), names_(names) {}
33 const char**
begin()
const {
return &names_[0]; }
34 const char**
end()
const {
return &names_[name_count_]; }
37 const int name_count_;
112 Isolate* isolate,
size_t context_snapshot_index,
210 V8_INLINE void* GetAlignedPointerFromEmbedderData(
int index);
317 friend class internal::Isolate;
319 uintptr_t JSStackComparableAddressPrivate()
const {
320 return js_stack_comparable_address_;
324 uintptr_t js_stack_comparable_address_ = 0;
336 static void CheckCast(
Data* obj);
340 void* SlowGetAlignedPointerFromEmbedderData(
int index);
346#ifndef V8_ENABLE_CHECKS
349 A ctx = *
reinterpret_cast<const A*
>(
this);
351 I::ReadTaggedPointerField(ctx, I::kNativeContextEmbedderDataOffset);
353 I::kEmbedderDataArrayHeaderSize + (I::kEmbedderDataSlotSize * index);
354 A value = I::ReadRawField<A>(embedder_data, value_offset);
355#ifdef V8_COMPRESS_POINTERS
359 I::DecompressTaggedAnyField(embedder_data,
static_cast<uint32_t
>(value));
362 *
reinterpret_cast<A*
>(
this));
366 return SlowGetEmbedderData(index);
371#if !defined(V8_ENABLE_CHECKS)
374 A ctx = *
reinterpret_cast<const A*
>(
this);
376 I::ReadTaggedPointerField(ctx, I::kNativeContextEmbedderDataOffset);
378 I::kEmbedderDataArrayHeaderSize + (I::kEmbedderDataSlotSize * index);
379#ifdef V8_SANDBOXED_EXTERNAL_POINTERS
380 value_offset += I::kEmbedderDataSlotRawPayloadOffset;
382 internal::Isolate* isolate = I::GetIsolateForSandbox(ctx);
383 return reinterpret_cast<void*
>(
384 I::ReadExternalPointerField(isolate, embedder_data, value_offset,
387 return SlowGetAlignedPointerFromEmbedderData(index);
399#ifdef V8_ENABLE_CHECKS
402 return static_cast<Context*
>(data);
BackupIncumbentScope(Local< Context > backup_incumbent_context)
V8_INLINE Scope(Local< Context > context)
void SetEmbedderData(int index, Local< Value > value)
V8_INLINE Local< Value > GetEmbedderData(int index)
Local< Value > GetContinuationPreservedEmbedderData() const
static MaybeLocal< Object > NewRemoteContext(Isolate *isolate, Local< ObjectTemplate > global_template, MaybeLocal< Value > global_object=MaybeLocal< Value >())
Local< Object > GetExtrasBindingObject()
bool IsCodeGenerationFromStringsAllowed() const
V8_INLINE void * GetAlignedPointerFromEmbedderData(int index)
Local< Value > GetSecurityToken()
void SetAlignedPointerInEmbedderData(int index, void *value)
void SetContinuationPreservedEmbedderData(Local< Value > context)
void SetAbortScriptExecution(AbortScriptExecutionCallback callback)
void(*)(Isolate *isolate, Local< Context > context) AbortScriptExecutionCallback
V8_INLINE MaybeLocal< T > GetDataFromSnapshotOnce(size_t index)
void AllowCodeGenerationFromStrings(bool allow)
void SetErrorMessageForCodeGenerationFromStrings(Local< String > message)
void UseDefaultSecurityToken()
MicrotaskQueue * GetMicrotaskQueue()
static V8_INLINE Context * Cast(Data *data)
void SetSecurityToken(Local< Value > token)
static MaybeLocal< Context > FromSnapshot(Isolate *isolate, size_t context_snapshot_index, DeserializeInternalFieldsCallback embedder_fields_deserializer=DeserializeInternalFieldsCallback(), ExtensionConfiguration *extensions=nullptr, MaybeLocal< Value > global_object=MaybeLocal< Value >(), MicrotaskQueue *microtask_queue=nullptr)
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)
void SetPromiseHooks(Local< Function > init_hook, Local< Function > before_hook, Local< Function > after_hook, Local< Function > resolve_hook)
uint32_t GetNumberOfEmbedderDataFields()
const char ** begin() const
ExtensionConfiguration(int name_count, const char *names[])
const char ** end() const
static internal::Address * CreateHandle(internal::Isolate *isolate, internal::Address value)
V8_EXPORT internal::Isolate * IsolateFromNeverReadOnlySpaceObject(Address obj)
@ kEmbedderDataSlotPayloadTag
V8_INLINE void PerformCastCheck(T *data)