V8 Project
v8::internal::ModuleInfo Class Reference

#include <scopeinfo.h>

+ Inheritance diagram for v8::internal::ModuleInfo:
+ Collaboration diagram for v8::internal::ModuleInfo:

Public Member Functions

int host_index ()
 
Stringname (int i)
 
VariableMode mode (int i)
 
int index (int i)
 
int length ()
 
- Public Member Functions inherited from v8::internal::FixedArray
Objectget (int index)
 
void set (int index, Object *value)
 
bool is_the_hole (int index)
 
void set (int index, Smi *value)
 
void set (int index, Object *value, WriteBarrierMode mode)
 
void set_undefined (int index)
 
void set_null (int index)
 
void set_the_hole (int index)
 
Object ** GetFirstElementAddress ()
 
bool ContainsOnlySmisOrHoles ()
 
Object ** data_start ()
 
void FillWithHoles (int from, int to)
 
void Shrink (int length)
 
void CopyTo (int pos, FixedArray *dest, int dest_pos, int len)
 
Object ** RawFieldOfElementAt (int index)
 
void SwapPairs (FixedArray *numbers, int i, int j)
 
void SortPairs (FixedArray *numbers, uint32_t len)
 
- Public Member Functions inherited from v8::internal::FixedArrayBase
int length () const
 
void set_length (int value)
 
int synchronized_length () const
 
void synchronized_set_length (int value)
 
- Public Member Functions inherited from v8::internal::HeapObject
Mapmap () const
 
void set_map (Map *value)
 
void set_map_no_write_barrier (Map *value)
 
Mapsynchronized_map ()
 
MapWord synchronized_map_word () const
 
void synchronized_set_map (Map *value)
 
void synchronized_set_map_no_write_barrier (Map *value)
 
void synchronized_set_map_word (MapWord map_word)
 
MapWord map_word () const
 
void set_map_word (MapWord map_word)
 
HeapGetHeap () const
 
IsolateGetIsolate () const
 
Address address ()
 
void Iterate (ObjectVisitor *v)
 
void IterateBody (InstanceType type, int object_size, ObjectVisitor *v)
 
int Size ()
 
bool MayContainRawValues ()
 
int SizeFromMap (Map *map)
 
WriteBarrierMode GetWriteBarrierMode (const DisallowHeapAllocation &promise)
 
void HeapObjectShortPrint (OStream &os)
 
 STATIC_ASSERT (kMapOffset==Internals::kHeapObjectMapOffset)
 
- Public Member Functions inherited from v8::internal::Object
bool IsObject () const
 
 INLINE (bool IsFixedArrayBase() const)
 
 INLINE (bool IsExternal() const)
 
 INLINE (bool IsAccessorInfo() const)
 
 INLINE (bool IsStruct() const)
 
 INLINE (bool IsSpecObject()) const
 
 INLINE (bool IsSpecFunction()) const
 
 INLINE (bool IsTemplateInfo()) const
 
 INLINE (bool IsNameDictionary() const)
 
 INLINE (bool IsSeededNumberDictionary() const)
 
 INLINE (bool IsUnseededNumberDictionary() const)
 
 INLINE (bool IsOrderedHashSet() const)
 
 INLINE (bool IsOrderedHashMap() const)
 
bool IsCallable () const
 
 INLINE (bool IsUndefined() const)
 
 INLINE (bool IsNull() const)
 
 INLINE (bool IsTheHole() const)
 
 INLINE (bool IsException() const)
 
 INLINE (bool IsUninitialized() const)
 
 INLINE (bool IsTrue() const)
 
 INLINE (bool IsFalse() const)
 
 INLINE (bool IsArgumentsMarker() const)
 
 INLINE (bool IsFiller() const)
 
double Number ()
 
 INLINE (bool IsNaN() const)
 
 INLINE (bool IsMinusZero() const)
 
bool ToInt32 (int32_t *value)
 
bool ToUint32 (uint32_t *value)
 
Representation OptimalRepresentation ()
 
bool FitsRepresentation (Representation representation)
 
Handle< HeapTypeOptimalType (Isolate *isolate, Representation representation)
 
bool HasValidElements ()
 
bool HasSpecificClassOf (String *name)
 
bool BooleanValue ()
 
ObjectGetHash ()
 
bool SameValue (Object *other)
 
bool SameValueZero (Object *other)
 
bool ToArrayIndex (uint32_t *index)
 
