v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::internal::Context Class Reference

#include <contexts.h>

Inheritance diagram for v8::internal::Context:
Collaboration diagram for v8::internal::Context:

Public Types

enum  Field {
  SCOPE_INFO_INDEX , PREVIOUS_INDEX , EXTENSION_INDEX , NEXT_CONTEXT_LINK ,
  NATIVE_CONTEXT_SLOTS , FIRST_WEAK_SLOT = NEXT_CONTEXT_LINK , FIRST_JS_ARRAY_MAP_SLOT = JS_ARRAY_PACKED_SMI_ELEMENTS_MAP_INDEX , MIN_CONTEXT_SLOTS = EXTENSION_INDEX ,
  MIN_CONTEXT_EXTENDED_SLOTS = EXTENSION_INDEX + 1 , THROWN_OBJECT_INDEX = MIN_CONTEXT_SLOTS , WRAPPED_CONTEXT_INDEX = MIN_CONTEXT_EXTENDED_SLOTS , CONTEXT_SIDE_TABLE_PROPERTY_INDEX = MIN_CONTEXT_SLOTS
}
 

Public Member Functions

V8_INLINE Tagged< Objectget (int index) const
 
V8_INLINE Tagged< Objectget (PtrComprCageBase cage_base, int index) const
 
V8_INLINE void set (int index, Tagged< Object > value, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
 
V8_INLINE Tagged< Objectget (int index, AcquireLoadTag) const
 
V8_INLINE Tagged< Objectget (PtrComprCageBase cage_base, int index, AcquireLoadTag) const
 
V8_INLINE void set (int index, Tagged< Object > value, WriteBarrierMode mode, ReleaseStoreTag)
 
void Initialize (Isolate *isolate)
 
Tagged< Objectunchecked_previous () const
 
Tagged< Contextprevious () const
 
Tagged< Objectnext_context_link () const
 
bool has_extension () const
 
Tagged< HeapObjectextension () const
 
V8_EXPORT_PRIVATE void set_extension (Tagged< HeapObject > object, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
 
Tagged< JSObjectextension_object () const
 
Tagged< JSReceiverextension_receiver () const
 
Tagged< SourceTextModulemodule () const
 
Tagged< Contextdeclaration_context () const
 
bool is_declaration_context () const
 
Tagged< Contextclosure_context () const
 
V8_EXPORT_PRIVATE Tagged< JSGlobalProxyglobal_proxy () const
 
V8_EXPORT_PRIVATE Tagged< JSGlobalObjectglobal_object () const
 
Tagged< Contextscript_context () const
 
Tagged< NativeContextnative_context () const
 
bool IsDetached () const
 
bool IsFunctionContext () const
 
bool IsCatchContext () const
 
bool IsWithContext () const
 
bool IsDebugEvaluateContext () const
 
bool IsAwaitContext () const
 
bool IsBlockContext () const
 
bool IsModuleContext () const
 
bool IsEvalContext () const
 
bool IsScriptContext () const
 
bool HasSameSecurityTokenAs (Tagged< Context > that) const
 
Handle< ObjectErrorMessageForCodeGenerationFromStrings ()
 
DirectHandle< ObjectErrorMessageForWasmCodeGeneration ()
 
Tagged< MapGetInitialJSArrayMap (ElementsKind kind) const
 
std::optional< ContextSidePropertyCell::PropertyGetScriptContextSideProperty (size_t index) const
 

Static Public Member Functions

static V8_INLINE constexpr int SizeFor (int length)
 
static V8_INLINE constexpr int OffsetOfElementAt (int index)
 
static V8_INLINE constexpr int SlotOffset (int index)
 
static Handle< ObjectLookup (Handle< Context > context, Handle< String > name, ContextLookupFlags flags, int *index, PropertyAttributes *attributes, InitializationFlag *init_flag, VariableMode *variable_mode, bool *is_sloppy_function_name=nullptr)
 
static int FunctionMapIndex (LanguageMode language_mode, FunctionKind kind, bool has_shared_name)
 
static int ArrayMapIndex (ElementsKind elements_kind)
 
static Tagged< ContextSidePropertyCellGetOrCreateContextSidePropertyCell (DirectHandle< Context > context, size_t index, ContextSidePropertyCell::Property property, Isolate *isolate)
 
static DirectHandle< ObjectLoadScriptContextElement (DirectHandle< Context > script_context, int index, DirectHandle< Object > new_value, Isolate *isolate)
 
static void StoreScriptContextAndUpdateSlotProperty (DirectHandle< Context > script_context, int index, DirectHandle< Object > new_value, Isolate *isolate)
 

Static Public Attributes

static const int kScopeInfoOffset = kElementsOffset
 
static const int kPreviousOffset = kScopeInfoOffset + kTaggedSize
 
static const int kTodoHeaderSize = kPreviousOffset + kTaggedSize
 
static const int kExtensionOffset = kTodoHeaderSize
 
static const int kExtensionSize
 
static const int kExtendedHeaderSize = kTodoHeaderSize + kExtensionSize
 
static const int FIRST_FUNCTION_MAP_INDEX = SLOPPY_FUNCTION_MAP_INDEX
 
static const int LAST_FUNCTION_MAP_INDEX = CLASS_FUNCTION_MAP_INDEX
 
static const int FIRST_FIXED_TYPED_ARRAY_FUN_INDEX = UINT8_ARRAY_FUN_INDEX
 
static const int FIRST_RAB_GSAB_TYPED_ARRAY_MAP_INDEX
 
static const int kNoContext = 0
 
static const int kInvalidContext = 1
 
static const int kNotFound = -1
 

Private Member Functions

void set_previous (Tagged< Context > context, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
 

Friends

class Factory
 

Detailed Description

Definition at line 469 of file contexts.h.

Member Enumeration Documentation

◆ Field

Enumerator
SCOPE_INFO_INDEX 
PREVIOUS_INDEX 
EXTENSION_INDEX 
NEXT_CONTEXT_LINK 
NATIVE_CONTEXT_SLOTS 
FIRST_WEAK_SLOT 
FIRST_JS_ARRAY_MAP_SLOT 
MIN_CONTEXT_SLOTS 
MIN_CONTEXT_EXTENDED_SLOTS 
THROWN_OBJECT_INDEX 
WRAPPED_CONTEXT_INDEX 
CONTEXT_SIDE_TABLE_PROPERTY_INDEX 

Definition at line 527 of file contexts.h.

Member Function Documentation

◆ ArrayMapIndex()

static int v8::internal::Context::ArrayMapIndex ( ElementsKind elements_kind)
inlinestatic

Definition at line 676 of file contexts.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ closure_context()

Tagged< Context > v8::internal::Context::closure_context ( ) const

Definition at line 154 of file contexts.cc.

◆ declaration_context()

Tagged< Context > v8::internal::Context::declaration_context ( ) const

Definition at line 146 of file contexts.cc.

◆ ErrorMessageForCodeGenerationFromStrings()

Handle< Object > v8::internal::Context::ErrorMessageForCodeGenerationFromStrings ( )

Definition at line 782 of file contexts.cc.

◆ ErrorMessageForWasmCodeGeneration()

DirectHandle< Object > v8::internal::Context::ErrorMessageForWasmCodeGeneration ( )

Definition at line 790 of file contexts.cc.

◆ extension()

Tagged< HeapObject > v8::internal::Context::extension ( ) const
inline

Definition at line 133 of file contexts-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ extension_object()

Tagged< JSObject > v8::internal::Context::extension_object ( ) const

Definition at line 164 of file contexts.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ extension_receiver()

Tagged< JSReceiver > v8::internal::Context::extension_receiver ( ) const

Definition at line 174 of file contexts.cc.

Here is the call graph for this function:

◆ FunctionMapIndex()

int v8::internal::Context::FunctionMapIndex ( LanguageMode language_mode,
FunctionKind kind,
bool has_shared_name )
inlinestatic

Definition at line 211 of file contexts-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get() [1/4]

Tagged< Object > v8::internal::Context::get ( int index) const

Definition at line 64 of file contexts-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get() [2/4]

Tagged< Object > v8::internal::Context::get ( int index,
AcquireLoadTag tag ) const

Definition at line 84 of file contexts-inl.h.

Here is the call graph for this function:

◆ get() [3/4]

Tagged< Object > v8::internal::Context::get ( PtrComprCageBase cage_base,
int index ) const

Definition at line 69 of file contexts-inl.h.

Here is the call graph for this function:

◆ get() [4/4]

Tagged< Object > v8::internal::Context::get ( PtrComprCageBase cage_base,
int index,
AcquireLoadTag  ) const

Definition at line 89 of file contexts-inl.h.

Here is the call graph for this function:

◆ GetInitialJSArrayMap()

Tagged< Map > v8::internal::Context::GetInitialJSArrayMap ( ElementsKind kind) const
inline

Definition at line 260 of file contexts-inl.h.

Here is the call graph for this function:

◆ GetOrCreateContextSidePropertyCell()

Tagged< ContextSidePropertyCell > v8::internal::Context::GetOrCreateContextSidePropertyCell ( DirectHandle< Context > context,
size_t index,
ContextSidePropertyCell::Property property,
Isolate * isolate )
static

Definition at line 483 of file contexts.cc.

Here is the call graph for this function:

◆ GetScriptContextSideProperty()

std::optional< ContextSidePropertyCell::Property > v8::internal::Context::GetScriptContextSideProperty ( size_t index) const

Definition at line 506 of file contexts.cc.

Here is the call graph for this function:

◆ global_object()

Tagged< JSGlobalObject > v8::internal::Context::global_object ( ) const

Definition at line 188 of file contexts.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ global_proxy()

Tagged< JSGlobalProxy > v8::internal::Context::global_proxy ( ) const

Definition at line 200 of file contexts.cc.

Here is the call graph for this function:

◆ has_extension()

bool v8::internal::Context::has_extension ( ) const
inline

Definition at line 129 of file contexts-inl.h.

Here is the call graph for this function:

◆ HasSameSecurityTokenAs()

bool v8::internal::Context::HasSameSecurityTokenAs ( Tagged< Context > that) const
inline

Definition at line 178 of file contexts-inl.h.

Here is the call graph for this function:

◆ Initialize()

void v8::internal::Context::Initialize ( Isolate * isolate)

Definition at line 108 of file contexts.cc.

Here is the call graph for this function:

◆ is_declaration_context()

bool v8::internal::Context::is_declaration_context ( ) const

Definition at line 134 of file contexts.cc.

Here is the call graph for this function:

◆ IsAwaitContext()

bool v8::internal::Context::IsAwaitContext ( ) const
inline

Definition at line 158 of file contexts-inl.h.

◆ IsBlockContext()

bool v8::internal::Context::IsBlockContext ( ) const
inline

Definition at line 162 of file contexts-inl.h.

Here is the caller graph for this function:

◆ IsCatchContext()

bool v8::internal::Context::IsCatchContext ( ) const
inline

Definition at line 146 of file contexts-inl.h.

Here is the caller graph for this function:

◆ IsDebugEvaluateContext()

bool v8::internal::Context::IsDebugEvaluateContext ( ) const
inline

Definition at line 154 of file contexts-inl.h.

◆ IsDetached()

bool v8::internal::Context::IsDetached ( ) const
inline

Definition at line 183 of file contexts-inl.h.

Here is the call graph for this function:

◆ IsEvalContext()

bool v8::internal::Context::IsEvalContext ( ) const
inline

Definition at line 170 of file contexts-inl.h.

Here is the caller graph for this function:

◆ IsFunctionContext()

bool v8::internal::Context::IsFunctionContext ( ) const
inline

Definition at line 142 of file contexts-inl.h.

Here is the caller graph for this function:

◆ IsModuleContext()

bool v8::internal::Context::IsModuleContext ( ) const
inline

Definition at line 166 of file contexts-inl.h.

Here is the caller graph for this function:

◆ IsScriptContext()

bool v8::internal::Context::IsScriptContext ( ) const
inline

Definition at line 174 of file contexts-inl.h.

Here is the caller graph for this function:

◆ IsWithContext()

bool v8::internal::Context::IsWithContext ( ) const
inline

Definition at line 150 of file contexts-inl.h.

Here is the caller graph for this function:

◆ LoadScriptContextElement()

DirectHandle< Object > v8::internal::Context::LoadScriptContextElement ( DirectHandle< Context > script_context,
int index,
DirectHandle< Object > new_value,
Isolate * isolate )
static

Definition at line 578 of file contexts.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Lookup()

Handle< Object > v8::internal::Context::Lookup ( Handle< Context > context,
Handle< String > name,
ContextLookupFlags flags,
int * index,
PropertyAttributes * attributes,
InitializationFlag * init_flag,
VariableMode * variable_mode,
bool * is_sloppy_function_name = nullptr )
static

Definition at line 236 of file contexts.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ module()

Tagged< SourceTextModule > v8::internal::Context::module ( ) const

Definition at line 180 of file contexts.cc.

Here is the call graph for this function:

◆ native_context()

Tagged< NativeContext > v8::internal::Context::native_context ( ) const
inline

Definition at line 138 of file contexts-inl.h.

Here is the caller graph for this function:

◆ next_context_link()

Tagged< Object > v8::internal::Context::next_context_link ( ) const
inline

Definition at line 125 of file contexts-inl.h.

Here is the call graph for this function:

◆ OffsetOfElementAt()

static V8_INLINE constexpr int v8::internal::Context::OffsetOfElementAt ( int index)
inlinestaticconstexpr

Definition at line 512 of file contexts.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ previous()

Tagged< Context > v8::internal::Context::previous ( ) const
inline

Definition at line 116 of file contexts-inl.h.

Here is the call graph for this function:

◆ script_context()

Tagged< Context > v8::internal::Context::script_context ( ) const

Definition at line 192 of file contexts.cc.

Here is the caller graph for this function:

◆ set() [1/2]

void v8::internal::Context::set ( int index,
Tagged< Object > value,
WriteBarrierMode mode,
ReleaseStoreTag  )

Definition at line 96 of file contexts-inl.h.

Here is the call graph for this function:

◆ set() [2/2]

void v8::internal::Context::set ( int index,
Tagged< Object > value,
WriteBarrierMode mode = UPDATE_WRITE_BARRIER )

Definition at line 76 of file contexts-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_extension()

void v8::internal::Context::set_extension ( Tagged< HeapObject > object,
WriteBarrierMode mode = UPDATE_WRITE_BARRIER )

Definition at line 831 of file contexts.cc.

Here is the call graph for this function:

◆ set_previous()

void v8::internal::Context::set_previous ( Tagged< Context > context,
WriteBarrierMode mode = UPDATE_WRITE_BARRIER )
inlineprivate

Definition at line 121 of file contexts-inl.h.

Here is the call graph for this function:

◆ SizeFor()

static V8_INLINE constexpr int v8::internal::Context::SizeFor ( int length)
inlinestaticconstexpr

Definition at line 503 of file contexts.h.

Here is the caller graph for this function:

◆ SlotOffset()

static V8_INLINE constexpr int v8::internal::Context::SlotOffset ( int index)
inlinestaticconstexpr

Definition at line 516 of file contexts.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StoreScriptContextAndUpdateSlotProperty()

void v8::internal::Context::StoreScriptContextAndUpdateSlotProperty ( DirectHandle< Context > script_context,
int index,
DirectHandle< Object > new_value,
Isolate * isolate )
static

Definition at line 586 of file contexts.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unchecked_previous()

Tagged< Object > v8::internal::Context::unchecked_previous ( ) const
inline

Definition at line 112 of file contexts-inl.h.

Friends And Related Symbol Documentation

◆ Factory

friend class Factory
friend

Definition at line 717 of file contexts.h.

Member Data Documentation

◆ FIRST_FIXED_TYPED_ARRAY_FUN_INDEX

const int v8::internal::Context::FIRST_FIXED_TYPED_ARRAY_FUN_INDEX = UINT8_ARRAY_FUN_INDEX
static

Definition at line 573 of file contexts.h.

◆ FIRST_FUNCTION_MAP_INDEX

const int v8::internal::Context::FIRST_FUNCTION_MAP_INDEX = SLOPPY_FUNCTION_MAP_INDEX
static

Definition at line 570 of file contexts.h.

◆ FIRST_RAB_GSAB_TYPED_ARRAY_MAP_INDEX

const int v8::internal::Context::FIRST_RAB_GSAB_TYPED_ARRAY_MAP_INDEX
static
Initial value:
=
RAB_GSAB_UINT8_ARRAY_MAP_INDEX

Definition at line 574 of file contexts.h.

◆ kExtendedHeaderSize

const int v8::internal::Context::kExtendedHeaderSize = kTodoHeaderSize + kExtensionSize
static

Definition at line 566 of file contexts.h.

◆ kExtensionOffset

const int v8::internal::Context::kExtensionOffset = kTodoHeaderSize
static

Definition at line 500 of file contexts.h.

◆ kExtensionSize

const int v8::internal::Context::kExtensionSize
static
Initial value:

Definition at line 564 of file contexts.h.

◆ kInvalidContext

const int v8::internal::Context::kInvalidContext = 1
static

Definition at line 578 of file contexts.h.

◆ kNoContext

const int v8::internal::Context::kNoContext = 0
static

Definition at line 577 of file contexts.h.

◆ kNotFound

const int v8::internal::Context::kNotFound = -1
static

Definition at line 698 of file contexts.h.

◆ kPreviousOffset

const int v8::internal::Context::kPreviousOffset = kScopeInfoOffset + kTaggedSize
static

Definition at line 492 of file contexts.h.

◆ kScopeInfoOffset

const int v8::internal::Context::kScopeInfoOffset = kElementsOffset
static

Definition at line 491 of file contexts.h.

◆ kTodoHeaderSize

const int v8::internal::Context::kTodoHeaderSize = kPreviousOffset + kTaggedSize
static

Definition at line 497 of file contexts.h.

◆ LAST_FUNCTION_MAP_INDEX

const int v8::internal::Context::LAST_FUNCTION_MAP_INDEX = CLASS_FUNCTION_MAP_INDEX
static

Definition at line 571 of file contexts.h.


The documentation for this class was generated from the following files: