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

#include <variables.h>

Inheritance diagram for v8::internal::Variable:
Collaboration diagram for v8::internal::Variable:

Public Types

enum  ForceHoleInitializationFlag { kHoleInitializationNotForced = 0 , kHasHoleCheckUseInDifferentClosureScope = 1 << 0 , kHasHoleCheckUseInSameClosureScope = 1 << 1 , kHasHoleCheckUseInUnknownScope }
 
using HoleCheckBitmap = uint64_t
 
using List = base::ThreadedList<Variable>
 

Public Member Functions

 Variable (Scope *scope, const AstRawString *name, VariableMode mode, VariableKind kind, InitializationFlag initialization_flag, MaybeAssignedFlag maybe_assigned_flag=kNotAssigned, IsStaticFlag is_static_flag=IsStaticFlag::kNotStatic)
 
 Variable (Variable *other)
 
Scopescope () const
 
void set_scope (Scope *scope)
 
Handle< Stringname () const
 
const AstRawStringraw_name () const
 
VariableMode mode () const
 
void set_mode (VariableMode mode)
 
void set_is_static_flag (IsStaticFlag is_static_flag)
 
IsStaticFlag is_static_flag () const
 
bool is_static () const
 
bool has_forced_context_allocation () const
 
void ForceContextAllocation ()
 
bool is_used ()
 
void set_is_used ()
 
MaybeAssignedFlag maybe_assigned () const
 
void clear_maybe_assigned ()
 
void SetMaybeAssigned ()
 
bool requires_brand_check () const
 
int initializer_position ()
 
void set_initializer_position (int pos)
 
bool IsUnallocated () const
 
bool IsParameter () const
 
bool IsStackLocal () const
 
bool IsStackAllocated () const
 
bool IsContextSlot () const
 
bool IsLookupSlot () const
 
bool IsGlobalObjectProperty () const
 
bool IsReplGlobal () const
 
bool is_dynamic () const
 
InitializationFlag initialization_flag () const
 
bool binding_needs_init () const
 
ForceHoleInitializationFlag force_hole_initialization_flag_field () const
 
bool IsHoleInitializationForced () const
 
bool HasHoleCheckUseInSameClosureScope () const
 
void ForceHoleInitialization (ForceHoleInitializationFlag flag)
 
void ResetHoleCheckBitmapIndex ()
 
void RememberHoleCheckInBitmap (HoleCheckBitmap &bitmap, ZoneVector< Variable * > &list)
 
bool HasRememberedHoleCheck (HoleCheckBitmap bitmap) const
 
bool throw_on_const_assignment (LanguageMode language_mode) const
 
bool is_this () const
 
bool is_sloppy_function_name () const
 
bool is_parameter () const
 
bool is_sloppy_block_function ()
 
Variablelocal_if_not_shadowed () const
 
bool has_local_if_not_shadowed () const
 
void set_local_if_not_shadowed (Variable *local)
 
VariableLocation location () const
 
VariableKind kind () const
 
int index () const
 
bool IsReceiver () const
 
bool IsExport () const
 
void AllocateTo (VariableLocation location, int index)
 
void MakeParameterNonSimple ()
 
void RewriteLocationForRepl ()
 
- Public Member Functions inherited from v8::internal::ZoneObject
void * operator new (size_t, Zone *)=delete
 
void * operator new (size_t size, void *ptr)
 
void operator delete (void *, size_t)
 
void operator delete (void *pointer, Zone *zone)=delete
 

Static Public Member Functions

static InitializationFlag DefaultInitializationFlag (VariableMode mode)
 

Static Public Attributes

static constexpr uint8_t kUncacheableHoleCheckBitmapIndex = 0
 
static constexpr uint8_t kHoleCheckBitmapBits
 

Private Types

using VariableModeField = base::BitField16<VariableMode, 0, 4>
 
using VariableKindField = VariableModeField::Next<VariableKind, 3>
 
using LocationField = VariableKindField::Next<VariableLocation, 3>
 
using ForceContextAllocationBit = LocationField::Next<bool, 1>
 
using IsUsedField = ForceContextAllocationBit::Next<bool, 1>
 
using InitializationFlagField = IsUsedField::Next<InitializationFlag, 1>
 
using MaybeAssignedFlagField
 
using IsStaticFlagField = MaybeAssignedFlagField::Next<IsStaticFlag, 1>
 
using HoleCheckBitmapIndexField = base::BitField16<uint8_t, 0, 8>
 
using ForceHoleInitializationFlagField
 

Private Member Functions

void set_maybe_assigned ()
 
uint8_t HoleCheckBitmapIndex () const
 
void AssignHoleCheckBitmapIndex (ZoneVector< Variable * > &list, uint8_t next_index)
 
Variable ** next ()
 

Private Attributes

Scopescope_
 
const AstRawStringname_
 