bool IsStringObjectWithCharacterAt (uint32_t index)
 
void VerifyApiCallResultType ()
 
void ShortPrint (FILE *out=stdout)
 
void ShortPrint (StringStream *accumulator)
 

Static Public Member Functions

static ModuleInfocast (Object *description)
 
static Handle< ModuleInfoCreate (Isolate *isolate, Interface *interface, Scope *scope)
 
- Static Public Member Functions inherited from v8::internal::FixedArray
static Handle< Objectget (Handle< FixedArray > array, int index)
 
static Handle< FixedArrayCopySize (Handle< FixedArray > array, int new_length, PretenureFlag pretenure=NOT_TENURED)
 
static MUST_USE_RESULT MaybeHandle< FixedArrayAddKeysFromArrayLike (Handle< FixedArray > content, Handle< JSObject > array)
 
static MUST_USE_RESULT MaybeHandle< FixedArrayUnionOfKeys (Handle< FixedArray > first, Handle< FixedArray > second)
 
static int SizeFor (int length)
 
static int OffsetOfElementAt (int index)
 
- Static Public Member Functions inherited from v8::internal::HeapObject
static HeapObjectFromAddress (Address address)
 
static Object ** RawField (HeapObject *obj, int offset)
 
static void UpdateMapCodeCache (Handle< HeapObject > object, Handle< Name > name, Handle< Code > code)
 
- Static Public Member Functions inherited from v8::internal::Object
static Handle< ObjectNewStorageFor (Isolate *isolate, Handle< Object > object, Representation representation)
 
static Handle< ObjectWrapForRead (Isolate *isolate, Handle< Object > object, Representation representation)
 
static MaybeHandle< JSReceiverToObject (Isolate *isolate, Handle< Object > object)
 
static MaybeHandle< JSReceiverToObject (Isolate *isolate, Handle< Object > object, Handle< Context > context)
 
static MUST_USE_RESULT MaybeHandle< SmiToSmi (Isolate *isolate, Handle< Object > object)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetProperty (LookupIterator *it)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetProperty (Handle< Object > object, Handle< Name > key, Handle< Object > value, StrictMode strict_mode, StoreFromKeyed store_mode=MAY_BE_STORE_FROM_KEYED)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetProperty (LookupIterator *it, Handle< Object > value, StrictMode strict_mode, StoreFromKeyed store_mode, StorePropertyMode data_store_mode=NORMAL_PROPERTY)
 
static MUST_USE_RESULT MaybeHandle< ObjectWriteToReadOnlyProperty (LookupIterator *it, Handle< Object > value, StrictMode strict_mode)
 
static Handle< ObjectSetDataProperty (LookupIterator *it, Handle< Object > value)
 
static MUST_USE_RESULT MaybeHandle< ObjectAddDataProperty (LookupIterator *it, Handle< Object > value, PropertyAttributes attributes, StrictMode strict_mode, StoreFromKeyed store_mode)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetPropertyOrElement (Handle< Object > object, Handle< Name > key)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetProperty (Isolate *isolate, Handle< Object > object, const char *key)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetProperty (Handle< Object > object, Handle< Name > key)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetPropertyWithAccessor (Handle< Object > receiver, Handle< Name > name, Handle< JSObject > holder, Handle< Object > structure)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetPropertyWithAccessor (Handle< Object > receiver, Handle< Name > name, Handle< Object > value, Handle< JSObject > holder, Handle< Object > structure, StrictMode strict_mode)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetPropertyWithDefinedGetter (Handle< Object > receiver, Handle< JSReceiver > getter)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetPropertyWithDefinedSetter (Handle< Object > receiver, Handle< JSReceiver > setter, Handle< Object > value)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetElement (Isolate *isolate, Handle< Object > object, uint32_t index)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetElementWithReceiver (Isolate *isolate, Handle< Object > object, Handle< Object > receiver, uint32_t index)
 
static Handle< SmiGetOrCreateHash (Isolate *isolate, Handle< Object > object)
 

Private Types

enum  {
  HOST_OFFSET , NAME_OFFSET , MODE_OFFSET , INDEX_OFFSET ,
  HEADER_SIZE = NAME_OFFSET , ITEM_SIZE = INDEX_OFFSET - NAME_OFFSET + 1
}
 

Private Member Functions

int name_offset (int i)
 
int mode_offset (int i)
 
int index_offset (int i)
 
void set_host_index (int index)
 
void set_name (int i, String *name)
 
