V8 Project
v8::internal::JSFunction Class Reference

#include <objects.h>

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

Public Member Functions

Contextcontext ()
 
void set_context (Object *context)
 
JSObjectglobal_proxy ()
 
Codecode ()
 
void set_code (Code *code)
 
void set_code_no_write_barrier (Code *code)
 
void ReplaceCode (Code *code)
 
bool IsBuiltin ()
 
bool IsFromNativeScript ()
 
bool IsFromExtensionScript ()
 
bool NeedsArgumentsAdaption ()
 
bool IsOptimized ()
 
bool IsOptimizable ()
 
void MarkForOptimization ()
 
void MarkForConcurrentOptimization ()
 
void MarkInOptimizationQueue ()
 
bool IsMarkedForOptimization ()
 
bool IsMarkedForConcurrentOptimization ()
 
bool IsInOptimizationQueue ()
 
bool IsInobjectSlackTrackingInProgress ()
 
void StartInobjectSlackTracking ()
 
void CompleteInobjectSlackTracking ()
 
FixedArrayliterals ()
 
void set_literals (FixedArray *literals)
 
FixedArrayfunction_bindings ()
 
void set_function_bindings (FixedArray *bindings)
 
Mapinitial_map ()
 
bool has_initial_map ()
 
bool has_prototype ()
 
bool has_instance_prototype ()
 
Objectprototype ()
 
Objectinstance_prototype ()
 
bool RemovePrototype ()
 
bool should_have_prototype ()
 
void SetInstanceClassName (String *name)
 
bool is_compiled ()
 
void PrintName (FILE *out=stdout)
 
void JSFunctionIterateBody (int object_size, ObjectVisitor *v)
 
int NumberOfLiterals ()
 
bool PassesFilter (const char *raw_filter)
 
- Public Member Functions inherited from v8::internal::JSObject
 DECL_ACCESSORS (properties, FixedArray) inline void initialize_properties()
 
bool HasFastProperties ()
 
NameDictionaryproperty_dictionary ()
 
void initialize_elements ()
 
ElementsKind GetElementsKind ()
 
ElementsAccessorGetElementsAccessor ()
 
bool HasFastSmiElements ()
 
bool HasFastObjectElements ()
 
bool HasFastSmiOrObjectElements ()
 
bool HasFastElements ()
 
bool HasFastDoubleElements ()
 
bool HasFastHoleyElements ()
 
bool HasSloppyArgumentsElements ()
 
bool HasDictionaryElements ()
 
bool HasExternalUint8ClampedElements ()
 
bool HasExternalArrayElements ()
 
bool HasExternalInt8Elements ()
 
bool HasExternalUint8Elements ()
 
bool HasExternalInt16Elements ()
 
bool HasExternalUint16Elements ()
 
bool HasExternalInt32Elements ()
 
bool HasExternalUint32Elements ()
 
bool HasExternalFloat32Elements ()
 
bool HasExternalFloat64Elements ()
 
bool HasFixedTypedArrayElements ()
 
bool HasFixedUint8ClampedElements ()
 
bool HasFixedArrayElements ()
 
bool HasFixedInt8Elements ()
 
bool HasFixedUint8Elements ()
 
bool HasFixedInt16Elements ()
 
bool HasFixedUint16Elements ()
 
bool HasFixedInt32Elements ()
 
bool HasFixedUint32Elements ()
 
bool HasFixedFloat32Elements ()
 
bool HasFixedFloat64Elements ()
 
bool HasFastArgumentsElements ()
 
bool HasDictionaryArgumentsElements ()
 
SeededNumberDictionaryelement_dictionary ()
 
InterceptorInfoGetNamedInterceptor ()
 
InterceptorInfoGetIndexedInterceptor ()
 
bool IsDirty ()
 
ObjectGetHiddenProperty (Handle< Name > key)
 
bool WouldConvertToSlowElements (Handle< Object > key)
 
bool ShouldConvertToSlowElements (int new_capacity)
 
bool ShouldConvertToFastElements ()
 
bool ShouldConvertToFastDoubleElements (bool *has_smi_only_elements)
 
bool HasNamedInterceptor ()
 
bool HasIndexedInterceptor ()
 
int GetHeaderSize ()
 
int GetInternalFieldCount ()
 
int GetInternalFieldOffset (int index)
 
ObjectGetInternalField (int index)
 
void SetInternalField (int index, Object *value)
 
void SetInternalField (int index, Smi *value)
 
int NumberOfOwnProperties (PropertyAttributes filter=NONE)
 
void GetOwnPropertyNames (FixedArray *storage, int index, PropertyAttributes filter=NONE)
 
int NumberOfOwnElements (PropertyAttributes filter)
 
int NumberOfEnumElements ()
 
int GetOwnElementKeys (FixedArray *storage, PropertyAttributes filter)
 
int GetEnumElementKeys (FixedArray *storage)
 
ObjectRawFastPropertyAt (FieldIndex index)
 
void FastPropertyAtPut (FieldIndex index, Object *value)
 
void WriteToField (int descriptor, Object *value)
 
int GetInObjectPropertyOffset (int index)
 
ObjectInObjectPropertyAt (int index)
 
