V8 Project
v8::internal::FunctionTemplateInfo Class Reference

#include <objects.h>

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

Public Member Functions

int length () const
 
void set_length (int value)
 
bool IsTemplateFor (Object *object)
 
bool IsTemplateFor (Map *map)
 
- Public Member Functions inherited from v8::internal::Struct
void InitializeBody (int object_size)
 
- 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 Attributes

static const int kSerialNumberOffset = TemplateInfo::kHeaderSize
 
static const int kCallCodeOffset = kSerialNumberOffset + kPointerSize
 
static const int kPrototypeTemplateOffset
 
static const int kParentTemplateOffset
 
static const int kNamedPropertyHandlerOffset
 
static const int kIndexedPropertyHandlerOffset
 
static const int kInstanceTemplateOffset
 
static const int kClassNameOffset = kInstanceTemplateOffset + kPointerSize
 
static const int kSignatureOffset = kClassNameOffset + kPointerSize
 
static const int kInstanceCallHandlerOffset = kSignatureOffset + kPointerSize
 
static const int kAccessCheckInfoOffset
 
static const int kFlagOffset = kAccessCheckInfoOffset + kPointerSize
 
static const int kLengthOffset = kFlagOffset + kPointerSize
 
static const int kSize = kLengthOffset + kPointerSize
 
- Static Public Attributes inherited from v8::internal::TemplateInfo
static const int kTagOffset = HeapObject::kHeaderSize
 
static const int kPropertyListOffset = kTagOffset + kPointerSize
 
static const int kPropertyAccessorsOffset
 
static const int kHeaderSize = kPropertyAccessorsOffset + 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
 

Private Member Functions

 DISALLOW_IMPLICIT_CONSTRUCTORS (FunctionTemplateInfo)
 

Static Private Attributes

static const int kHiddenPrototypeBit = 0
 
static const int kUndetectableBit = 1
 
static const int kNeedsAccessCheckBit = 2
 
static const int kReadOnlyPrototypeBit = 3
 
static const int kRemovePrototypeBit = 4
 
static const int kDoNotCacheBit = 5
 

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 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)
 
- 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)
 

Detailed Description

Definition at line 10447 of file objects.h.

Member Function Documentation

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::FunctionTemplateInfo::DISALLOW_IMPLICIT_CONSTRUCTORS ( FunctionTemplateInfo  )
private

◆ IsTemplateFor() [1/2]

bool v8::internal::FunctionTemplateInfo::IsTemplateFor ( Map map)

Definition at line 216 of file objects.cc.

216  {
217  // There is a constraint on the object; check.
218  if (!map->IsJSObjectMap()) return false;
219  // Fetch the constructor function of the object.
220  Object* cons_obj = map->constructor();
221  if (!cons_obj->IsJSFunction()) return false;
222  JSFunction* fun = JSFunction::cast(cons_obj);
223  // Iterate through the chain of inheriting function templates to
224  // see if the required one occurs.
225  for (Object* type = fun->shared()->function_data();
226  type->IsFunctionTemplateInfo();
227  type = FunctionTemplateInfo::cast(type)->parent_template()) {
228  if (type == this) return true;
229  }
230  // Didn't find the required type in the inheritance chain.
231  return false;
232 }
bool IsJSObjectMap()
Definition: objects.h:6125
kSerializedDataOffset Object
Definition: objects-inl.h:5322

References v8::internal::Map::IsJSObjectMap(), and v8::internal::HeapObject::map().

+ Here is the call graph for this function:

◆ IsTemplateFor() [2/2]

bool v8::internal::FunctionTemplateInfo::IsTemplateFor ( Object object)

Definition at line 210 of file objects.cc.

210  {
211  if (!object->IsHeapObject()) return false;
212  return IsTemplateFor(HeapObject::cast(object)->map());
213 }
bool IsTemplateFor(Object *object)
Definition: objects.cc:210

References v8::internal::HeapObject::map().

Referenced by v8::internal::FindHidden(), and v8::Object::FindInstanceInPrototypeChain().

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

◆ length()