void set_mode (int i, VariableMode mode)
 
void set_index (int i, int index)
 

Static Private Member Functions

static Handle< ModuleInfoAllocate (Isolate *isolate, int length)
 

Additional Inherited Members

- Public Types inherited from v8::internal::Object
enum  StoreFromKeyed { MAY_BE_STORE_FROM_KEYED , CERTAINLY_NOT_STORE_FROM_KEYED }
 
enum  StorePropertyMode { NORMAL_PROPERTY , SUPER_PROPERTY }
 
- Static Public Attributes inherited from v8::internal::FixedArray
static const int kMaxSize = 128 * MB * kPointerSize
 
static const int kMaxLength = (kMaxSize - kHeaderSize) / kPointerSize
 
- Static Public Attributes inherited from v8::internal::FixedArrayBase
static const int kLengthOffset = HeapObject::kHeaderSize
 
static const int kHeaderSize = kLengthOffset + kPointerSize
 
- Static Public Attributes inherited from v8::internal::HeapObject
static const int kMapOffset = Object::kHeaderSize
 
static const int kHeaderSize = kMapOffset + kPointerSize
 
- Static Public Attributes inherited from v8::internal::Object
static const int kHeaderSize = 0
 
- Protected Member Functions inherited from v8::internal::HeapObject
void IteratePointers (ObjectVisitor *v, int start, int end)
 
void IteratePointer (ObjectVisitor *v, int offset)
 
void IterateNextCodeLink (ObjectVisitor *v, int offset)
 
- Static Protected Member Functions inherited from v8::internal::FixedArray
static void NoWriteBarrierSet (FixedArray *array, int index, Object *value)
 
static void NoIncrementalWriteBarrierSet (FixedArray *array, int index, Object *value)
 

Detailed Description

Definition at line 117 of file scopeinfo.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
HOST_OFFSET 
NAME_OFFSET 
MODE_OFFSET 
INDEX_OFFSET 
HEADER_SIZE 
ITEM_SIZE 

Definition at line 145 of file scopeinfo.h.

Member Function Documentation

◆ Allocate()

static Handle<ModuleInfo> v8::internal::ModuleInfo::Allocate ( Isolate isolate,
int  length 
)
inlinestaticprivate

Definition at line 157 of file scopeinfo.h.

157  {
159  isolate->factory()->NewFixedArray(HEADER_SIZE + ITEM_SIZE * length));
160  }
static Handle< T > cast(Handle< S > that)
Definition: handles.h:116

References v8::internal::Handle< T >::cast(), v8::internal::Isolate::factory(), HEADER_SIZE, ITEM_SIZE, and length().

Referenced by Create().

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

◆ cast()

static ModuleInfo* v8::internal::ModuleInfo::cast ( Object description)
inlinestatic

Definition at line 119 of file scopeinfo.h.

119  {
120  return static_cast<ModuleInfo*>(FixedArray::cast(description));
121  }

Referenced by v8::internal::RUNTIME_FUNCTION().

+ Here is the caller graph for this function:

◆ Create()

Handle< ModuleInfo > v8::internal::ModuleInfo::Create ( Isolate isolate,
Interface interface,
Scope scope 
)
static

Definition at line 549 of file scopeinfo.cc.

550  {
551  Handle<ModuleInfo> info = Allocate(isolate, interface->Length());
552  info->set_host_index(interface->Index());
553  int i = 0;
554  for (Interface::Iterator it = interface->iterator();
555  !it.done(); it.Advance(), ++i) {
556  Variable* var = scope->LookupLocal(it.name());
557  info->set_name(i, *(it.name()->string()));
558  info->set_mode(i, var->mode());
559  DCHECK((var->mode() == MODULE) == (it.interface()->IsModule()));
560  if (var->mode() == MODULE) {
561  DCHECK(it.interface()->IsFrozen());
562  DCHECK(it.interface()->Index() >= 0);
563  info->set_index(i, it.interface()->Index());
564  } else {
565  DCHECK(var->index() >= 0);
566  info->set_index(i, var->index());
567  }
568  }
569  DCHECK(i == info->length());
570  return info;
571 }
static Handle< ModuleInfo > Allocate(Isolate *isolate, int length)
Definition: scopeinfo.h:157
#define DCHECK(condition)
Definition: logging.h:205