Variablelocal_if_not_shadowed_
 
Variablenext_
 
int index_
 
int initializer_position_
 
uint16_t bit_field_
 
uint16_t hole_check_analysis_bit_field_
 
friend List
 

Detailed Description

Definition at line 21 of file variables.h.

Member Typedef Documentation

◆ ForceContextAllocationBit

using v8::internal::Variable::ForceContextAllocationBit = LocationField::Next<bool, 1>
private

Definition at line 351 of file variables.h.

◆ ForceHoleInitializationFlagField

using v8::internal::Variable::ForceHoleInitializationFlagField
private
Initial value:

Definition at line 359 of file variables.h.

◆ HoleCheckBitmap

using v8::internal::Variable::HoleCheckBitmap = uint64_t

Definition at line 210 of file variables.h.

◆ HoleCheckBitmapIndexField

using v8::internal::Variable::HoleCheckBitmapIndexField = base::BitField16<uint8_t, 0, 8>
private

Definition at line 358 of file variables.h.

◆ InitializationFlagField

using v8::internal::Variable::InitializationFlagField = IsUsedField::Next<InitializationFlag, 1>
private

Definition at line 353 of file variables.h.

◆ IsStaticFlagField

using v8::internal::Variable::IsStaticFlagField = MaybeAssignedFlagField::Next<IsStaticFlag, 1>
private

Definition at line 356 of file variables.h.

◆ IsUsedField

using v8::internal::Variable::IsUsedField = ForceContextAllocationBit::Next<bool, 1>
private

Definition at line 352 of file variables.h.

◆ List

using v8::internal::Variable::List = base::ThreadedList<Variable>

Definition at line 320 of file variables.h.

◆ LocationField

using v8::internal::Variable::LocationField = VariableKindField::Next<VariableLocation, 3>
private

Definition at line 350 of file variables.h.

◆ MaybeAssignedFlagField

using v8::internal::Variable::MaybeAssignedFlagField
private
Initial value:

Definition at line 354 of file variables.h.

◆ VariableKindField

using v8::internal::Variable::VariableKindField = VariableModeField::Next<VariableKind, 3>
private

Definition at line 349 of file variables.h.

◆ VariableModeField

using v8::internal::Variable::VariableModeField = base::BitField16<VariableMode, 0, 4>
private

Definition at line 348 of file variables.h.

Member Enumeration Documentation

◆ ForceHoleInitializationFlag

enum v8::internal::Variable::ForceHoleInitializationFlag
Enumerator
kHoleInitializationNotForced 
kHasHoleCheckUseInDifferentClosureScope 
kHasHoleCheckUseInSameClosureScope 
kHasHoleCheckUseInUnknownScope 

Definition at line 172 of file variables.h.

Constructor & Destructor Documentation

◆ Variable() [1/2]

v8::internal::Variable::Variable ( Scope * scope,
const AstRawString * name,
VariableMode mode,
VariableKind kind,
InitializationFlag initialization_flag,
MaybeAssignedFlag maybe_assigned_flag = kNotAssigned,
IsStaticFlag is_static_flag = IsStaticFlag::kNotStatic )
inline

Definition at line 23 of file variables.h.

Here is the call graph for this function:

◆ Variable() [2/2]

v8::internal::Variable::Variable ( Variable * other)
explicit

Definition at line 16 of file variables.cc.

Member Function Documentation

◆ AllocateTo()

void v8::internal::Variable::AllocateTo ( VariableLocation location,
int index )
inline

Definition at line 295 of file variables.h.

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

◆ AssignHoleCheckBitmapIndex()

void v8::internal::Variable::AssignHoleCheckBitmapIndex ( ZoneVector< Variable * > & list,
uint8_t next_index )
private

Definition at line 50 of file variables.cc.

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

◆ binding_needs_init()

bool v8::internal::Variable::binding_needs_init ( ) const
inline

Definition at line 150 of file variables.h.

Here is the call graph for this function:

◆ clear_maybe_assigned()

void v8::internal::Variable::clear_maybe_assigned ( )
inline

Definition at line 91 of file variables.h.

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

◆ DefaultInitializationFlag()

static InitializationFlag v8::internal::Variable::DefaultInitializationFlag ( VariableMode mode)
inlinestatic

Definition at line 311 of file variables.h.

Here is the call graph for this function:

◆ force_hole_initialization_flag_field()

ForceHoleInitializationFlag v8::internal::Variable::force_hole_initialization_flag_field ( ) const
inline

Definition at line 179 of file variables.h.

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

◆ ForceContextAllocation()

void v8::internal::Variable::ForceContextAllocation ( )
inline

Definition at line 81 of file variables.h.

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

◆ ForceHoleInitialization()

void v8::internal::Variable::ForceHoleInitialization ( ForceHoleInitializationFlag flag)
inline