ObjectInObjectPropertyAtPut (int index, Object *value, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
 
void InitializeBody (Map *map, Object *pre_allocated_value, Object *filler_value)
 
bool ReferencesObject (Object *obj)
 
void JSObjectShortPrint (StringStream *accumulator)
 
void PrintInstanceMigration (FILE *file, Map *original_map, Map *new_map)
 
ObjectSlowReverseLookup (Object *value)
 
 STATIC_ASSERT (kHeaderSize==Internals::kJSObjectHeaderSize)
 
ContextGetCreationContext ()
 
- Public Member Functions inherited from v8::internal::JSReceiver
bool IsSimpleEnum ()
 
Stringclass_name ()
 
Stringconstructor_name ()
 
ObjectGetConstructor ()
 
ObjectGetIdentityHash ()
 
- 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 void SetInitialMap (Handle< JSFunction > function, Handle< Map > map, Handle< Object > prototype)
 
static void EnsureHasInitialMap (Handle< JSFunction > function)
 
static void SetPrototype (Handle< JSFunction > function, Handle< Object > value)
 
static void SetInstancePrototype (Handle< JSFunction > function, Handle< Object > value)
 
static Handle< JSFunctionCloneClosure (Handle< JSFunction > function)
 
static ContextNativeContextFromLiterals (FixedArray *literals)
 
- Static Public Member Functions inherited from v8::internal::JSObject
static void ResetElements (Handle< JSObject > object)
 
static void SetMapAndElements (Handle< JSObject > object, Handle< Map > map, Handle< FixedArrayBase > elements)
 
static Handle< FixedArrayEnsureWritableFastElements (Handle< JSObject > object)
 
static Handle< ObjectPrepareElementsForSort (Handle< JSObject > object, uint32_t limit)
 
static Handle< ObjectPrepareSlowElementsForSort (Handle< JSObject > object, uint32_t limit)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetPropertyWithInterceptor (LookupIterator *it, Handle< Object > value)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetOwnPropertyIgnoreAttributes (Handle< JSObject > object, Handle< Name > key, Handle< Object > value, PropertyAttributes attributes, ExecutableAccessorInfoHandling handling=DEFAULT_HANDLING)
 
static void AddProperty (Handle< JSObject > object, Handle< Name > key, Handle< Object > value, PropertyAttributes attributes)
 
static void AllocateStorageForMap (Handle< JSObject > object, Handle< Map > map)
 
static void MigrateInstance (Handle< JSObject > instance)
 
static bool TryMigrateInstance (Handle< JSObject > instance)
 
static void SetNormalizedProperty (Handle< JSObject > object, Handle< Name > key, Handle< Object > value, PropertyDetails details)
 
static void OptimizeAsPrototype (Handle< JSObject > object, PrototypeOptimizationMode mode)
 
static void ReoptimizeIfPrototype (Handle< JSObject > object)
 
static MUST_USE_RESULT Maybe< PropertyAttributesGetPropertyAttributesWithInterceptor (Handle< JSObject > holder, Handle< Object > receiver, Handle< Name > name)
 
static MUST_USE_RESULT Maybe< PropertyAttributesGetPropertyAttributesWithFailedAccessCheck (LookupIterator *it)
 
static MUST_USE_RESULT Maybe< PropertyAttributesGetElementAttributeWithReceiver (Handle< JSObject > object, Handle< JSReceiver > receiver, uint32_t index, bool check_prototype)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetAccessor (Handle< JSObject > object, Handle< Name > name, AccessorComponent component)
 
static MaybeHandle< ObjectDefineAccessor (Handle< JSObject > object, Handle< Name > name, Handle< Object > getter, Handle< Object > setter, PropertyAttributes attributes)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetAccessor (Handle< JSObject > object, Handle< AccessorInfo > info)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetPropertyWithInterceptor (Handle< JSObject > object, Handle< Object > receiver, Handle< Name > name)
 
static Handle< ObjectSetHiddenProperty (Handle< JSObject > object, Handle< Name > key, Handle< Object > value)
 
static void DeleteHiddenProperty (Handle< JSObject > object, Handle< Name > key)
 
static bool HasHiddenProperties (Handle< JSObject > object)
 
static void SetIdentityHash (Handle< JSObject > object, Handle< Smi > hash)
 
static void ValidateElements (Handle< JSObject > object)
 
static void EnsureCanContainHeapObjectElements (Handle< JSObject > obj)
 
static void EnsureCanContainElements (Handle< JSObject > object, Object **elements, uint32_t count, EnsureElementsMode mode)
 
static void EnsureCanContainElements (Handle< JSObject > object, Handle< FixedArrayBase > elements, uint32_t length, EnsureElementsMode mode)
 
static void EnsureCanContainElements (Handle< JSObject > object, Arguments *arguments, uint32_t first_arg, uint32_t arg_count, EnsureElementsMode mode)
 
static int NewElementsCapacity (int old_capacity)
 
static MUST_USE_RESULT MaybeHandle< AccessorPairGetOwnElementAccessorPair (Handle< JSObject > object, uint32_t index)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetFastElement (Handle< JSObject > object, uint32_t index, Handle< Object > value, StrictMode strict_mode, bool check_prototype)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetOwnElement (Handle< JSObject > object, uint32_t index, Handle< Object > value, StrictMode strict_mode)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetElement (Handle< JSObject > object, uint32_t index, Handle< Object > value, PropertyAttributes attributes, StrictMode strict_mode, bool check_prototype=true, SetPropertyMode set_mode=SET_PROPERTY)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetElementWithInterceptor (Handle< JSObject > object, Handle< Object > receiver, uint32_t index)
 
static Handle< FixedArraySetFastElementsCapacityAndLength (Handle< JSObject > object, int capacity, int length, SetFastElementsCapacitySmiMode smi_mode)
 
static void SetFastDoubleElementsCapacityAndLength (Handle< JSObject > object, int capacity, int length)
 
static MUST_USE_RESULT MaybeHandle< JSObjectGetKeysForNamedInterceptor (Handle< JSObject > object, Handle< JSReceiver > receiver)
 
static MUST_USE_RESULT MaybeHandle< JSObjectGetKeysForIndexedInterceptor (Handle< JSObject > object, Handle< JSReceiver > receiver)
 
static MUST_USE_RESULT Maybe< boolHasRealNamedProperty (Handle< JSObject > object, Handle< Name > key)
 
static MUST_USE_RESULT Maybe< boolHasRealElementProperty (Handle< JSObject > object, uint32_t index)
 
static MUST_USE_RESULT Maybe< boolHasRealNamedCallbackProperty (Handle< JSObject > object, Handle< Name > key)
 
static Handle< MapGetElementsTransitionMap (Handle< JSObject > object, ElementsKind to_kind)
 
static void TransitionElementsKind (Handle< JSObject > object, ElementsKind to_kind)
 
static void MigrateToMap (Handle< JSObject > object, Handle< Map > new_map)
 
static void NormalizeProperties (Handle< JSObject > object, PropertyNormalizationMode mode, int expected_additional_properties)
 
static Handle< SeededNumberDictionaryNormalizeElements (Handle< JSObject > object)
 
static void MigrateSlowToFast (Handle< JSObject > object, int unused_property_fields)
 
static Handle< ObjectFastPropertyAt (Handle< JSObject > object, Representation representation, FieldIndex index)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetPrototype (Handle< JSObject > object, Handle< Object > value, bool from_javascript)
 
static MUST_USE_RESULT MaybeHandle< ObjectPreventExtensions (Handle< JSObject > object)
 
static MUST_USE_RESULT MaybeHandle< ObjectFreeze (Handle< JSObject > object)
 
static void SetObserved (Handle< JSObject > object)
 
static Handle< JSObjectCopy (Handle< JSObject > object)
 
static MUST_USE_RESULT MaybeHandle< JSObjectDeepCopy (Handle< JSObject > object, AllocationSiteUsageContext *site_context, DeepCopyHints hints=kNoHints)
 
static MUST_USE_RESULT MaybeHandle< JSObjectDeepWalk (Handle< JSObject > object, AllocationSiteCreationContext *site_context)
 
static Handle< ObjectGetDataProperty (Handle< JSObject > object, Handle< Name > key)
 
static Handle< ObjectGetDataProperty (LookupIterator *it)
 
static void PrintElementsTransition (FILE *file, Handle< JSObject > object, ElementsKind from_kind, Handle< FixedArrayBase > from_elements, ElementsKind to_kind, Handle< FixedArrayBase > to_elements)
 
static void EnqueueChangeRecord (Handle< JSObject > object, const char *type, Handle< Name > name, Handle< Object > old_value)
 
static void MigrateToNewProperty (Handle< JSObject > object, Handle< Map > transition, Handle< Object > value)
 
- Static Public Member Functions inherited from v8::internal::JSReceiver
static MUST_USE_RESULT MaybeHandle< ObjectSetElement (Handle< JSReceiver > object, uint32_t index, Handle< Object > value, PropertyAttributes attributes, StrictMode strict_mode)
 
static MUST_USE_RESULT Maybe< boolHasProperty (Handle< JSReceiver > object, Handle< Name > name)
 
static MUST_USE_RESULT Maybe< boolHasOwnProperty (Handle< JSReceiver >, Handle< Name > name)
 
static MUST_USE_RESULT Maybe< boolHasElement (Handle< JSReceiver > object, uint32_t index)
 
static MUST_USE_RESULT Maybe< boolHasOwnElement (Handle< JSReceiver > object, uint32_t index)
 
static MUST_USE_RESULT MaybeHandle< ObjectDeleteProperty (Handle< JSReceiver > object, Handle< Name > name, DeleteMode mode=NORMAL_DELETION)
 
static MUST_USE_RESULT MaybeHandle< ObjectDeleteElement (Handle< JSReceiver > object, uint32_t index, DeleteMode mode=NORMAL_DELETION)
 
static MUST_USE_RESULT Maybe< PropertyAttributesGetPropertyAttributes (Handle< JSReceiver > object, Handle< Name > name)
 
static MUST_USE_RESULT Maybe< PropertyAttributesGetPropertyAttributes (LookupIterator *it)
 
static MUST_USE_RESULT Maybe< PropertyAttributesGetOwnPropertyAttributes (Handle< JSReceiver > object, Handle< Name > name)
 
static MUST_USE_RESULT Maybe< PropertyAttributesGetElementAttribute (Handle< JSReceiver > object, uint32_t index)
 
static MUST_USE_RESULT Maybe< PropertyAttributesGetOwnElementAttribute (Handle< JSReceiver > object, uint32_t index)
 
static Handle< SmiGetOrCreateIdentityHash (Handle< JSReceiver > object)
 
static MUST_USE_RESULT MaybeHandle< FixedArrayGetKeys (Handle< JSReceiver > object, KeyCollectionType type)
 
- 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)
 