int v8::internal::FunctionTemplateInfo::length ( ) const
inline

◆ set_length()

void v8::internal::FunctionTemplateInfo::set_length ( int  value)
inline

Member Data Documentation

◆ kAccessCheckInfoOffset

const int v8::internal::FunctionTemplateInfo::kAccessCheckInfoOffset
static
Initial value:

Definition at line 10496 of file objects.h.

◆ kCallCodeOffset

const int v8::internal::FunctionTemplateInfo::kCallCodeOffset = kSerialNumberOffset + kPointerSize
static

Definition at line 10482 of file objects.h.

◆ kClassNameOffset

const int v8::internal::FunctionTemplateInfo::kClassNameOffset = kInstanceTemplateOffset + kPointerSize
static

Definition at line 10493 of file objects.h.

◆ kDoNotCacheBit

const int v8::internal::FunctionTemplateInfo::kDoNotCacheBit = 5
staticprivate

Definition at line 10513 of file objects.h.

◆ kFlagOffset

const int v8::internal::FunctionTemplateInfo::kFlagOffset = kAccessCheckInfoOffset + kPointerSize
static

Definition at line 10498 of file objects.h.

◆ kHiddenPrototypeBit

const int v8::internal::FunctionTemplateInfo::kHiddenPrototypeBit = 0
staticprivate

Definition at line 10508 of file objects.h.

◆ kIndexedPropertyHandlerOffset

const int v8::internal::FunctionTemplateInfo::kIndexedPropertyHandlerOffset
static
Initial value:

Definition at line 10489 of file objects.h.

◆ kInstanceCallHandlerOffset

const int v8::internal::FunctionTemplateInfo::kInstanceCallHandlerOffset = kSignatureOffset + kPointerSize
static

Definition at line 10495 of file objects.h.

◆ kInstanceTemplateOffset

const int v8::internal::FunctionTemplateInfo::kInstanceTemplateOffset
static
Initial value:

Definition at line 10491 of file objects.h.

◆ kLengthOffset

const int v8::internal::FunctionTemplateInfo::kLengthOffset = kFlagOffset + kPointerSize
static

Definition at line 10499 of file objects.h.

◆ kNamedPropertyHandlerOffset

const int v8::internal::FunctionTemplateInfo::kNamedPropertyHandlerOffset
static
Initial value:

Definition at line 10487 of file objects.h.

◆ kNeedsAccessCheckBit

const int v8::internal::FunctionTemplateInfo::kNeedsAccessCheckBit = 2
staticprivate

Definition at line 10510 of file objects.h.

◆ kParentTemplateOffset

const int v8::internal::FunctionTemplateInfo::kParentTemplateOffset
static
Initial value:

Definition at line 10485 of file objects.h.

◆ kPrototypeTemplateOffset

const int v8::internal::FunctionTemplateInfo::kPrototypeTemplateOffset
static
Initial value:

Definition at line 10483 of file objects.h.

◆ kReadOnlyPrototypeBit

const int v8::internal::FunctionTemplateInfo::kReadOnlyPrototypeBit = 3
staticprivate

Definition at line 10511 of file objects.h.

◆ kRemovePrototypeBit

const int v8::internal::FunctionTemplateInfo::kRemovePrototypeBit = 4
staticprivate

Definition at line 10512 of file objects.h.

◆ kSerialNumberOffset

const int v8::internal::FunctionTemplateInfo::kSerialNumberOffset = TemplateInfo::kHeaderSize
static

Definition at line 10481 of file objects.h.

◆ kSignatureOffset

const int v8::internal::FunctionTemplateInfo::kSignatureOffset = kClassNameOffset + kPointerSize
static

Definition at line 10494 of file objects.h.

◆ kSize

const int v8::internal::FunctionTemplateInfo::kSize = kLengthOffset + kPointerSize
static

Definition at line 10500 of file objects.h.

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

◆ kUndetectableBit

const int v8::internal::FunctionTemplateInfo::kUndetectableBit = 1
staticprivate

Definition at line 10509 of file objects.h.


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