Definition at line 197 of file variables.h.

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

◆ has_forced_context_allocation()

bool v8::internal::Variable::has_forced_context_allocation ( ) const
inline

Definition at line 78 of file variables.h.

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

◆ has_local_if_not_shadowed()

bool v8::internal::Variable::has_local_if_not_shadowed ( ) const
inline

Definition at line 268 of file variables.h.

Here is the caller graph for this function:

◆ HasHoleCheckUseInSameClosureScope()

bool v8::internal::Variable::HasHoleCheckUseInSameClosureScope ( ) const
inline

Definition at line 189 of file variables.h.

Here is the call graph for this function:

◆ HasRememberedHoleCheck()

bool v8::internal::Variable::HasRememberedHoleCheck ( HoleCheckBitmap bitmap) const
inline

Definition at line 240 of file variables.h.

Here is the call graph for this function:

◆ HoleCheckBitmapIndex()

uint8_t v8::internal::Variable::HoleCheckBitmapIndex ( ) const
inlineprivate

Definition at line 341 of file variables.h.

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

◆ index()

int v8::internal::Variable::index ( ) const
inline

Definition at line 281 of file variables.h.

Here is the caller graph for this function:

◆ initialization_flag()

InitializationFlag v8::internal::Variable::initialization_flag ( ) const
inline

Definition at line 144 of file variables.h.

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

◆ initializer_position()

int v8::internal::Variable::initializer_position ( )
inline

Definition at line 121 of file variables.h.

Here is the caller graph for this function:

◆ is_dynamic()

bool v8::internal::Variable::is_dynamic ( ) const
inline

Definition at line 138 of file variables.h.

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

◆ is_parameter()

bool v8::internal::Variable::is_parameter ( ) const
inline

Definition at line 256 of file variables.h.

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

◆ is_sloppy_block_function()

bool v8::internal::Variable::is_sloppy_block_function ( )
inline

Definition at line 257 of file variables.h.

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

◆ is_sloppy_function_name()

bool v8::internal::Variable::is_sloppy_function_name ( ) const
inline

Definition at line 252 of file variables.h.

Here is the call graph for this function:

◆ is_static()

bool v8::internal::Variable::is_static ( ) const
inline

Definition at line 76 of file variables.h.

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

◆ is_static_flag()

IsStaticFlag v8::internal::Variable::is_static_flag ( ) const
inline

Definition at line 73 of file variables.h.

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

◆ is_this()

bool v8::internal::Variable::is_this ( ) const
inline

Definition at line 251 of file variables.h.

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

◆ is_used()

bool v8::internal::Variable::is_used ( )
inline

Definition at line 86 of file variables.h.

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

◆ IsContextSlot()

bool v8::internal::Variable::IsContextSlot ( ) const
inline

Definition at line 130 of file variables.h.

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

◆ IsExport()

bool v8::internal::Variable::IsExport ( ) const
inline

Definition at line 289 of file variables.h.

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

◆ IsGlobalObjectProperty()

bool v8::internal::Variable::IsGlobalObjectProperty ( ) const

Definition at line 25 of file variables.cc.

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

◆ IsHoleInitializationForced()

bool v8::internal::Variable::IsHoleInitializationForced ( ) const
inline

Definition at line 184 of file variables.h.

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

◆ IsLookupSlot()

bool v8::internal::Variable::IsLookupSlot ( ) const
inline

Definition at line 131 of file variables.h.

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

◆ IsParameter()

bool v8::internal::Variable::IsParameter ( ) const
inline

Definition at line 127 of file variables.h.

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

◆ IsReceiver()

bool v8::internal::Variable::IsReceiver ( ) const
inline

Definition at line 283 of file variables.h.

Here is the call graph for this function:

◆ IsReplGlobal()

bool v8::internal::Variable::IsReplGlobal ( ) const

Definition at line 32 of file variables.cc.

Here is the call graph for this function:

◆ IsStackAllocated()

bool v8::internal::Variable::IsStackAllocated ( ) const
inline

Definition at line 129 of file variables.h.

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

◆ IsStackLocal()

bool v8::internal::Variable::IsStackLocal ( ) const
inline

Definition at line 128 of file variables.h.

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

◆ IsUnallocated()

bool v8::internal::Variable::IsUnallocated ( ) const
inline

Definition at line 124 of file variables.h.

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

◆ kind()

VariableKind v8::internal::Variable::kind ( ) const
inline

Definition at line 279 of file variables.h.

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

◆ local_if_not_shadowed()

Variable * v8::internal::Variable::local_if_not_shadowed ( ) const
inline

Definition at line 261 of file variables.h.

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

◆ location()

VariableLocation v8::internal::Variable::location ( ) const
inline

Definition at line 276 of file variables.h.

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

◆ MakeParameterNonSimple()

void v8::internal::Variable::MakeParameterNonSimple ( )
inline

Definition at line 304 of file variables.h.

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

◆ maybe_assigned()

MaybeAssignedFlag v8::internal::Variable::maybe_assigned ( ) const
inline

Definition at line 88 of file variables.h.

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

◆ mode()

VariableMode v8::internal::Variable::mode ( ) const
inline

Definition at line 66 of file variables.h.

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

◆ name()

Handle< String > v8::internal::Variable::name ( ) const
inline

Definition at line 64 of file variables.h.

Here is the caller graph for this function:

◆ next()

Variable ** v8::internal::Variable::next ( )
inlineprivate

Definition at line 362 of file variables.h.

◆ raw_name()

const AstRawString * v8::internal::Variable::raw_name ( ) const
inline

Definition at line 65 of file variables.h.

Here is the caller graph for this function:

◆ RememberHoleCheckInBitmap()

void v8::internal::Variable::RememberHoleCheckInBitmap ( HoleCheckBitmap & bitmap,
ZoneVector< Variable * > & list )
inline

Definition at line 225 of file variables.h.

Here is the call graph for this function:

◆ requires_brand_check()

bool v8::internal::Variable::requires_brand_check ( ) const
inline

Definition at line 117 of file variables.h.

Here is the call graph for this function:

◆ ResetHoleCheckBitmapIndex()

void v8::internal::Variable::ResetHoleCheckBitmapIndex ( )
inline

Definition at line 220 of file variables.h.

Here is the call graph for this function:

◆ RewriteLocationForRepl()

void v8::internal::Variable::RewriteLocationForRepl ( )

Definition at line 39 of file variables.cc.

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

◆ scope()

Scope * v8::internal::Variable::scope ( ) const
inline

Definition at line 58 of file variables.h.

Here is the caller graph for this function:

◆ set_initializer_position()

void v8::internal::Variable::set_initializer_position ( int pos)
inline

Definition at line 122 of file variables.h.

Here is the caller graph for this function:

◆ set_is_static_flag()

void v8::internal::Variable::set_is_static_flag ( IsStaticFlag is_static_flag)
inline

Definition at line 70 of file variables.h.

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

◆ set_is_used()

void v8::internal::Variable::set_is_used ( )
inline

Definition at line 87 of file variables.h.

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

◆ set_local_if_not_shadowed()

void v8::internal::Variable::set_local_if_not_shadowed ( Variable * local)
inline

Definition at line 272 of file variables.h.

Here is the caller graph for this function:

◆ set_maybe_assigned()

void v8::internal::Variable::set_maybe_assigned ( )
inlineprivate

Definition at line 337 of file variables.h.

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

◆ set_mode()

void v8::internal::Variable::set_mode ( VariableMode mode)
inline

Definition at line 67 of file variables.h.

Here is the call graph for this function:

◆ set_scope()

void v8::internal::Variable::set_scope ( Scope * scope)
inline

Definition at line 62 of file variables.h.

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

◆ SetMaybeAssigned()

void v8::internal::Variable::SetMaybeAssigned ( )
inline

Definition at line 94 of file variables.h.

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

◆ throw_on_const_assignment()

bool v8::internal::Variable::throw_on_const_assignment ( LanguageMode language_mode) const
inline

Definition at line 247 of file variables.h.

Here is the call graph for this function:

Member Data Documentation

◆ bit_field_

uint16_t v8::internal::Variable::bit_field_
private

Definition at line 334 of file variables.h.

◆ hole_check_analysis_bit_field_

uint16_t v8::internal::Variable::hole_check_analysis_bit_field_
private

Definition at line 335 of file variables.h.

◆ index_

int v8::internal::Variable::index_
private

Definition at line 332 of file variables.h.

◆ initializer_position_

int v8::internal::Variable::initializer_position_
private

Definition at line 333 of file variables.h.

◆ kHoleCheckBitmapBits

uint8_t v8::internal::Variable::kHoleCheckBitmapBits
staticconstexpr
Initial value:
=
std::numeric_limits<HoleCheckBitmap>::digits

Definition at line 217 of file variables.h.

◆ kUncacheableHoleCheckBitmapIndex

uint8_t v8::internal::Variable::kUncacheableHoleCheckBitmapIndex = 0
staticconstexpr

Definition at line 216 of file variables.h.

◆ List

friend v8::internal::Variable::List
private

Definition at line 363 of file variables.h.

◆ local_if_not_shadowed_

Variable* v8::internal::Variable::local_if_not_shadowed_
private

Definition at line 330 of file variables.h.

◆ name_

const AstRawString* v8::internal::Variable::name_
private

Definition at line 324 of file variables.h.

◆ next_

Variable* v8::internal::Variable::next_
private

Definition at line 331 of file variables.h.

◆ scope_

Scope* v8::internal::Variable::scope_
private

Definition at line 323 of file variables.h.


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