Static Public Attributes

static const int kGenerousAllocationCount = Map::ConstructionCount::kMax
 
static const int kFinishSlackTracking = 1
 
static const int kNoSlackTracking = 0
 
static const int kCodeEntryOffset = JSObject::kHeaderSize
 
static const int kPrototypeOrInitialMapOffset
 
static const int kSharedFunctionInfoOffset
 
static const int kContextOffset = kSharedFunctionInfoOffset + kPointerSize
 
static const int kLiteralsOffset = kContextOffset + kPointerSize
 
static const int kNonWeakFieldsEndOffset = kLiteralsOffset + kPointerSize
 
static const int kNextFunctionLinkOffset = kNonWeakFieldsEndOffset
 
static const int kSize = kNextFunctionLinkOffset + kPointerSize
 
static const int kLiteralsPrefixSize = 1
 
static const int kLiteralNativeContextIndex = 0
 
static const int kBoundFunctionIndex = 0
 
static const int kBoundThisIndex = 1
 
static const int kBoundArgumentsStartIndex = 2
 
- Static Public Attributes inherited from v8::internal::JSObject
static const uint32_t kMaxElementCount = 0xffffffffu
 
static const uint32_t kMaxGap = 1024
 
static const int kMaxUncheckedFastElementsLength = 5000
 
static const int kMaxUncheckedOldFastElementsLength = 500
 
static const int kInitialMaxFastElementArray = 100000
 
static const int kInitialGlobalObjectUnusedPropertiesCount = 4
 
static const int kMaxInstanceSize = 255 * kPointerSize
 
static const int kFieldsAdded = 3
 
static const int kPropertiesOffset = HeapObject::kHeaderSize
 
static const int kElementsOffset = kPropertiesOffset + kPointerSize
 
static const int kHeaderSize = kElementsOffset + 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 (JSFunction)
 

Additional Inherited Members

- Public Types inherited from v8::internal::JSObject
enum  ExecutableAccessorInfoHandling { DEFAULT_HANDLING , DONT_FORCE_FIELD }
 
enum  SetFastElementsCapacitySmiMode { kAllowSmiElements , kForceSmiElements , kDontAllowSmiElements }
 
enum  DeepCopyHints { kNoHints = 0 , kObjectIsShallow = 1 }
 
- Public Types inherited from v8::internal::JSReceiver
enum  DeleteMode { NORMAL_DELETION , STRICT_DELETION , FORCE_DELETION }
 
enum  KeyCollectionType { OWN_ONLY , INCLUDE_PROTOS }
 
- 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 }
 
- 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 7177 of file objects.h.

Member Function Documentation

◆ CloneClosure()

Handle< JSFunction > v8::internal::JSFunction::CloneClosure ( Handle< JSFunction function)
static

Definition at line 9160 of file objects.cc.

9160  {
9161  Isolate* isolate = function->GetIsolate();
9162  Handle<Map> map(function->map());
9163  Handle<SharedFunctionInfo> shared(function->shared());
9164  Handle<Context> context(function->context());
9165  Handle<JSFunction> clone =
9166  isolate->factory()->NewFunctionFromSharedFunctionInfo(shared, context);
9167 
9168  if (shared->bound()) {
9169  clone->set_function_bindings(function->function_bindings());
9170  }
9171 
9172  // In typical case, __proto__ of ``function`` is the default Function
9173  // prototype, which means that SetPrototype below is a no-op.
9174  // In rare cases when that is not true, we mutate the clone's __proto__.
9175  Handle<Object> original_prototype(map->prototype(), isolate);
9176  if (*original_prototype != clone->map()->prototype()) {
9177  JSObject::SetPrototype(clone, original_prototype, false).Assert();
9178  }
9179 
9180  return clone;
9181 }
static MUST_USE_RESULT MaybeHandle< Object > SetPrototype(Handle< JSObject > object, Handle< Object > value, bool from_javascript)
Definition: objects.cc:11658

References context(), v8::internal::Isolate::factory(), v8::internal::HeapObject::map(), and v8::internal::JSObject::SetPrototype().

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

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

◆ code()

Code * v8::internal::JSFunction::code ( )
inline

Definition at line 5838 of file objects-inl.h.

