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_;
154 Isolate* isolate,
size_t context_snapshot_index,
293 V8_INLINE void* GetAlignedPointerFromEmbedderData(
int index);
395 friend class internal::Isolate;
397 uintptr_t JSStackComparableAddressPrivate()
const {
398 return js_stack_comparable_address_;
402 uintptr_t js_stack_comparable_address_ = 0;
414 static void CheckCast(
Data* obj);
418 void* SlowGetAlignedPointerFromEmbedderData(
int index);
424#ifndef V8_ENABLE_CHECKS
429 I::ReadTaggedPointerField(ctx, I::kNativeContextEmbedderDataOffset);
431 I::kEmbedderDataArrayHeaderSize + (I::kEmbedderDataSlotSize * index);
432 A value = I::ReadRawField<A>(embedder_data, value_offset);
433#ifdef V8_COMPRESS_POINTERS
436 value = I::DecompressTaggedField(embedder_data,
static_cast<uint32_t
>(value));
443 return SlowGetEmbedderData(index);
448#if !defined(V8_ENABLE_CHECKS)
453 I::ReadTaggedPointerField(ctx, I::kNativeContextEmbedderDataOffset);
454 int value_offset = I::kEmbedderDataArrayHeaderSize +
455 (I::kEmbedderDataSlotSize * index) +
456 I::kEmbedderDataSlotExternalPointerOffset;
457 Isolate* isolate = I::GetIsolateForSandbox(ctx);
458 return reinterpret_cast<void*
>(
459 I::ReadExternalPointerField<internal::kEmbedderDataSlotPayloadTag>(
460 isolate, embedder_data, value_offset));
462 return SlowGetAlignedPointerFromEmbedderData(index);
470 internal::ValueHelper::SlotAsValue<T, false>(slot));
477#ifdef V8_ENABLE_CHECKS
480 return static_cast<Context*
>(data);
BackupIncumbentScope(Local< Context > backup_incumbent_context)
virtual bool FreezeEmbedderObjectAndGetChildren(Local< Object > obj, LocalVector< Object > &children_out)=0
V8_INLINE Scope(Local< Context > context)
void SetEmbedderData(int index, Local< Value > value)
V8_INLINE Local< Value > GetEmbedderData(int index)
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)
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())
Local< Value > GetSecurityToken()
void SetAlignedPointerInEmbedderData(int index, void *value)
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()
void SetMicrotaskQueue(MicrotaskQueue *queue)
MicrotaskQueue * GetMicrotaskQueue()
Maybe< void > DeepFreeze(DeepFreezeDelegate *delegate=nullptr)
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())
void SetErrorMessageForWasmCodeGeneration(Local< String > message)
static V8_INLINE Context * Cast(Data *data)
void SetSecurityToken(Local< Value > token)
bool HasTemplateLiteralObject(Local< Value > object)
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 V8_INLINE Local< T > New(Isolate *isolate, Local< T > that)
static V8_INLINE Address ValueAsAddress(const T *value)
V8_EXPORT internal::Isolate * IsolateFromNeverReadOnlySpaceObject(Address obj)
V8_INLINE void PerformCastCheck(T *data)