V8 Project
v8::internal::SharedFunctionInfo Class Reference

#include <objects.h>

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

Classes

class  DeoptCountBits
 
class  DisabledOptimizationReasonBits
 
class  FunctionKindBits
 
class  ICAgeBits
 
class  OptCountBits
 
class  OptReenableTriesBits
 

Public Types

enum  CompilerHints {
  kAllowLazyCompilation , kAllowLazyCompilationWithoutContext , kOptimizationDisabled , kStrictModeFunction ,
  kUsesArguments , kHasDuplicateParameters , kNative , kInlineBuiltin ,
  kBoundFunction , kIsAnonymous , kNameShouldPrintAsAnonymous , kIsFunction ,
  kDontCache , kDontFlush , kIsArrow , kIsGenerator ,
  kIsConciseMethod , kIsAsmFunction , kCompilerHintsCount
}
 
typedef FixedBodyDescriptor< kNameOffset, kFeedbackVectorOffset+kPointerSize, kSizeBodyDescriptor
 
- 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 }
 

Public Member Functions

void ReplaceCode (Code *code)
 
int SearchOptimizedCodeMap (Context *native_context, BailoutId osr_ast_id)
 
FixedArrayGetLiteralsFromOptimizedCodeMap (int index)
 
CodeGetCodeFromOptimizedCodeMap (int index)
 
void ClearOptimizedCodeMap ()
 
void EvictFromOptimizedCodeMap (Code *optimized_code, const char *reason)
 
void ClearTypeFeedbackInfo ()
 
void TrimOptimizedCodeMap (int shrink_by)
 
bool is_compiled ()
 
int length () const
 
void set_length (int value)
 
int formal_parameter_count () const
 
void set_formal_parameter_count (int value)
 
void DontAdaptArguments ()
 
int expected_nof_properties () const
 
void set_expected_nof_properties (int value)
 
bool IsApiFunction ()
 
FunctionTemplateInfoget_api_func_data ()
 
bool HasBuiltinFunctionId ()
 
BuiltinFunctionId builtin_function_id ()
 
int num_literals () const
 
void set_num_literals (int value)
 
int start_position_and_type () const
 
void set_start_position_and_type (int value)
 
StringDebugName ()
 
int function_token_position () const
 
void set_function_token_position (int function_token_position)
 
int start_position () const
 
void set_start_position (int start_position)
 
int end_position () const
 
void set_end_position (int end_position)
 
int compiler_hints () const
 
void set_compiler_hints (int value)
 
int ast_node_count () const
 
void set_ast_node_count (int count)
 
int profiler_ticks () const
 
void set_profiler_ticks (int ticks)
 
int ic_age ()
 
void set_ic_age (int age)
 
StrictMode strict_mode ()
 
void set_strict_mode (StrictMode strict_mode)
 
FunctionKind kind ()
 
void set_kind (FunctionKind kind)
 
bool has_deoptimization_support ()
 
void EnableDeoptimizationSupport (Code *recompiled)
 
void DisableOptimization (BailoutReason reason)
 
BailoutReason DisableOptimizationReason ()
 
bool VerifyBailoutId (BailoutId id)
 
bool HasSourceCode () const
 
Handle< ObjectGetSourceCode ()
 
int opt_count ()
 
void set_opt_count (int opt_count)
 
void set_deopt_count (int value)
 
int deopt_count ()
 
void increment_deopt_count ()
 
void set_opt_reenable_tries (int value)
 
int opt_reenable_tries ()
 
void TryReenableOptimization ()
 
void set_counters (int value)
 
int counters () const
 
void set_opt_count_and_bailout_reason (int value)
 
int opt_count_and_bailout_reason () const
 
void set_bailout_reason (BailoutReason reason)
 
bool IsInlineable ()
 
int SourceSize ()
 
int CalculateInstanceSize ()
 
int CalculateInObjectProperties ()
 
void ResetForNewContext (int new_ic_age)
 
- 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 AddToOptimizedCodeMap (Handle< SharedFunctionInfo > shared, Handle< Context > native_context, Handle< Code > code, Handle< FixedArray > literals, BailoutId osr_ast_id)
 
- 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 kNextMapIndex = 0
 
static const int kEntriesStart = 1
 
static const int kContextOffset = 0
 
static const int kCachedCodeOffset = 1
 
static const int kLiteralsOffset = 2
 
static const int kOsrAstIdOffset = 3
 
static const int kEntryLength = 4
 
static const int kInitialLength = kEntriesStart + kEntryLength
 
static const int kDontAdaptArgumentsSentinel = -1
 
static const int kNameOffset = HeapObject::kHeaderSize
 
static const int kCodeOffset = kNameOffset + kPointerSize
 
static const int kOptimizedCodeMapOffset = kCodeOffset + kPointerSize
 
static const int kScopeInfoOffset = kOptimizedCodeMapOffset + kPointerSize
 
static const int kConstructStubOffset = kScopeInfoOffset + kPointerSize
 
static const int kInstanceClassNameOffset
 
static const int kFunctionDataOffset
 
static const int kScriptOffset = kFunctionDataOffset + kPointerSize
 
static const int kDebugInfoOffset = kScriptOffset + kPointerSize
 
static const int kInferredNameOffset = kDebugInfoOffset + kPointerSize
 
static const int kFeedbackVectorOffset
 
static const int kLengthOffset
 
static const int kFormalParameterCountOffset
 
static const int kExpectedNofPropertiesOffset
 
static const int kNumLiteralsOffset
 
static const int kEndPositionOffset
 
static const int kStartPositionAndTypeOffset
 
static const int kFunctionTokenPositionOffset
 
static const int kCompilerHintsOffset
 
static const int kOptCountAndBailoutReasonOffset
 
static const int kCountersOffset
 
static const int kAstNodeCountOffset
 
static const int kProfilerTicksOffset
 
static const int kSize = kProfilerTicksOffset + kIntSize
 
static const int kAlignedSize = POINTER_SIZE_ALIGN(kSize)
 
static const int kIsExpressionBit = 0
 
static const int kIsTopLevelBit = 1
 
static const int kStartPositionShift = 2
 
static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1)
 
static const int kStrictModeBitWithinByte
 
static const int kNativeBitWithinByte
 
- 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

 STATIC_ASSERT (SharedFunctionInfo::kCompilerHintsCount<=SharedFunctionInfo::kCompilerHintsSize *kBitsPerByte)
 
 DISALLOW_IMPLICIT_CONSTRUCTORS (SharedFunctionInfo)
 

Static Private Attributes

static const int kCompilerHintsSmiTagSize = 0
 
static const int kCompilerHintsSize = kIntSize
 

Additional Inherited Members

- 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 6580 of file objects.h.

Member Typedef Documentation

◆ BodyDescriptor

Member Enumeration Documentation

◆ CompilerHints

Enumerator
kAllowLazyCompilation 
kAllowLazyCompilationWithoutContext 
kOptimizationDisabled 
kStrictModeFunction 
kUsesArguments 
kHasDuplicateParameters 
kNative 
kInlineBuiltin 
kBoundFunction 
kIsAnonymous 
kNameShouldPrintAsAnonymous 
kIsFunction 
kDontCache 
kDontFlush 
kIsArrow 
kIsGenerator 
kIsConciseMethod 
kIsAsmFunction 
kCompilerHintsCount 

Definition at line 6994 of file objects.h.

6994  {
7001  kNative,
7004  kIsAnonymous,
7006  kIsFunction,
7007  kDontCache,
7008  kDontFlush,
7009  kIsArrow,
7010  kIsGenerator,
7013  kCompilerHintsCount // Pseudo entry
7014  };

Member Function Documentation

◆ AddToOptimizedCodeMap()

void v8::internal::SharedFunctionInfo::AddToOptimizedCodeMap ( Handle< SharedFunctionInfo shared,
Handle< Context native_context,
Handle< Code code,
Handle< FixedArray literals,
BailoutId  osr_ast_id 
)
static

Definition at line 9184 of file objects.cc.

9189  {
9190  Isolate* isolate = shared->GetIsolate();
9191  DCHECK(code->kind() == Code::OPTIMIZED_FUNCTION);
9192  DCHECK(native_context->IsNativeContext());
9194  Handle<FixedArray> new_code_map;
9195  Handle<Object> value(shared->optimized_code_map(), isolate);
9196  int old_length;
9197  if (value->IsSmi()) {
9198  // No optimized code map.
9199  DCHECK_EQ(0, Smi::cast(*value)->value());
9200  // Create 3 entries per context {context, code, literals}.
9201  new_code_map = isolate->factory()->NewFixedArray(kInitialLength);
9202  old_length = kEntriesStart;
9203  } else {
9204  // Copy old map and append one new entry.
9205  Handle<FixedArray> old_code_map = Handle<FixedArray>::cast(value);
9206  DCHECK_EQ(-1, shared->SearchOptimizedCodeMap(*native_context, osr_ast_id));
9207  old_length = old_code_map->length();
9208  new_code_map = FixedArray::CopySize(
9209  old_code_map, old_length + kEntryLength);
9210  // Zap the old map for the sake of the heap verifier.
9211  if (Heap::ShouldZapGarbage()) {
9212  Object** data = old_code_map->data_start();
9213  MemsetPointer(data, isolate->heap()->the_hole_value(), old_length);
9214  }
9215  }
9216  new_code_map->set(old_length + kContextOffset, *native_context);
9217  new_code_map->set(old_length + kCachedCodeOffset, *code);
9218  new_code_map->set(old_length + kLiteralsOffset, *literals);
9219  new_code_map->set(old_length + kOsrAstIdOffset,
9220  Smi::FromInt(osr_ast_id.ToInt()));
9221 
9222 #ifdef DEBUG
9223  for (int i = kEntriesStart; i < new_code_map->length(); i += kEntryLength) {
9224  DCHECK(new_code_map->get(i + kContextOffset)->IsNativeContext());
9225  DCHECK(new_code_map->get(i + kCachedCodeOffset)->IsCode());
9226  DCHECK(Code::cast(new_code_map->get(i + kCachedCodeOffset))->kind() ==
9227  Code::OPTIMIZED_FUNCTION);
9228  DCHECK(new_code_map->get(i + kLiteralsOffset)->IsFixedArray());
9229  DCHECK(new_code_map->get(i + kOsrAstIdOffset)->IsSmi());
9230  }
9231 #endif
9232  shared->set_optimized_code_map(*new_code_map);
9233 }
static Handle< FixedArray > CopySize(Handle< FixedArray > array, int new_length, PretenureFlag pretenure=NOT_TENURED)
Definition: objects.cc:7749
static Handle< T > cast(Handle< S > that)
Definition: handles.h:116
static bool ShouldZapGarbage()
Definition: heap.h:926
static const int kCachedCodeOffset
Definition: objects.h:6626
static const int kEntriesStart
Definition: objects.h:6624
static const int kOsrAstIdOffset
Definition: objects.h:6628
STATIC_ASSERT(SharedFunctionInfo::kCompilerHintsCount<=SharedFunctionInfo::kCompilerHintsSize *kBitsPerByte)
static const int kLiteralsOffset
Definition: objects.h:6627
static const int kInitialLength
Definition: objects.h:6630
static const int kContextOffset
Definition: objects.h:6625
static const int kEntryLength
Definition: objects.h:6629
static Smi * FromInt(int value)
Definition: objects-inl.h:1321
enable harmony numeric literals(0o77, 0b11)") DEFINE_BOOL(harmony_object_literals
#define DCHECK(condition)
Definition: logging.h:205
#define DCHECK_EQ(v1, v2)
Definition: logging.h:206
void MemsetPointer(T **dest, U *value, int counter)
Definition: utils.h:1183
kSerializedDataOffset Object
Definition: objects-inl.h:5322

References v8::internal::Handle< T >::cast(), v8::internal::FixedArray::CopySize(), DCHECK, DCHECK_EQ, v8::internal::Isolate::factory(), v8::internal::Smi::FromInt(), v8::internal::Isolate::heap(), kCachedCodeOffset, kContextOffset, kEntriesStart, kEntryLength, kInitialLength, kLiteralsOffset, kOsrAstIdOffset, literals(), v8::internal::MemsetPointer(), v8::internal::Heap::ShouldZapGarbage(), STATIC_ASSERT(), and v8::internal::BailoutId::ToInt().

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

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

◆ ast_node_count()

int v8::internal::SharedFunctionInfo::ast_node_count ( ) const
inline

◆ builtin_function_id()

BuiltinFunctionId v8::internal::SharedFunctionInfo::builtin_function_id ( )
inline

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

5695  {
5697  return static_cast<BuiltinFunctionId>(Smi::cast(function_data())->value());
5698 }

References DCHECK, and HasBuiltinFunctionId().

+ Here is the call graph for this function:

◆ CalculateInObjectProperties()

int v8::internal::SharedFunctionInfo::CalculateInObjectProperties ( )

Definition at line 9816 of file objects.cc.

9816  {
9818 }
static const int kHeaderSize
Definition: objects.h:2195
const int kPointerSize
Definition: globals.h:129

References CalculateInstanceSize(), v8::internal::JSObject::kHeaderSize, and v8::internal::kPointerSize.

+ Here is the call graph for this function:

◆ CalculateInstanceSize()

int v8::internal::SharedFunctionInfo::CalculateInstanceSize ( )

Definition at line 9805 of file objects.cc.