5838  {
5839  return Code::cast(
5841 }
static Object * GetObjectFromEntryAddress(Address location_of_address)
Definition: objects-inl.h:5029
static const int kCodeEntryOffset
Definition: objects.h:7376
#define FIELD_ADDR(p, offset)
Definition: objects-inl.h:1173

References FIELD_ADDR, v8::internal::Code::GetObjectFromEntryAddress(), and kCodeEntryOffset.

Referenced by v8::internal::OptimizedFrame::GetDeoptimizationData(), is_compiled(), IsInOptimizationQueue(), IsMarkedForConcurrentOptimization(), IsMarkedForOptimization(), IsOptimizable(), IsOptimized(), MarkForConcurrentOptimization(), MarkForOptimization(), v8::internal::StaticMarkingVisitor< StaticVisitor >::MarkInlinedFunctionsCode(), MarkInOptimizationQueue(), v8::internal::Debug::PrepareForBreakPoints(), and ReplaceCode().

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

◆ CompleteInobjectSlackTracking()

void v8::internal::JSFunction::CompleteInobjectSlackTracking ( )

Definition at line 9982 of file objects.cc.

9982  {
9984  Map* map = initial_map();
9985 
9988 
9989  int slack = map->unused_property_fields();
9991  if (slack != 0) {
9992  // Resize the initial map and all maps in its transition tree.
9994  }
9995 }
static const int kNoSlackTracking
Definition: objects.h:7263
int unused_property_fields()
Definition: objects-inl.h:4333
void set_construction_count(int value)
Definition: objects-inl.h:4490
bool done_inobject_slack_tracking()
Definition: objects-inl.h:4485
void TraverseTransitionTree(TraverseCallback callback, void *data)
Definition: objects.cc:7257
#define DCHECK(condition)
Definition: logging.h:205
static void ShrinkInstanceSize(Map *map, void *data)
Definition: objects.cc:9971
static void GetMinInobjectSlack(Map *map, void *data)
Definition: objects.cc:9963

References DCHECK, v8::internal::Map::done_inobject_slack_tracking(), v8::internal::GetMinInobjectSlack(), has_initial_map(), initial_map(), kNoSlackTracking, v8::internal::HeapObject::map(), v8::internal::Map::set_construction_count(), v8::internal::ShrinkInstanceSize(), v8::internal::Map::TraverseTransitionTree(), and v8::internal::Map::unused_property_fields().

+ Here is the call graph for this function:

◆ context()

Context * v8::internal::JSFunction::context ( )
inline

Definition at line 5885 of file objects-inl.h.

5885  {
5886  return Context::cast(READ_FIELD(this, kContextOffset));
5887 }
static Context * cast(Object *context)
Definition: contexts.h:255
static const int kContextOffset
Definition: objects.h:7381
#define READ_FIELD(p, offset)
Definition: objects-inl.h:1179

References v8::internal::Context::cast(), kContextOffset, and READ_FIELD.

Referenced by CloneClosure(), v8::internal::V8HeapExplorer::ExtractJSObjectReferences(), v8::internal::Deoptimizer::FindDeoptimizingCode(), global_proxy(), IsBuiltin(), v8::internal::Context::native_context(), v8::internal::JSObject::ReferencesObject(), RemovePrototype(), and ReplaceCode().

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

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::JSFunction::DISALLOW_IMPLICIT_CONSTRUCTORS ( JSFunction  )
private

◆ EnsureHasInitialMap()

void v8::internal::JSFunction::EnsureHasInitialMap ( Handle< JSFunction function)
static

Definition at line 9503 of file objects.cc.

9503  {
9504  if (function->has_initial_map()) return;
9505  Isolate* isolate = function->GetIsolate();
9506 
9507  // First create a new map with the size and number of in-object properties
9508  // suggested by the function.
9509  InstanceType instance_type;
9510  int instance_size;
9511  int in_object_properties;
9512  if (function->shared()->is_generator()) {
9513  instance_type = JS_GENERATOR_OBJECT_TYPE;
9514  instance_size = JSGeneratorObject::kSize;
9515  in_object_properties = 0;
9516  } else {
9517  instance_type = JS_OBJECT_TYPE;
9518  instance_size = function->shared()->CalculateInstanceSize();
9519  in_object_properties = function->shared()->CalculateInObjectProperties();
9520  }
9521  Handle<Map> map = isolate->factory()->NewMap(instance_type, instance_size);
9522 
9523  // Fetch or allocate prototype.
9524  Handle<Object> prototype;
9525  if (function->has_instance_prototype()) {
9526  prototype = handle(function->instance_prototype(), isolate);
9527  } else {
9528  prototype = isolate->factory()->NewFunctionPrototype(function);
9529  }
9530  map->set_inobject_properties(in_object_properties);
9531  map->set_unused_property_fields(in_object_properties);
9533 
9534  // Finally link initial map and constructor function.
9536 
9537  if (!function->shared()->is_generator()) {
9538  function->StartInobjectSlackTracking();
9539  }
9540 }
static Handle< T > cast(Handle< S > that)
Definition: handles.h:116
static void SetInitialMap(Handle< JSFunction > function, Handle< Map > map, Handle< Object > prototype)
Definition: objects.cc:9491
void set_unused_property_fields(int value)
Definition: objects-inl.h:4338
bool has_fast_object_elements()
Definition: objects.h:5740
void set_inobject_properties(int value)
Definition: objects-inl.h:4309
@ JS_OBJECT_TYPE
Definition: objects.h:731
@ JS_GENERATOR_OBJECT_TYPE
Definition: objects.h:733
Handle< T > handle(T *t, Isolate *isolate)
Definition: handles.h:146

References DCHECK, v8::internal::Isolate::factory(), v8::internal::handle(), v8::internal::Map::has_fast_object_elements(), v8::internal::JS_GENERATOR_OBJECT_TYPE, v8::internal::JS_OBJECT_TYPE, v8::internal::JSGeneratorObject::kSize, v8::internal::HeapObject::map(), prototype(), v8::internal::Map::set_inobject_properties(), v8::internal::Map::set_unused_property_fields(), and SetInitialMap().

+ Here is the call graph for this function:

◆ function_bindings()

FixedArray * v8::internal::JSFunction::function_bindings ( )
inline

Definition at line 5965 of file objects-inl.h.

5965  {
5966  DCHECK(shared()->bound());
5967  return literals_or_bindings();
5968 }

References DCHECK.

Referenced by v8::internal::V8HeapExplorer::ExtractClosureReferences().

+ Here is the caller graph for this function:

◆ global_proxy()

JSObject * v8::internal::JSFunction::global_proxy ( )
inline

Definition at line 5890 of file objects-inl.h.

5890  {
5891  return context()->global_proxy();
5892 }
JSObject * global_proxy()
Definition: contexts.cc:64

References context(), and v8::internal::Context::global_proxy().

+ Here is the call graph for this function:

◆ has_initial_map()

bool v8::internal::JSFunction::has_initial_map ( )
inline

Definition at line 5910 of file objects-inl.h.

5910  {
5911  return prototype_or_initial_map()->IsMap();
5912 }

Referenced by v8::internal::Heap::AllocateJSObject(), CompleteInobjectSlackTracking(), has_instance_prototype(), instance_prototype(), IsInobjectSlackTrackingInProgress(), and StartInobjectSlackTracking().

+ Here is the caller graph for this function:

◆ has_instance_prototype()

bool v8::internal::JSFunction::has_instance_prototype ( )
inline

Definition at line 5915 of file objects-inl.h.

5915  {
5916  return has_initial_map() || !prototype_or_initial_map()->IsTheHole();
5917 }

References has_initial_map().

Referenced by has_prototype(), and instance_prototype().

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

◆ has_prototype()

bool v8::internal::JSFunction::has_prototype ( )
inline

Definition at line 5920 of file objects-inl.h.

5920  {
5922 }
bool has_non_instance_prototype()
Definition: objects-inl.h:4372

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

Referenced by prototype().

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

◆ initial_map()

Map* v8::internal::JSFunction::initial_map ( )
inline

◆ instance_prototype()

Object * v8::internal::JSFunction::instance_prototype ( )
inline

Definition at line 5925 of file objects-inl.h.

5925  {
5927  if (has_initial_map()) return initial_map()->prototype();
5928  // When there is no initial map and the prototype is a JSObject, the
5929  // initial map field is used for the prototype field.
5930  return prototype_or_initial_map();
5931 }

References DCHECK, has_initial_map(), has_instance_prototype(), and initial_map().

Referenced by v8::internal::IC::GetHandlerCacheHolder(), and prototype().

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

◆ is_compiled()

bool v8::internal::JSFunction::is_compiled ( )
inline

Definition at line 5948 of file objects-inl.h.

5948  {
5949  return code() != GetIsolate()->builtins()->builtin(Builtins::kCompileLazy);
5950 }
Code * builtin(Name name)
Definition: builtins.h:254
Isolate * GetIsolate() const
Definition: objects-inl.h:1387
Builtins * builtins()
Definition: isolate.h:947

References v8::internal::Builtins::builtin(), v8::internal::Isolate::builtins(), code(), and v8::internal::HeapObject::GetIsolate().

Referenced by MarkForConcurrentOptimization(), and v8::internal::RUNTIME_FUNCTION().

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

◆ IsBuiltin()

bool v8::internal::JSFunction::IsBuiltin ( )
inline

Definition at line 5777 of file objects-inl.h.

5777  {
5778  return context()->global_object()->IsJSBuiltinsObject();
5779 }
GlobalObject * global_object()
Definition: contexts.h:437

References context(), and v8::internal::Context::global_object().

Referenced by v8::internal::FindCaller(), IsFromNativeScript(), and v8::internal::IsVisibleInStackTrace().

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

◆ IsFromExtensionScript()

bool v8::internal::JSFunction::IsFromExtensionScript ( )
inline

Definition at line 5791 of file objects-inl.h.

5791  {
5792  Object* script = shared()->script();
5793  return script->IsScript() &&
5794  Script::cast(script)->type()->value() == Script::TYPE_EXTENSION;
5795 }
friend class Object
Definition: objects.h:2219

References v8::internal::Script::TYPE_EXTENSION.

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

+ Here is the caller graph for this function:

◆ IsFromNativeScript()

bool v8::internal::JSFunction::IsFromNativeScript ( )
inline

Definition at line 5782 of file objects-inl.h.

5782  {
5783  Object* script = shared()->script();
5784  bool native = script->IsScript() &&
5785  Script::cast(script)->type()->value() == Script::TYPE_NATIVE;
5786  DCHECK(!IsBuiltin() || native); // All builtins are also native.
5787  return native;
5788 }

References DCHECK, IsBuiltin(), and v8::internal::Script::TYPE_NATIVE.

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

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

◆ IsInobjectSlackTrackingInProgress()

bool v8::internal::JSFunction::IsInobjectSlackTrackingInProgress ( )
inline

Definition at line 5832 of file objects-inl.h.

5832  {
5833  return has_initial_map() &&
5835 }

References v8::internal::Map::construction_count(), has_initial_map(), initial_map(), and kNoSlackTracking.

Referenced by StartInobjectSlackTracking().

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

◆ IsInOptimizationQueue()

bool v8::internal::JSFunction::IsInOptimizationQueue ( )
inline

Definition at line 5826 of file objects-inl.h.

5826  {
5827  return code() == GetIsolate()->builtins()->builtin(
5828  Builtins::kInOptimizationQueue);
5829 }

References v8::internal::Builtins::builtin(), v8::internal::Isolate::builtins(), code(), and v8::internal::HeapObject::GetIsolate().

+ Here is the call graph for this function:

◆ IsMarkedForConcurrentOptimization()

bool v8::internal::JSFunction::IsMarkedForConcurrentOptimization ( )
inline

Definition at line 5820 of file objects-inl.h.

5820  {
5821  return code() == GetIsolate()->builtins()->builtin(
5822  Builtins::kCompileOptimizedConcurrent);
5823 }

References v8::internal::Builtins::builtin(), v8::internal::Isolate::builtins(), code(), and v8::internal::HeapObject::GetIsolate().

Referenced by MarkInOptimizationQueue().

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

◆ IsMarkedForOptimization()

bool v8::internal::JSFunction::IsMarkedForOptimization ( )
inline

Definition at line 5814 of file objects-inl.h.

5814  {
5815  return code() == GetIsolate()->builtins()->builtin(
5816  Builtins::kCompileOptimized);
5817 }

References v8::internal::Builtins::builtin(), v8::internal::Isolate::builtins(), code(), and v8::internal::HeapObject::GetIsolate().

+ Here is the call graph for this function:

◆ IsOptimizable()

bool v8::internal::JSFunction::IsOptimizable ( )
inline

Definition at line 5809 of file objects-inl.h.

5809  {
5810  return code()->kind() == Code::FUNCTION && code()->optimizable();
5811 }

References code(), v8::internal::Code::kind(), and v8::internal::Code::optimizable().

+ Here is the call graph for this function:

◆ IsOptimized()

bool v8::internal::JSFunction::IsOptimized ( )
inline

Definition at line 5804 of file objects-inl.h.

5804  {
5805  return code()->kind() == Code::OPTIMIZED_FUNCTION;
5806 }

References code(), and v8::internal::Code::kind().

Referenced by MarkForConcurrentOptimization(), MarkForOptimization(), MarkInOptimizationQueue(), v8::internal::JavaScriptFrame::PrintFunctionAndOffset(), and ReplaceCode().

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

◆ JSFunctionIterateBody()

void v8::internal::JSFunction::JSFunctionIterateBody ( int  object_size,
ObjectVisitor v 
)

Definition at line 9105 of file objects.cc.

9105  {
9106  // Iterate over all fields in the body but take care in dealing with
9107  // the code entry.
9109  v->VisitCodeEntry(this->address() + kCodeEntryOffset);
9110  IteratePointers(v, kCodeEntryOffset + kPointerSize, object_size);
9111 }
void IteratePointers(ObjectVisitor *v, int start, int end)
Definition: objects-inl.h:1499
static const int kPropertiesOffset
Definition: objects.h:2193
const int kPointerSize
Definition: globals.h:129

References v8::internal::HeapObject::address(), v8::internal::HeapObject::IteratePointers(), kCodeEntryOffset, v8::internal::kPointerSize, and v8::internal::JSObject::kPropertiesOffset.

+ Here is the call graph for this function:

◆ literals()

FixedArray * v8::internal::JSFunction::literals ( )
inline

Definition at line 5953 of file objects-inl.h.

5953  {
5954  DCHECK(!shared()->bound());
5955  return literals_or_bindings();
5956 }

References DCHECK.

Referenced by NativeContextFromLiterals(), NumberOfLiterals(), set_literals(), and v8::internal::LiteralFixer::ClearValuesVisitor::visit().

+ Here is the caller graph for this function:

◆ MarkForConcurrentOptimization()

void v8::internal::JSFunction::MarkForConcurrentOptimization ( )

Definition at line 9125 of file objects.cc.

9125  {
9126  DCHECK(is_compiled() || GetIsolate()->DebuggerHasBreakPoints());
9127  DCHECK(!IsOptimized());
9128  DCHECK(shared()->allows_lazy_compilation() || code()->optimizable());
9129  DCHECK(!shared()->is_generator());
9130  DCHECK(GetIsolate()->concurrent_recompilation_enabled());
9131  if (FLAG_trace_concurrent_recompilation) {
9132  PrintF(" ** Marking ");
9133  ShortPrint();
9134  PrintF(" for concurrent recompilation.\n");
9135  }
9137  GetIsolate()->builtins()->builtin(Builtins::kCompileOptimizedConcurrent));
9138  // No write barrier required, since the builtin is part of the root set.
9139 }
void set_code_no_write_barrier(Code *code)
Definition: objects-inl.h:5855
void ShortPrint(FILE *out=stdout)
Definition: objects.cc:905
void PrintF(const char *format,...)
Definition: utils.cc:80