References Allocate(), DCHECK, v8::internal::Interface::Iterator::done(), v8::internal::Interface::Index(), v8::internal::Variable::index(), v8::internal::Interface::iterator(), v8::internal::Interface::Length(), v8::internal::Scope::LookupLocal(), v8::internal::Variable::mode(), and v8::internal::MODULE.

+ Here is the call graph for this function:

◆ host_index()

int v8::internal::ModuleInfo::host_index ( )
inline

Definition at line 127 of file scopeinfo.h.

127 { return Smi::cast(get(HOST_OFFSET))->value(); }
Object * get(int index)
Definition: objects-inl.h:2165

References v8::internal::FixedArray::get(), and HOST_OFFSET.

+ Here is the call graph for this function:

◆ index()

int v8::internal::ModuleInfo::index ( int  i)
inline

Definition at line 139 of file scopeinfo.h.

139 { return Smi::cast(get(index_offset(i)))->value(); }

References v8::internal::FixedArray::get(), and index_offset().

Referenced by set_host_index(), and set_index().

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

◆ index_offset()

int v8::internal::ModuleInfo::index_offset ( int  i)
inlineprivate

Definition at line 155 of file scopeinfo.h.

155 { return INDEX_OFFSET + i * ITEM_SIZE; }

References INDEX_OFFSET, and ITEM_SIZE.

Referenced by index(), and set_index().

+ Here is the caller graph for this function:

◆ length()

int v8::internal::ModuleInfo::length ( )
inline

Definition at line 141 of file scopeinfo.h.

References HEADER_SIZE, ITEM_SIZE, and v8::internal::FixedArrayBase::length().

Referenced by Allocate().

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

◆ mode()

VariableMode v8::internal::ModuleInfo::mode ( int  i)
inline

Definition at line 136 of file scopeinfo.h.

136  {
137  return static_cast<VariableMode>(Smi::cast(get(mode_offset(i)))->value());
138  }

References v8::internal::FixedArray::get(), and mode_offset().

Referenced by set_mode().

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

◆ mode_offset()

int v8::internal::ModuleInfo::mode_offset ( int  i)
inlineprivate

Definition at line 154 of file scopeinfo.h.

154 { return MODE_OFFSET + i * ITEM_SIZE; }

References ITEM_SIZE, and MODE_OFFSET.

Referenced by mode(), and set_mode().

+ Here is the caller graph for this function:

◆ name()

String* v8::internal::ModuleInfo::name ( int  i)
inline

Definition at line 135 of file scopeinfo.h.

135 { return String::cast(get(name_offset(i))); }

References v8::internal::FixedArray::get(), and name_offset().

Referenced by set_name().

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

◆ name_offset()

int v8::internal::ModuleInfo::name_offset ( int  i)
inlineprivate

Definition at line 153 of file scopeinfo.h.

153 { return NAME_OFFSET + i * ITEM_SIZE; }

References ITEM_SIZE, and NAME_OFFSET.

Referenced by name(), and set_name().

+ Here is the caller graph for this function:

◆ set_host_index()

void v8::internal::ModuleInfo::set_host_index ( int  index)
inlineprivate

Definition at line 161 of file scopeinfo.h.

void set(int index, Object *value)
Definition: objects-inl.h:2190
static Smi * FromInt(int value)
Definition: objects-inl.h:1321

References v8::internal::Smi::FromInt(), HOST_OFFSET, index(), and v8::internal::FixedArray::set().

+ Here is the call graph for this function:

◆ set_index()

void v8::internal::ModuleInfo::set_index ( int  i,
int  index 
)
inlineprivate

Definition at line 166 of file scopeinfo.h.

166  {
168  }

References v8::internal::Smi::FromInt(), index(), index_offset(), and v8::internal::FixedArray::set().

+ Here is the call graph for this function:

◆ set_mode()

void v8::internal::ModuleInfo::set_mode ( int  i,
VariableMode  mode 
)
inlineprivate

Definition at line 163 of file scopeinfo.h.

163  {
165  }
VariableMode mode(int i)
Definition: scopeinfo.h:136

References v8::internal::Smi::FromInt(), mode(), mode_offset(), and v8::internal::FixedArray::set().

+ Here is the call graph for this function:

◆ set_name()

void v8::internal::ModuleInfo::set_name ( int  i,
String name 
)
inlineprivate

Definition at line 162 of file scopeinfo.h.

162 { set(name_offset(i), name); }
String * name(int i)
Definition: scopeinfo.h:135

References name(), name_offset(), and v8::internal::FixedArray::set().

+ Here is the call graph for this function:

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