9805  {
9806  int instance_size =
9809  if (instance_size > JSObject::kMaxInstanceSize) {
9810  instance_size = JSObject::kMaxInstanceSize;
9811  }
9812  return instance_size;
9813 }
static const int kMaxInstanceSize
Definition: objects.h:2186

References expected_nof_properties(), v8::internal::JSObject::kHeaderSize, v8::internal::JSObject::kMaxInstanceSize, and v8::internal::kPointerSize.

Referenced by CalculateInObjectProperties().

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

◆ ClearOptimizedCodeMap()

void v8::internal::SharedFunctionInfo::ClearOptimizedCodeMap ( )

Definition at line 9257 of file objects.cc.

9257  {
9258  FixedArray* code_map = FixedArray::cast(optimized_code_map());
9259 
9260  // If the next map link slot is already used then the function was
9261  // enqueued with code flushing and we remove it now.
9262  if (!code_map->get(kNextMapIndex)->IsUndefined()) {
9263  CodeFlusher* flusher = GetHeap()->mark_compact_collector()->code_flusher();
9264  flusher->EvictOptimizedCodeMap(this);
9265  }
9266 
9267  DCHECK(code_map->get(kNextMapIndex)->IsUndefined());
9268  set_optimized_code_map(Smi::FromInt(0));
9269 }
void EvictOptimizedCodeMap(SharedFunctionInfo *code_map_holder)
Heap * GetHeap() const
Definition: objects-inl.h:1379
MarkCompactCollector * mark_compact_collector()
Definition: heap.h:1197
static const int kNextMapIndex
Definition: objects.h:6623

References v8::internal::MarkCompactCollector::code_flusher(), DCHECK, v8::internal::CodeFlusher::EvictOptimizedCodeMap(), v8::internal::Smi::FromInt(), v8::internal::FixedArray::get(), v8::internal::HeapObject::GetHeap(), kNextMapIndex, and v8::internal::Heap::mark_compact_collector().

Referenced by EvictFromOptimizedCodeMap(), and TrimOptimizedCodeMap().

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

◆ ClearTypeFeedbackInfo()

void v8::internal::SharedFunctionInfo::ClearTypeFeedbackInfo ( )

Definition at line 10404 of file objects.cc.

10404  {
10405  TypeFeedbackVector* vector = feedback_vector();
10406  Heap* heap = GetHeap();
10407  int length = vector->length();
10408 
10409  for (int i = 0; i < length; i++) {
10410  Object* obj = vector->get(i);
10411  if (obj->IsHeapObject()) {
10412  InstanceType instance_type =
10413  HeapObject::cast(obj)->map()->instance_type();
10414  switch (instance_type) {
10415  case ALLOCATION_SITE_TYPE:
10416  // AllocationSites are not cleared because they do not store
10417  // information that leaks.
10418  break;
10419  // Fall through...
10420  default:
10423  }
10424  }
10425  }
10426 }
static Object * RawUninitializedSentinel(Heap *heap)
@ SKIP_WRITE_BARRIER
Definition: objects.h:235
@ ALLOCATION_SITE_TYPE
Definition: objects.h:707

References v8::internal::ALLOCATION_SITE_TYPE, v8::internal::feedback_vector, v8::internal::FixedArray::get(), v8::internal::HeapObject::GetHeap(), v8::internal::FixedArrayBase::length(), length(), v8::internal::TypeFeedbackVector::RawUninitializedSentinel(), v8::internal::FixedArray::set(), and v8::internal::SKIP_WRITE_BARRIER.

Referenced by ResetForNewContext().

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

◆ compiler_hints()

int v8::internal::SharedFunctionInfo::compiler_hints ( ) const
inline

Referenced by v8::internal::BOOL_GETTER(), kind(), set_kind(), set_strict_mode(), and strict_mode().

+ Here is the caller graph for this function:

◆ counters()

int v8::internal::SharedFunctionInfo::counters ( ) const
inline

Referenced by deopt_count(), ic_age(), increment_deopt_count(), opt_reenable_tries(), set_deopt_count(), set_ic_age(), and set_opt_reenable_tries().

+ Here is the caller graph for this function:

◆ DebugName()

String * v8::internal::SharedFunctionInfo::DebugName ( )

Definition at line 9769 of file objects.cc.

9769  {
9770  Object* n = name();
9771  if (!n->IsString() || String::cast(n)->length() == 0) return inferred_name();
9772  return String::cast(n);
9773 }
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

References name.

Referenced by v8::internal::AllocationTracker::AddFunctionInfo(), v8::internal::Logger::CodeCreateEvent(), v8::internal::CpuProfiler::CodeCreateEvent(), v8::internal::CodeEventLogger::CodeCreateEvent(), v8::internal::Logger::CodeDisableOptEvent(), v8::internal::V8HeapExplorer::ExtractSharedFunctionInfoReferences(), v8::internal::Deoptimizer::GetOutputInfo(), and v8::internal::HeapObject::HeapObjectShortPrint().

+ Here is the caller graph for this function:

◆ deopt_count()

int v8::internal::SharedFunctionInfo::deopt_count ( )
inline

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

5711  {
5712  return DeoptCountBits::decode(counters());
5713 }
static T decode(U value)
Definition: utils.h:228

References counters(), and v8::internal::BitFieldBase< T, shift, size, U >::decode().

Referenced by increment_deopt_count(), v8::internal::RuntimeProfiler::OptimizeNow(), and set_deopt_count().

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

◆ DisableOptimization()

void v8::internal::SharedFunctionInfo::DisableOptimization ( BailoutReason  reason)

Definition at line 9887 of file objects.cc.

9887  {
9888  // Disable optimization for the shared function info and mark the
9889  // code as non-optimizable. The marker on the shared function info
9890  // is there because we flush non-optimized code thereby loosing the
9891  // non-optimizable information for the code. When the code is
9892  // regenerated and set on the shared function info it is marked as
9893  // non-optimizable if optimization is disabled for the shared
9894  // function info.
9895  set_optimization_disabled(true);
9896  set_bailout_reason(reason);
9897  // Code should be the lazy compilation stub or else unoptimized. If the
9898  // latter, disable optimization for the code too.
9899  DCHECK(code()->kind() == Code::FUNCTION || code()->kind() == Code::BUILTIN);
9900  if (code()->kind() == Code::FUNCTION) {
9901  code()->set_optimizable(false);
9902  }
9903  PROFILE(GetIsolate(), CodeDisableOptEvent(code(), this));
9904  if (FLAG_trace_opt) {
9905  PrintF("[disabled optimization for ");
9906  ShortPrint();
9907  PrintF(", reason: %s]\n", GetBailoutReason(reason));
9908  }
9909 }
#define BUILTIN(name)
Definition: builtins.cc:122
Isolate * GetIsolate() const
Definition: objects-inl.h:1387
void ShortPrint(FILE *out=stdout)
Definition: objects.cc:905
void set_bailout_reason(BailoutReason reason)
Definition: objects.h:6861
#define PROFILE(IsolateGetter, Call)
Definition: cpu-profiler.h:181
const char * GetBailoutReason(BailoutReason reason)
void PrintF(const char *format,...)
Definition: utils.cc:80

References BUILTIN, DCHECK, v8::internal::GetBailoutReason(), v8::internal::HeapObject::GetIsolate(), kind(), v8::internal::PrintF(), PROFILE, set_bailout_reason(), and v8::internal::Object::ShortPrint().

+ Here is the call graph for this function:

◆ DisableOptimizationReason()

BailoutReason v8::internal::SharedFunctionInfo::DisableOptimizationReason ( )
inline

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

5750  {
5751  BailoutReason reason = static_cast<BailoutReason>(
5753  return reason;
5754 }

References v8::internal::BitFieldBase< T, shift, size, U >::decode(), and opt_count_and_bailout_reason().

Referenced by v8::internal::CpuProfiler::CodeCreateEvent(), v8::internal::CpuProfiler::CodeDisableOptEvent(), and v8::internal::Logger::CodeDisableOptEvent().

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

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::SharedFunctionInfo::DISALLOW_IMPLICIT_CONSTRUCTORS ( SharedFunctionInfo  )
private

◆ DontAdaptArguments()

void v8::internal::SharedFunctionInfo::DontAdaptArguments ( )
inline

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

5615  {
5616  DCHECK(code()->kind() == Code::BUILTIN);
5618 }
void set_formal_parameter_count(int value)
static const int kDontAdaptArgumentsSentinel
Definition: objects.h:6888

References BUILTIN, DCHECK, kDontAdaptArgumentsSentinel, kind(), and set_formal_parameter_count().

+ Here is the call graph for this function:

◆ EnableDeoptimizationSupport()

void v8::internal::SharedFunctionInfo::EnableDeoptimizationSupport ( Code recompiled)

Definition at line 9868 of file objects.cc.

9868  {
9870  DisallowHeapAllocation no_allocation;
9871  Code* code = this->code();
9872  if (IsCodeEquivalent(code, recompiled)) {
9873  // Copy the deoptimization data from the recompiled code.
9874  code->set_deoptimization_data(recompiled->deoptimization_data());
9875  code->set_has_deoptimization_support(true);
9876  } else {
9877  // TODO(3025757): In case the recompiled isn't equivalent to the
9878  // old code, we have to replace it. We should try to avoid this
9879  // altogether because it flushes valuable type feedback by
9880  // effectively resetting all IC state.
9881  ReplaceCode(recompiled);
9882  }
9884 }
PerThreadAssertScopeDebugOnly< HEAP_ALLOCATION_ASSERT, false > DisallowHeapAllocation
Definition: assert-scope.h:110
static bool IsCodeEquivalent(Code *code, Code *recompiled)
Definition: objects.cc:9855

References DCHECK, has_deoptimization_support(), v8::internal::IsCodeEquivalent(), ReplaceCode(), and v8::internal::Code::set_has_deoptimization_support().

+ Here is the call graph for this function:

◆ end_position()

int v8::internal::SharedFunctionInfo::end_position ( ) const
inline

Referenced by GetSourceCode(), v8::internal::operator<<(), and SourceSize().

+ Here is the caller graph for this function:

◆ EvictFromOptimizedCodeMap()

void v8::internal::SharedFunctionInfo::EvictFromOptimizedCodeMap ( Code optimized_code,
const char *  reason 
)

Definition at line 9272 of file objects.cc.

9273  {
9274  DisallowHeapAllocation no_gc;
9275  if (optimized_code_map()->IsSmi()) return;
9276 
9277  FixedArray* code_map = FixedArray::cast(optimized_code_map());
9278  int dst = kEntriesStart;
9279  int length = code_map->length();
9280  for (int src = kEntriesStart; src < length; src += kEntryLength) {
9281  DCHECK(code_map->get(src)->IsNativeContext());
9282  if (Code::cast(code_map->get(src + kCachedCodeOffset)) == optimized_code) {
9283  // Evict the src entry by not copying it to the dst entry.
9284  if (FLAG_trace_opt) {
9285  PrintF("[evicting entry from optimizing code map (%s) for ", reason);
9286  ShortPrint();
9287  BailoutId osr(Smi::cast(code_map->get(src + kOsrAstIdOffset))->value());
9288  if (osr.IsNone()) {
9289  PrintF("]\n");
9290  } else {
9291  PrintF(" (osr ast id %d)]\n", osr.ToInt());
9292  }
9293  }
9294  } else {
9295  // Keep the src entry by copying it to the dst entry.
9296  if (dst != src) {
9297  code_map->set(dst + kContextOffset,
9298  code_map->get(src + kContextOffset));
9299  code_map->set(dst + kCachedCodeOffset,
9300  code_map->get(src + kCachedCodeOffset));
9301  code_map->set(dst + kLiteralsOffset,
9302  code_map->get(src + kLiteralsOffset));
9303  code_map->set(dst + kOsrAstIdOffset,
9304  code_map->get(src + kOsrAstIdOffset));
9305  }
9306  dst += kEntryLength;
9307  }
9308  }
9309  if (dst != length) {
9310  // Always trim even when array is cleared because of heap verifier.
9312  if (code_map->length() == kEntriesStart) ClearOptimizedCodeMap();
9313  }
9314 }
void RightTrimFixedArray(FixedArrayBase *obj, int elements_to_trim)
Definition: heap.cc:3322

References ClearOptimizedCodeMap(), DCHECK, v8::internal::Heap::FROM_MUTATOR, v8::internal::FixedArray::get(), v8::internal::HeapObject::GetHeap(), v8::internal::BailoutId::IsNone(), kCachedCodeOffset, kContextOffset, kEntriesStart, kEntryLength, kLiteralsOffset, kOsrAstIdOffset, v8::internal::FixedArrayBase::length(), length(), v8::internal::PrintF(), v8::internal::Heap::RightTrimFixedArray(), v8::internal::FixedArray::set(), v8::internal::Object::ShortPrint(), and v8::internal::BailoutId::ToInt().

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

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

◆ expected_nof_properties()

int v8::internal::SharedFunctionInfo::expected_nof_properties ( ) const
inline

Referenced by CalculateInstanceSize().

+ Here is the caller graph for this function:

◆ formal_parameter_count()

int v8::internal::SharedFunctionInfo::formal_parameter_count ( ) const
inline

Referenced by v8::internal::compiler::Linkage::Linkage().

+ Here is the caller graph for this function:

◆ function_token_position()

int v8::internal::SharedFunctionInfo::function_token_position ( ) const
inline

◆ get_api_func_data()

FunctionTemplateInfo * v8::internal::SharedFunctionInfo::get_api_func_data ( )
inline

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

5684  {
5685  DCHECK(IsApiFunction());
5686  return FunctionTemplateInfo::cast(function_data());
5687 }

References DCHECK, and IsApiFunction().

+ Here is the call graph for this function:

◆ GetCodeFromOptimizedCodeMap()

Code * v8::internal::SharedFunctionInfo::GetCodeFromOptimizedCodeMap ( int  index)

Definition at line 9248 of file objects.cc.

9248  {
9249  DCHECK(index > kEntriesStart);
9250  FixedArray* code_map = FixedArray::cast(optimized_code_map());
9251  Code* code = Code::cast(code_map->get(index));
9252  DCHECK_NE(NULL, code);
9253  return code;
9254 }
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 NULL
#define DCHECK_NE(v1, v2)
Definition: logging.h:207

References DCHECK, DCHECK_NE, v8::internal::FixedArray::get(), kEntriesStart, and NULL.

+ Here is the call graph for this function:

◆ GetLiteralsFromOptimizedCodeMap()

FixedArray * v8::internal::SharedFunctionInfo::GetLiteralsFromOptimizedCodeMap ( int  index)

Definition at line 9236 of file objects.cc.

9236  {
9237  DCHECK(index > kEntriesStart);
9238  FixedArray* code_map = FixedArray::cast(optimized_code_map());
9239  if (!bound()) {
9240  FixedArray* cached_literals = FixedArray::cast(code_map->get(index + 1));
9241  DCHECK_NE(NULL, cached_literals);
9242  return cached_literals;
9243  }
9244  return NULL;
9245 }

References DCHECK, DCHECK_NE, v8::internal::FixedArray::get(), kEntriesStart, and NULL.

+ Here is the call graph for this function:

◆ GetSourceCode()

Handle< Object > v8::internal::SharedFunctionInfo::GetSourceCode ( )

Definition at line 9782 of file objects.cc.

9782  {
9783  if (!HasSourceCode()) return GetIsolate()->factory()->undefined_value();
9784  Handle<String> source(String::cast(Script::cast(script())->source()));
9785  return GetIsolate()->factory()->NewSubString(
9786  source, start_position(), end_position());
9787 }
Factory * factory()
Definition: isolate.h:982

References end_position(), v8::internal::Isolate::factory(), v8::internal::HeapObject::GetIsolate(), HasSourceCode(), and start_position().

+ Here is the call graph for this function:

◆ has_deoptimization_support()

bool v8::internal::SharedFunctionInfo::has_deoptimization_support ( )
inline

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

5757  {
5758  Code* code = this->code();
5759  return code->kind() == Code::FUNCTION && code->has_deoptimization_support();
5760 }

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

Referenced by EnableDeoptimizationSupport().

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

◆ HasBuiltinFunctionId()

bool v8::internal::SharedFunctionInfo::HasBuiltinFunctionId ( )
inline

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

5690  {
5691  return function_data()->IsSmi();
5692 }

Referenced by builtin_function_id().

+ Here is the caller graph for this function:

◆ HasSourceCode()

bool v8::internal::SharedFunctionInfo::HasSourceCode ( ) const

Definition at line 9776 of file objects.cc.

9776  {
9777  return !script()->IsUndefined() &&
9778  !reinterpret_cast<Script*>(script())->source()->IsUndefined();
9779 }

Referenced by GetSourceCode(), v8::internal::operator<<(), and v8::internal::StringSharedKey::StringSharedHashHelper().

+ Here is the caller graph for this function:

◆ ic_age()

int v8::internal::SharedFunctionInfo::ic_age ( )
inline

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

5701  {
5702  return ICAgeBits::decode(counters());
5703 }

References counters(), and v8::internal::BitFieldBase< T, shift, size, U >::decode().

Referenced by set_ic_age().

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

◆ increment_deopt_count()

void v8::internal::SharedFunctionInfo::increment_deopt_count ( )
inline

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

5721  {
5722  int value = counters();
5723  int deopt_count = DeoptCountBits::decode(value);
5726 }
static U update(U previous, T value)
Definition: utils.h:223
static const T kMax
Definition: utils.h:209

References counters(), v8::internal::BitFieldBase< T, shift, size, U >::decode(), deopt_count(), v8::internal::BitFieldBase< T, shift, size, U >::kMax, set_counters(), and v8::internal::BitFieldBase< T, shift, size, U >::update().

+ Here is the call graph for this function:

◆ is_compiled()

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

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

5674  {
5675  return code() != GetIsolate()->builtins()->builtin(Builtins::kCompileLazy);
5676 }
Code * builtin(Name name)
Definition: builtins.h:254
Builtins * builtins()
Definition: isolate.h:947

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

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

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

◆ IsApiFunction()

bool v8::internal::SharedFunctionInfo::IsApiFunction ( )
inline

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

5679  {
5680  return function_data()->IsFunctionTemplateInfo();
5681 }

Referenced by get_api_func_data().

+ Here is the caller graph for this function:

◆ IsInlineable()

bool v8::internal::SharedFunctionInfo::IsInlineable ( )

Definition at line 9790 of file objects.cc.

9790  {
9791  // Check that the function has a script associated with it.
9792  if (!script()->IsScript()) return false;
9793  if (optimization_disabled()) return false;
9794  // If we never ran this (unlikely) then lets try to optimize it.
9795  if (code()->kind() != Code::FUNCTION) return true;
9796  return code()->optimizable();
9797 }

References kind().

+ Here is the call graph for this function:

◆ kind()

FunctionKind v8::internal::SharedFunctionInfo::kind ( )
inline

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

5567  {
5569 }

References compiler_hints(), and v8::internal::BitFieldBase< T, shift, size, U >::decode().

Referenced by v8::internal::BOOL_GETTER(), DisableOptimization(), DontAdaptArguments(), v8::internal::V8HeapExplorer::ExtractSharedFunctionInfoReferences(), IsInlineable(), ResetForNewContext(), and set_kind().

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

◆ length()

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

Referenced by ClearTypeFeedbackInfo(), EvictFromOptimizedCodeMap(), SearchOptimizedCodeMap(), and TrimOptimizedCodeMap().

+ Here is the caller graph for this function:

◆ num_literals()

int v8::internal::SharedFunctionInfo::num_literals ( ) const
inline

◆ opt_count()

int v8::internal::SharedFunctionInfo::opt_count ( )
inline

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

5739  {
5741 }

References v8::internal::BitFieldBase< T, shift, size, U >::decode(), and opt_count_and_bailout_reason().

Referenced by ResetForNewContext(), and set_opt_count().

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

◆ opt_count_and_bailout_reason()

int v8::internal::SharedFunctionInfo::opt_count_and_bailout_reason ( ) const
inline

Referenced by DisableOptimizationReason(), opt_count(), and set_opt_count().

+ Here is the caller graph for this function:

◆ opt_reenable_tries()

int v8::internal::SharedFunctionInfo::opt_reenable_tries ( )
inline

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

5729  {
5731 }

References counters(), and v8::internal::BitFieldBase< T, shift, size, U >::decode().

Referenced by TryReenableOptimization().

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

◆ profiler_ticks()

int v8::internal::SharedFunctionInfo::profiler_ticks ( ) const
inline

Referenced by v8::internal::RuntimeProfiler::OptimizeNow().

+ Here is the caller graph for this function:

◆ ReplaceCode()

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

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

5644  {
5645  // If the GC metadata field is already used then the function was
5646  // enqueued as a code flushing candidate and we remove it now.
5647  if (code()->gc_metadata() != NULL) {
5648  CodeFlusher* flusher = GetHeap()->mark_compact_collector()->code_flusher();
5649  flusher->EvictCandidate(this);
5650  }
5651 
5652  DCHECK(code()->gc_metadata() == NULL && value->gc_metadata() == NULL);
5653 
5654  set_code(value);
5655 }
void EvictCandidate(SharedFunctionInfo *shared_info)

References v8::internal::MarkCompactCollector::code_flusher(), DCHECK, v8::internal::CodeFlusher::EvictCandidate(), v8::internal::HeapObject::GetHeap(), v8::internal::Heap::mark_compact_collector(), and NULL.

Referenced by EnableDeoptimizationSupport().

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

◆ ResetForNewContext()

void v8::internal::SharedFunctionInfo::ResetForNewContext ( int  new_ic_age)

Definition at line 9943 of file objects.cc.

9943  {
9944  code()->ClearInlineCaches();
9945  // If we clear ICs, we need to clear the type feedback vector too, since
9946  // CallICs are synced with a feedback vector slot.
9948  set_ic_age(new_ic_age);
9949  if (code()->kind() == Code::FUNCTION) {
9950  code()->set_profiler_ticks(0);
9951  if (optimization_disabled() &&
9952  opt_count() >= FLAG_max_opt_count) {
9953  // Re-enable optimizations if they were disabled due to opt_count limit.
9954  set_optimization_disabled(false);
9955  code()->set_optimizable(true);
9956  }
9957  set_opt_count(0);
9958  set_deopt_count(0);
9959  }
9960 }
void set_opt_count(int opt_count)
Definition: objects-inl.h:5744

References ClearTypeFeedbackInfo(), kind(), opt_count(), set_deopt_count(), set_ic_age(), and set_opt_count().

+ Here is the call graph for this function:

◆ SearchOptimizedCodeMap()

int v8::internal::SharedFunctionInfo::SearchOptimizedCodeMap ( Context native_context,
BailoutId  osr_ast_id 
)

Definition at line 9998 of file objects.cc.

9999  {
10000  DisallowHeapAllocation no_gc;
10001  DCHECK(native_context->IsNativeContext());
10002  if (!FLAG_cache_optimized_code) return -1;
10003  Object* value = optimized_code_map();
10004  if (!value->IsSmi()) {
10005  FixedArray* optimized_code_map = FixedArray::cast(value);
10006  int length = optimized_code_map->length();
10007  Smi* osr_ast_id_smi = Smi::FromInt(osr_ast_id.ToInt());
10008  for (int i = kEntriesStart; i < length; i += kEntryLength) {
10009  if (optimized_code_map->get(i + kContextOffset) == native_context &&
10010  optimized_code_map->get(i + kOsrAstIdOffset) == osr_ast_id_smi) {
10011  return i + kCachedCodeOffset;
10012  }
10013  }
10014  if (FLAG_trace_opt) {
10015  PrintF("[didn't find optimized code in optimized code map for ");
10016  ShortPrint();
10017  PrintF("]\n");
10018  }
10019  }
10020  return -1;
10021 }

References DCHECK, v8::internal::Smi::FromInt(), v8::internal::FixedArray::get(), v8::internal::Context::IsNativeContext(), kCachedCodeOffset, kContextOffset, kEntriesStart, kEntryLength, kOsrAstIdOffset, v8::internal::FixedArrayBase::length(), length(), v8::internal::PrintF(), v8::internal::Object::ShortPrint(), and v8::internal::BailoutId::ToInt().

+ Here is the call graph for this function:

◆ set_ast_node_count()

void v8::internal::SharedFunctionInfo::set_ast_node_count ( int  count)
inline

◆ set_bailout_reason()

void v8::internal::SharedFunctionInfo::set_bailout_reason ( BailoutReason  reason)
inline

Definition at line 6861 of file objects.h.

References v8::internal::opt_count_and_bailout_reason.

Referenced by DisableOptimization().

+ Here is the caller graph for this function:

◆ set_compiler_hints()

void v8::internal::SharedFunctionInfo::set_compiler_hints ( int  value)
inline

Referenced by v8::internal::BOOL_GETTER(), set_kind(), and set_strict_mode().

+ Here is the caller graph for this function:

◆ set_counters()

void v8::internal::SharedFunctionInfo::set_counters ( int  value)
inline

Referenced by increment_deopt_count(), set_deopt_count(), set_ic_age(), and set_opt_reenable_tries().

+ Here is the caller graph for this function:

◆ set_deopt_count()

void v8::internal::SharedFunctionInfo::set_deopt_count ( int  value)
inline

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

References counters(), deopt_count(), set_counters(), and v8::internal::BitFieldBase< T, shift, size, U >::update().

Referenced by ResetForNewContext(), and TryReenableOptimization().

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

◆ set_end_position()

void v8::internal::SharedFunctionInfo::set_end_position ( int  end_position)
inline

◆ set_expected_nof_properties()

void v8::internal::SharedFunctionInfo::set_expected_nof_properties ( int  value)
inline

◆ set_formal_parameter_count()

void v8::internal::SharedFunctionInfo::set_formal_parameter_count ( int  value)
inline

Referenced by DontAdaptArguments().

+ Here is the caller graph for this function:

◆ set_function_token_position()

void v8::internal::SharedFunctionInfo::set_function_token_position ( int  function_token_position)
inline

◆ set_ic_age()

void v8::internal::SharedFunctionInfo::set_ic_age ( int  age)
inline

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

References counters(), ic_age(), set_counters(), and v8::internal::BitFieldBase< T, shift, size, U >::update().

Referenced by ResetForNewContext().

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

◆ set_kind()

void v8::internal::SharedFunctionInfo::set_kind ( FunctionKind  kind)
inline

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

5572  {
5574  int hints = compiler_hints();
5575  hints = FunctionKindBits::update(hints, kind);
5576  set_compiler_hints(hints);
5577 }
bool IsValidFunctionKind(FunctionKind kind)
Definition: globals.h:784

References compiler_hints(), DCHECK, v8::internal::IsValidFunctionKind(), kind(), set_compiler_hints(), and v8::internal::BitFieldBase< T, shift, size, U >::update().

+ Here is the call graph for this function:

◆ set_length()

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

◆ set_num_literals()

void v8::internal::SharedFunctionInfo::set_num_literals ( int  value)
inline

◆ set_opt_count()

void v8::internal::SharedFunctionInfo::set_opt_count ( int  opt_count)
inline

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

References opt_count(), opt_count_and_bailout_reason(), set_opt_count_and_bailout_reason(), and v8::internal::BitFieldBase< T, shift, size, U >::update().

Referenced by ResetForNewContext(), and TryReenableOptimization().

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

◆ set_opt_count_and_bailout_reason()

void v8::internal::SharedFunctionInfo::set_opt_count_and_bailout_reason ( int  value)
inline

Referenced by set_opt_count().

+ Here is the caller graph for this function:

◆ set_opt_reenable_tries()

void v8::internal::SharedFunctionInfo::set_opt_reenable_tries ( int  value)
inline

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

5734  {
5736 }

References counters(), set_counters(), and v8::internal::BitFieldBase< T, shift, size, U >::update().

Referenced by TryReenableOptimization().

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

◆ set_profiler_ticks()

void v8::internal::SharedFunctionInfo::set_profiler_ticks ( int  ticks)
inline

Referenced by v8::internal::RuntimeProfiler::OptimizeNow().

+ Here is the caller graph for this function:

◆ set_start_position()

void v8::internal::SharedFunctionInfo::set_start_position ( int  start_position)
inline

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

References kStartPositionMask, kStartPositionShift, set_start_position_and_type(), start_position(), and start_position_and_type().

+ Here is the call graph for this function:

◆ set_start_position_and_type()

void v8::internal::SharedFunctionInfo::set_start_position_and_type ( int  value)
inline

Referenced by set_start_position().

+ Here is the caller graph for this function:

◆ set_strict_mode()

void v8::internal::SharedFunctionInfo::set_strict_mode ( StrictMode  strict_mode)
inline

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

5558  {
5559  // We only allow mode transitions from sloppy to strict.
5560  DCHECK(this->strict_mode() == SLOPPY || this->strict_mode() == strict_mode);
5561  int hints = compiler_hints();
5563  set_compiler_hints(hints);
5564 }
static Smi * set(Smi *smi, int bit_position, bool v)
Definition: objects.h:10799

References compiler_hints(), DCHECK, kStrictModeFunction, v8::internal::BooleanBit::set(), set_compiler_hints(), v8::internal::SLOPPY, v8::internal::STRICT, and strict_mode().

+ Here is the call graph for this function:

◆ SourceSize()

int v8::internal::SharedFunctionInfo::SourceSize ( )

Definition at line 9800 of file objects.cc.

9800  {
9801  return end_position() - start_position();
9802 }

References end_position(), and start_position().

Referenced by v8::internal::RuntimeProfiler::OptimizeNow().

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

◆ start_position()

int v8::internal::SharedFunctionInfo::start_position ( ) const
inline

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

5621  {
5623 }

References kStartPositionShift, and start_position_and_type().

Referenced by v8::internal::AllocationTracker::AddFunctionInfo(), GetSourceCode(), v8::internal::operator<<(), v8::internal::JavaScriptFrame::Print(), v8::internal::compiler::SearchSharedFunctionInfo(), set_start_position(), and SourceSize().

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

◆ start_position_and_type()

int v8::internal::SharedFunctionInfo::start_position_and_type ( ) const
inline

Referenced by set_start_position(), and start_position().

+ Here is the caller graph for this function:

◆ STATIC_ASSERT()

v8::internal::SharedFunctionInfo::STATIC_ASSERT ( SharedFunctionInfo::kCompilerHintsCount<=SharedFunctionInfo::kCompilerHintsSize kBitsPerByte)
private

Referenced by AddToOptimizedCodeMap().

+ Here is the caller graph for this function:

◆ strict_mode()

StrictMode v8::internal::SharedFunctionInfo::strict_mode ( )
inline

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

5552  {
5554  ? STRICT : SLOPPY;
5555 }
static bool get(Smi *smi, int bit_position)
Definition: objects.h:10791

References compiler_hints(), v8::internal::BooleanBit::get(), kStrictModeFunction, v8::internal::SLOPPY, and v8::internal::STRICT.

Referenced by v8::internal::HGraphBuilder::BuildWrapReceiver(), v8::internal::HandleApiCallHelper(), v8::internal::HOptimizedGraphBuilder::ImplicitReceiverFor(), v8::internal::RUNTIME_FUNCTION(), and set_strict_mode().

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

◆ TrimOptimizedCodeMap()

void v8::internal::SharedFunctionInfo::TrimOptimizedCodeMap ( int  shrink_by)

Definition at line 9317 of file objects.cc.

9317  {
9318  FixedArray* code_map = FixedArray::cast(optimized_code_map());
9319  DCHECK(shrink_by % kEntryLength == 0);
9320  DCHECK(shrink_by <= code_map->length() - kEntriesStart);
9321  // Always trim even when array is cleared because of heap verifier.
9322  GetHeap()->RightTrimFixedArray<Heap::FROM_GC>(code_map, shrink_by);
9323  if (code_map->length() == kEntriesStart) {
9325  }
9326 }

References ClearOptimizedCodeMap(), DCHECK, v8::internal::Heap::FROM_GC, v8::internal::HeapObject::GetHeap(), kEntriesStart, kEntryLength, v8::internal::FixedArrayBase::length(), length(), and v8::internal::Heap::RightTrimFixedArray().

Referenced by v8::internal::CodeFlusher::ProcessOptimizedCodeMaps().

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

◆ TryReenableOptimization()

void v8::internal::SharedFunctionInfo::TryReenableOptimization ( )
inline

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

5763  {
5764  int tries = opt_reenable_tries();
5766  // We reenable optimization whenever the number of tries is a large
5767  // enough power of 2.
5768  if (tries >= 16 && (((tries - 1) & tries) == 0)) {
5769  set_optimization_disabled(false);
5770  set_opt_count(0);
5771  set_deopt_count(0);
5772  code()->set_optimizable(true);
5773  }
5774 }
void set_opt_reenable_tries(int value)
Definition: objects-inl.h:5734

References v8::internal::BitFieldBase< T, shift, size, U >::kMax, opt_reenable_tries(), set_deopt_count(), set_opt_count(), and set_opt_reenable_tries().

Referenced by v8::internal::RuntimeProfiler::OptimizeNow().

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

◆ VerifyBailoutId()

bool v8::internal::SharedFunctionInfo::VerifyBailoutId ( BailoutId  id)

Definition at line 9912 of file objects.cc.

9912  {
9913  DCHECK(!id.IsNone());
9914  Code* unoptimized = code();
9915  DeoptimizationOutputData* data =
9916  DeoptimizationOutputData::cast(unoptimized->deoptimization_data());
9917  unsigned ignore = Deoptimizer::GetOutputInfo(data, id, this);
9918  USE(ignore);
9919  return true; // Return true if there was no DCHECK.
9920 }
static int GetOutputInfo(DeoptimizationOutputData *data, BailoutId node_id, SharedFunctionInfo *shared)
Definition: deoptimizer.cc:707
void USE(T)
Definition: macros.h:322

References DCHECK, v8::internal::Deoptimizer::GetOutputInfo(), and USE().

+ Here is the call graph for this function:

Member Data Documentation

◆ kAlignedSize

const int v8::internal::SharedFunctionInfo::kAlignedSize = POINTER_SIZE_ALIGN(kSize)
static

Definition at line 6979 of file objects.h.

Referenced by v8::internal::Heap::CreateInitialMaps().

◆ kAstNodeCountOffset

const int v8::internal::SharedFunctionInfo::kAstNodeCountOffset
static
Initial value:
=
static const int kCountersOffset
Definition: objects.h:6966
const int kIntSize
Definition: globals.h:124

Definition at line 6969 of file objects.h.

◆ kCachedCodeOffset

◆ kCodeOffset

◆ kCompilerHintsOffset

const int v8::internal::SharedFunctionInfo::kCompilerHintsOffset
static
Initial value:

Definition at line 6961 of file objects.h.

◆ kCompilerHintsSize

const int v8::internal::SharedFunctionInfo::kCompilerHintsSize = kIntSize
staticprivate

Definition at line 7033 of file objects.h.

◆ kCompilerHintsSmiTagSize

const int v8::internal::SharedFunctionInfo::kCompilerHintsSmiTagSize = 0
staticprivate

Definition at line 7032 of file objects.h.

◆ kConstructStubOffset

const int v8::internal::SharedFunctionInfo::kConstructStubOffset = kScopeInfoOffset + kPointerSize
static

◆ kContextOffset

const int v8::internal::SharedFunctionInfo::kContextOffset = 0
static

◆ kCountersOffset

const int v8::internal::SharedFunctionInfo::kCountersOffset
static
Initial value:

Definition at line 6966 of file objects.h.

◆ kDebugInfoOffset

const int v8::internal::SharedFunctionInfo::kDebugInfoOffset = kScriptOffset + kPointerSize
static

◆ kDontAdaptArgumentsSentinel

const int v8::internal::SharedFunctionInfo::kDontAdaptArgumentsSentinel = -1
static

◆ kEndPositionOffset

const int v8::internal::SharedFunctionInfo::kEndPositionOffset
static
Initial value:

Definition at line 6954 of file objects.h.

◆ kEntriesStart

◆ kEntryLength

◆ kExpectedNofPropertiesOffset

const int v8::internal::SharedFunctionInfo::kExpectedNofPropertiesOffset
static
Initial value:

Definition at line 6949 of file objects.h.

◆ kFeedbackVectorOffset

const int v8::internal::SharedFunctionInfo::kFeedbackVectorOffset
static

◆ kFormalParameterCountOffset

const int v8::internal::SharedFunctionInfo::kFormalParameterCountOffset
static
Initial value:

Definition at line 6946 of file objects.h.

◆ kFunctionDataOffset

const int v8::internal::SharedFunctionInfo::kFunctionDataOffset
static

◆ kFunctionTokenPositionOffset

const int v8::internal::SharedFunctionInfo::kFunctionTokenPositionOffset
static
Initial value:

Definition at line 6959 of file objects.h.

◆ kInferredNameOffset

const int v8::internal::SharedFunctionInfo::kInferredNameOffset = kDebugInfoOffset + kPointerSize
static

◆ kInitialLength

const int v8::internal::SharedFunctionInfo::kInitialLength = kEntriesStart + kEntryLength
static

Definition at line 6630 of file objects.h.

Referenced by AddToOptimizedCodeMap().

◆ kInstanceClassNameOffset

const int v8::internal::SharedFunctionInfo::kInstanceClassNameOffset
static

◆ kIsExpressionBit

const int v8::internal::SharedFunctionInfo::kIsExpressionBit = 0
static

Definition at line 6988 of file objects.h.

◆ kIsTopLevelBit

const int v8::internal::SharedFunctionInfo::kIsTopLevelBit = 1
static

Definition at line 6989 of file objects.h.

◆ kLengthOffset

const int v8::internal::SharedFunctionInfo::kLengthOffset
static
Initial value:

Definition at line 6944 of file objects.h.

◆ kLiteralsOffset

const int v8::internal::SharedFunctionInfo::kLiteralsOffset = 2
static

◆ kNameOffset

◆ kNativeBitWithinByte

const int v8::internal::SharedFunctionInfo::kNativeBitWithinByte
static
Initial value:

Definition at line 7046 of file objects.h.

◆ kNextMapIndex

◆ kNumLiteralsOffset

const int v8::internal::SharedFunctionInfo::kNumLiteralsOffset
static
Initial value:

Definition at line 6951 of file objects.h.

◆ kOptCountAndBailoutReasonOffset

const int v8::internal::SharedFunctionInfo::kOptCountAndBailoutReasonOffset
static
Initial value:

Definition at line 6964 of file objects.h.

◆ kOptimizedCodeMapOffset

◆ kOsrAstIdOffset

◆ kProfilerTicksOffset

const int v8::internal::SharedFunctionInfo::kProfilerTicksOffset
static
Initial value:

Definition at line 6971 of file objects.h.

◆ kScopeInfoOffset

const int v8::internal::SharedFunctionInfo::kScopeInfoOffset = kOptimizedCodeMapOffset + kPointerSize
static

◆ kScriptOffset

const int v8::internal::SharedFunctionInfo::kScriptOffset = kFunctionDataOffset + kPointerSize
static

◆ kSize

◆ kStartPositionAndTypeOffset

const int v8::internal::SharedFunctionInfo::kStartPositionAndTypeOffset
static
Initial value:

Definition at line 6956 of file objects.h.

◆ kStartPositionMask

const int v8::internal::SharedFunctionInfo::kStartPositionMask = ~((1 << kStartPositionShift) - 1)
static

Definition at line 6991 of file objects.h.

Referenced by set_start_position().

◆ kStartPositionShift

const int v8::internal::SharedFunctionInfo::kStartPositionShift = 2
static

Definition at line 6990 of file objects.h.

Referenced by set_start_position(), and start_position().

◆ kStrictModeBitWithinByte

const int v8::internal::SharedFunctionInfo::kStrictModeBitWithinByte
static
Initial value:

Definition at line 7043 of file objects.h.


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