References code(), DCHECK, v8::internal::HeapObject::GetIsolate(), is_compiled(), IsOptimized(), v8::internal::PrintF(), set_code_no_write_barrier(), and v8::internal::Object::ShortPrint().

+ Here is the call graph for this function:

◆ MarkForOptimization()

void v8::internal::JSFunction::MarkForOptimization ( )

Definition at line 9114 of file objects.cc.

9114  {
9115  DCHECK(!IsOptimized());
9116  DCHECK(shared()->allows_lazy_compilation() ||
9117  code()->optimizable());
9118  DCHECK(!shared()->is_generator());
9120  GetIsolate()->builtins()->builtin(Builtins::kCompileOptimized));
9121  // No write barrier required, since the builtin is part of the root set.
9122 }

References code(), DCHECK, v8::internal::HeapObject::GetIsolate(), IsOptimized(), and set_code_no_write_barrier().

+ Here is the call graph for this function:

◆ MarkInOptimizationQueue()

void v8::internal::JSFunction::MarkInOptimizationQueue ( )

Definition at line 9142 of file objects.cc.

9142  {
9143  // We can only arrive here via the concurrent-recompilation builtin. If
9144  // break points were set, the code would point to the lazy-compile builtin.
9145  DCHECK(!GetIsolate()->DebuggerHasBreakPoints());
9147  DCHECK(shared()->allows_lazy_compilation() || code()->optimizable());
9148  DCHECK(GetIsolate()->concurrent_recompilation_enabled());
9149  if (FLAG_trace_concurrent_recompilation) {
9150  PrintF(" ** Queueing ");
9151  ShortPrint();
9152  PrintF(" for concurrent recompilation.\n");
9153  }
9155  GetIsolate()->builtins()->builtin(Builtins::kInOptimizationQueue));
9156  // No write barrier required, since the builtin is part of the root set.
9157 }
bool IsMarkedForConcurrentOptimization()
Definition: objects-inl.h:5820

References code(), DCHECK, v8::internal::HeapObject::GetIsolate(), IsMarkedForConcurrentOptimization(), IsOptimized(), v8::internal::PrintF(), set_code_no_write_barrier(), and v8::internal::Object::ShortPrint().

+ Here is the call graph for this function:

◆ NativeContextFromLiterals()

Context * v8::internal::JSFunction::NativeContextFromLiterals ( FixedArray literals)
static

Definition at line 9554 of file objects.cc.

9554  {
9556 }
Object * get(int index)
Definition: objects-inl.h:2165
static const int kLiteralNativeContextIndex
Definition: objects.h:7389
FixedArray * literals()
Definition: objects-inl.h:5953

References v8::internal::Context::cast(), v8::internal::FixedArray::get(), kLiteralNativeContextIndex, and literals().

Referenced by v8::internal::Runtime::CreateArrayLiteralBoilerplate(), v8::internal::CreateObjectLiteralBoilerplate(), v8::internal::LiteralFixer::PatchLiterals(), and v8::internal::RUNTIME_FUNCTION().

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

◆ NeedsArgumentsAdaption()

bool v8::internal::JSFunction::NeedsArgumentsAdaption ( )
inline

Definition at line 5798 of file objects-inl.h.

5798  {
5799  return shared()->formal_parameter_count() !=
5801 }
static const int kDontAdaptArgumentsSentinel
Definition: objects.h:6888

References v8::internal::SharedFunctionInfo::kDontAdaptArgumentsSentinel.

◆ NumberOfLiterals()

int v8::internal::JSFunction::NumberOfLiterals ( )
inline

Definition at line 5981 of file objects-inl.h.

5981  {
5982  DCHECK(!shared()->bound());
5983  return literals()->length();
5984 }

References DCHECK, v8::internal::FixedArrayBase::length(), and literals().

+ Here is the call graph for this function:

◆ PassesFilter()

bool v8::internal::JSFunction::PassesFilter ( const char *  raw_filter)

Definition at line 9567 of file objects.cc.

9567  {
9568  if (*raw_filter == '*') return true;
9569  String* name = shared()->DebugName();
9570  Vector<const char> filter = CStrVector(raw_filter);
9571  if (filter.length() == 0) return name->length() == 0;
9572  if (filter[0] == '-') {
9573  // Negative filter.
9574  if (filter.length() == 1) {
9575  return (name->length() != 0);
9576  } else if (name->IsUtf8EqualTo(filter.SubVector(1, filter.length()))) {
9577  return false;
9578  }
9579  if (filter[filter.length() - 1] == '*' &&
9580  name->IsUtf8EqualTo(filter.SubVector(1, filter.length() - 1), true)) {
9581  return false;
9582  }
9583  return true;
9584 
9585  } else if (name->IsUtf8EqualTo(filter)) {
9586  return true;
9587  }
9588  if (filter[filter.length() - 1] == '*' &&
9589  name->IsUtf8EqualTo(filter.SubVector(0, filter.length() - 1), true)) {
9590  return true;
9591  }
9592  return false;
9593 }
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in name
Vector< const char > CStrVector(const char *data)
Definition: vector.h:158

References v8::internal::CStrVector(), v8::internal::Vector< T >::length(), name, and v8::internal::Vector< T >::SubVector().

+ Here is the call graph for this function:

◆ PrintName()

void v8::internal::JSFunction::PrintName ( FILE *  out = stdout)

Definition at line 9548 of file objects.cc.

9548  {
9549  SmartArrayPointer<char> name = shared()->DebugName()->ToCString();
9550  PrintF(out, "%s", name.get());
9551 }

References name, and v8::internal::PrintF().

Referenced by v8::internal::Deoptimizer::PrintFunctionName().

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

◆ prototype()

Object * v8::internal::JSFunction::prototype ( )
inline

Definition at line 5934 of file objects-inl.h.

5934  {
5935  DCHECK(has_prototype());
5936  // If the function's prototype property has been set to a non-JSObject
5937  // value, that value is stored in the constructor field of the map.
5938  if (map()->has_non_instance_prototype()) return map()->constructor();
5939  return instance_prototype();
5940 }

References DCHECK, has_prototype(), instance_prototype(), and v8::internal::HeapObject::map().

Referenced by EnsureHasInitialMap(), v8::internal::V8HeapExplorer::ExtractJSObjectReferences(), and SetInitialMap().

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

◆ RemovePrototype()

bool v8::internal::JSFunction::RemovePrototype ( )

Definition at line 9469 of file objects.cc.

9469  {
9470  Context* native_context = context()->native_context();
9471  Map* no_prototype_map = shared()->strict_mode() == SLOPPY
9472  ? native_context->sloppy_function_without_prototype_map()
9473  : native_context->strict_function_without_prototype_map();
9474 
9475  if (map() == no_prototype_map) return true;
9476 
9477 #ifdef DEBUG
9478  if (map() != (shared()->strict_mode() == SLOPPY
9479  ? native_context->sloppy_function_map()
9480  : native_context->strict_function_map())) {
9481  return false;
9482  }
9483 #endif
9484 
9485  set_map(no_prototype_map);
9486  set_prototype_or_initial_map(no_prototype_map->GetHeap()->the_hole_value());
9487  return true;
9488 }
Context * native_context()
Definition: contexts.cc:44
void set_map(Map *value)
Definition: objects-inl.h:1404

References context(), v8::internal::HeapObject::GetHeap(), v8::internal::HeapObject::map(), v8::internal::Context::native_context(), v8::internal::HeapObject::set_map(), and v8::internal::SLOPPY.

+ Here is the call graph for this function:

◆ ReplaceCode()

void v8::internal::JSFunction::ReplaceCode ( Code code)
inline

Definition at line 5862 of file objects-inl.h.

5862  {
5863  bool was_optimized = IsOptimized();
5864  bool is_optimized = code->kind() == Code::OPTIMIZED_FUNCTION;
5865 
5866  if (was_optimized && is_optimized) {
5867  shared()->EvictFromOptimizedCodeMap(this->code(),
5868  "Replacing with another optimized code");
5869  }
5870 
5871  set_code(code);
5872 
5873  // Add/remove the function from the list of optimized functions for this
5874  // context based on the state change.
5875  if (!was_optimized && is_optimized) {
5877  }
5878  if (was_optimized && !is_optimized) {
5879  // TODO(titzer): linear in the number of optimized functions; fix!
5881  }
5882 }
void AddOptimizedFunction(JSFunction *function)
Definition: contexts.cc:280
void RemoveOptimizedFunction(JSFunction *function)
Definition: contexts.cc:318
void set_code(Code *code)
Definition: objects-inl.h:5844

References v8::internal::Context::AddOptimizedFunction(), code(), context(), IsOptimized(), v8::internal::Code::kind(), v8::internal::Context::native_context(), v8::internal::Context::RemoveOptimizedFunction(), and set_code().

+ Here is the call graph for this function:

◆ set_code()

void v8::internal::JSFunction::set_code ( Code code)
inline

Definition at line 5844 of file objects-inl.h.

5844  {
5845  DCHECK(!GetHeap()->InNewSpace(value));
5846  Address entry = value->entry();
5847  WRITE_INTPTR_FIELD(this, kCodeEntryOffset, reinterpret_cast<intptr_t>(entry));
5848  GetHeap()->incremental_marking()->RecordWriteOfCodeEntry(
5849  this,
5851  value);
5852 }
Heap * GetHeap() const
Definition: objects-inl.h:1379
static Object ** RawField(HeapObject *obj, int offset)
Definition: objects-inl.h:1311
IncrementalMarking * incremental_marking()
Definition: heap.h:1205
byte * Address
Definition: globals.h:101
#define WRITE_INTPTR_FIELD(p, offset, value)
Definition: objects-inl.h:1269

References DCHECK, v8::internal::Code::entry(), v8::internal::HeapObject::GetHeap(), v8::internal::Heap::incremental_marking(), kCodeEntryOffset, v8::internal::HeapObject::RawField(), and WRITE_INTPTR_FIELD.

Referenced by v8::internal::CodeFlusher::ProcessJSFunctionCandidates(), and ReplaceCode().

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

◆ set_code_no_write_barrier()

void v8::internal::JSFunction::set_code_no_write_barrier ( Code code)
inline

Definition at line 5855 of file objects-inl.h.

5855  {
5856  DCHECK(!GetHeap()->InNewSpace(value));
5857  Address entry = value->entry();
5858  WRITE_INTPTR_FIELD(this, kCodeEntryOffset, reinterpret_cast<intptr_t>(entry));
5859 }

References DCHECK, v8::internal::Code::entry(), v8::internal::HeapObject::GetHeap(), kCodeEntryOffset, and WRITE_INTPTR_FIELD.

Referenced by MarkForConcurrentOptimization(), MarkForOptimization(), and MarkInOptimizationQueue().

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

◆ set_context()

void v8::internal::JSFunction::set_context ( Object context)
inline

Definition at line 5895 of file objects-inl.h.

5895  {
5896  DCHECK(value->IsUndefined() || value->IsContext());
5897  WRITE_FIELD(this, kContextOffset, value);
5898  WRITE_BARRIER(GetHeap(), this, kContextOffset, value);
5899 }
#define WRITE_FIELD(p, offset, value)
Definition: objects-inl.h:1190
#define WRITE_BARRIER(heap, object, offset, value)
Definition: objects-inl.h:1203

References DCHECK, v8::internal::HeapObject::GetHeap(), kContextOffset, WRITE_BARRIER, and WRITE_FIELD.

+ Here is the call graph for this function:

◆ set_function_bindings()

void v8::internal::JSFunction::set_function_bindings ( FixedArray bindings)
inline

Definition at line 5971 of file objects-inl.h.

5971  {
5972  DCHECK(shared()->bound());
5973  // Bound function literal may be initialized to the empty fixed array
5974  // before the bindings are set.
5975  DCHECK(bindings == GetHeap()->empty_fixed_array() ||
5976  bindings->map() == GetHeap()->fixed_cow_array_map());
5977  set_literals_or_bindings(bindings);
5978 }

References DCHECK, v8::internal::HeapObject::GetHeap(), and v8::internal::HeapObject::map().

+ Here is the call graph for this function:

◆ set_literals()

void v8::internal::JSFunction::set_literals ( FixedArray literals)
inline

Definition at line 5959 of file objects-inl.h.

5959  {
5960  DCHECK(!shared()->bound());
5961  set_literals_or_bindings(literals);
5962 }

References DCHECK, and literals().

+ Here is the call graph for this function:

◆ SetInitialMap()

void v8::internal::JSFunction::SetInitialMap ( Handle< JSFunction function,
Handle< Map map,
Handle< Object prototype 
)
static

Definition at line 9491 of file objects.cc.

9492  {
9493  if (prototype->IsJSObject()) {
9494  Handle<JSObject> js_proto = Handle<JSObject>::cast(prototype);
9496  }
9497  map->set_prototype(*prototype);
9498  function->set_prototype_or_initial_map(*map);
9499  map->set_constructor(*function);
9500 }
static void OptimizeAsPrototype(Handle< JSObject > object, PrototypeOptimizationMode mode)
Definition: objects.cc:9329
@ FAST_PROTOTYPE
Definition: objects.h:258

References v8::internal::Handle< T >::cast(), v8::internal::FAST_PROTOTYPE, v8::internal::HeapObject::map(), v8::internal::JSObject::OptimizeAsPrototype(), and prototype().

Referenced by EnsureHasInitialMap(), and SetInstancePrototype().

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

◆ SetInstanceClassName()

void v8::internal::JSFunction::SetInstanceClassName ( String name)

Definition at line 9543 of file objects.cc.

9543  {
9544  shared()->set_instance_class_name(name);
9545 }

References name.

◆ SetInstancePrototype()

void v8::internal::JSFunction::SetInstancePrototype ( Handle< JSFunction function,
Handle< Object value 
)
static

Definition at line 9386 of file objects.cc.

9387  {
9388  Isolate* isolate = function->GetIsolate();
9389 
9390  DCHECK(value->IsJSReceiver());
9391 
9392  // Now some logic for the maps of the objects that are created by using this
9393  // function as a constructor.
9394  if (function->has_initial_map()) {
9395  // If the function has allocated the initial map replace it with a
9396  // copy containing the new prototype. Also complete any in-object
9397  // slack tracking that is in progress at this point because it is
9398  // still tracking the old copy.
9399  if (function->IsInobjectSlackTrackingInProgress()) {
9400  function->CompleteInobjectSlackTracking();
9401  }
9402 
9403  Handle<Map> initial_map(function->initial_map(), isolate);
9404 
9405  if (!initial_map->GetIsolate()->bootstrapper()->IsActive() &&
9407  // Put the value in the initial map field until an initial map is needed.
9408  // At that point, a new initial map is created and the prototype is put
9409  // into the initial map where it belongs.
9410  function->set_prototype_or_initial_map(*value);
9411  } else {
9412  Handle<Map> new_map = Map::Copy(initial_map);
9413  JSFunction::SetInitialMap(function, new_map, value);
9414 
9415  // If the function is used as the global Array function, cache the
9416  // initial map (and transitioned versions) in the native context.
9417  Context* native_context = function->context()->native_context();
9418  Object* array_function =
9419  native_context->get(Context::ARRAY_FUNCTION_INDEX);
9420  if (array_function->IsJSFunction() &&
9421  *function == JSFunction::cast(array_function)) {
9422  CacheInitialJSArrayMaps(handle(native_context, isolate), new_map);
9423  }
9424  }
9425 
9426  // Deoptimize all code that embeds the previous initial map.
9427  initial_map->dependent_code()->DeoptimizeDependentCodeGroup(
9429  } else {
9430  // Put the value in the initial map field until an initial map is
9431  // needed. At that point, a new initial map is created and the
9432  // prototype is put into the initial map where it belongs.
9433  function->set_prototype_or_initial_map(*value);
9434  }
9435  isolate->heap()->ClearInstanceofCache();
9436 }
Bootstrapper * bootstrapper()
Definition: isolate.h:856
InstanceType instance_type()
Definition: objects-inl.h:4323
static Handle< Map > Copy(Handle< Map > map)
Definition: objects.cc:6664
Handle< Object > CacheInitialJSArrayMaps(Handle< Context > native_context, Handle< Map > initial_map)
Definition: objects.cc:9355

References v8::internal::Context::ARRAY_FUNCTION_INDEX, v8::internal::Isolate::bootstrapper(), v8::internal::CacheInitialJSArrayMaps(), v8::internal::Heap::ClearInstanceofCache(), v8::internal::Map::Copy(), DCHECK, v8::internal::FixedArray::get(), v8::internal::HeapObject::GetIsolate(), v8::internal::handle(), v8::internal::Isolate::heap(), initial_map(), v8::internal::Map::instance_type(), v8::internal::JS_OBJECT_TYPE, v8::internal::DependentCode::kInitialMapChangedGroup, v8::internal::Context::native_context(), and SetInitialMap().

Referenced by SetPrototype().

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

◆ SetPrototype()

void v8::internal::JSFunction::SetPrototype ( Handle< JSFunction function,
Handle< Object value 
)
static

Definition at line 9439 of file objects.cc.

9440  {
9441  DCHECK(function->should_have_prototype());
9442  Handle<Object> construct_prototype = value;
9443 
9444  // If the value is not a JSReceiver, store the value in the map's
9445  // constructor field so it can be accessed. Also, set the prototype
9446  // used for constructing objects to the original object prototype.
9447  // See ECMA-262 13.2.2.
9448  if (!value->IsJSReceiver()) {
9449  // Copy the map so this does not affect unrelated functions.
9450  // Remove map transitions because they point to maps with a
9451  // different prototype.
9452  Handle<Map> new_map = Map::Copy(handle(function->map()));
9453 
9454  JSObject::MigrateToMap(function, new_map);
9455  new_map->set_constructor(*value);
9456  new_map->set_non_instance_prototype(true);
9457  Isolate* isolate = new_map->GetIsolate();
9458  construct_prototype = handle(
9459  isolate->context()->native_context()->initial_object_prototype(),
9460  isolate);
9461  } else {
9462  function->map()->set_non_instance_prototype(false);
9463  }
9464 
9465  return SetInstancePrototype(function, construct_prototype);
9466 }
static void SetInstancePrototype(Handle< JSFunction > function, Handle< Object > value)
Definition: objects.cc:9386
static void MigrateToMap(Handle< JSObject > object, Handle< Map > new_map)
Definition: objects.cc:1886

References v8::internal::Isolate::context(), v8::internal::Map::Copy(), DCHECK, v8::internal::handle(), v8::internal::JSObject::MigrateToMap(), v8::internal::Context::native_context(), and SetInstancePrototype().

Referenced by v8::internal::GetFunctionPrototype(), and v8::internal::SetFunctionPrototype().

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

◆ should_have_prototype()

bool v8::internal::JSFunction::should_have_prototype ( )
inline

Definition at line 5943 of file objects-inl.h.

5943  {
5944  return map()->function_with_prototype();
5945 }
bool function_with_prototype()
Definition: objects-inl.h:4382

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

+ Here is the call graph for this function:

◆ StartInobjectSlackTracking()

void v8::internal::JSFunction::StartInobjectSlackTracking ( )

Definition at line 9923 of file objects.cc.

9923  {
9925 
9926  if (!FLAG_clever_optimizations) return;
9927  Map* map = initial_map();
9928 
9929  // Only initiate the tracking the first time.
9930  if (map->done_inobject_slack_tracking()) return;
9932 
9933  // No tracking during the snapshot construction phase.
9934  Isolate* isolate = GetIsolate();
9935  if (isolate->serializer_enabled()) return;
9936 
9937  if (map->unused_property_fields() == 0) return;
9938 
9940 }
bool IsInobjectSlackTrackingInProgress()
Definition: objects-inl.h:5832
static const int kGenerousAllocationCount
Definition: objects.h:7261
void set_done_inobject_slack_tracking(bool value)
Definition: objects-inl.h:4480

References DCHECK, v8::internal::Map::done_inobject_slack_tracking(), v8::internal::HeapObject::GetIsolate(), has_initial_map(), initial_map(), IsInobjectSlackTrackingInProgress(), kGenerousAllocationCount, v8::internal::HeapObject::map(), v8::internal::Isolate::serializer_enabled(), v8::internal::Map::set_construction_count(), v8::internal::Map::set_done_inobject_slack_tracking(), and v8::internal::Map::unused_property_fields().

+ Here is the call graph for this function:

Member Data Documentation

◆ kBoundArgumentsStartIndex

const int v8::internal::JSFunction::kBoundArgumentsStartIndex = 2
static

◆ kBoundFunctionIndex

◆ kBoundThisIndex

const int v8::internal::JSFunction::kBoundThisIndex = 1
static

◆ kCodeEntryOffset

◆ kContextOffset

◆ kFinishSlackTracking

const int v8::internal::JSFunction::kFinishSlackTracking = 1
static

Definition at line 7262 of file objects.h.

◆ kGenerousAllocationCount

const int v8::internal::JSFunction::kGenerousAllocationCount = Map::ConstructionCount::kMax
static

Definition at line 7261 of file objects.h.

Referenced by StartInobjectSlackTracking().

◆ kLiteralNativeContextIndex

const int v8::internal::JSFunction::kLiteralNativeContextIndex = 0
static

◆ kLiteralsOffset

◆ kLiteralsPrefixSize

◆ kNextFunctionLinkOffset

◆ kNonWeakFieldsEndOffset

◆ kNoSlackTracking

const int v8::internal::JSFunction::kNoSlackTracking = 0
static

◆ kPrototypeOrInitialMapOffset

◆ kSharedFunctionInfoOffset

◆ kSize


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