v8  3.14.5(node0.10.28)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SharedFunctionInfo Class Reference

#include <objects.h>

Inheritance diagram for SharedFunctionInfo:
Collaboration diagram for SharedFunctionInfo:

Data Structures

class  DeoptCountBits
 
class  ICAgeBits
 
class  OptReenableTriesBits
 

Public Types

enum  CompilerHints {
  kHasOnlySimpleThisPropertyAssignments, kAllowLazyCompilation, kAllowLazyCompilationWithoutContext, kLiveObjectsMayExist,
  kCodeAgeShift, kOptimizationDisabled = kCodeAgeShift + kCodeAgeSize, kStrictModeFunction, kExtendedModeFunction,
  kUsesArguments, kHasDuplicateParameters, kNative, kBoundFunction,
  kIsAnonymous, kNameShouldPrintAsAnonymous, kIsFunction, kDontOptimize,
  kDontInline, kDontCache, kCompilerHintsCount
}
 
typedef FixedBodyDescriptor
< kNameOffset,
kThisPropertyAssignmentsOffset+kPointerSize,
kSize
BodyDescriptor
 

Public Member Functions

int SearchOptimizedCodeMap (Context *native_context)
 
void InstallFromOptimizedCodeMap (JSFunction *function, int index)
 
void ClearOptimizedCodeMap ()
 
Codeunchecked_code ()
 
bool is_compiled ()
 
int length ()
 
void set_length (int value)
 
int formal_parameter_count ()
 
void set_formal_parameter_count (int value)
 
void DontAdaptArguments ()
 
int expected_nof_properties ()
 
void set_expected_nof_properties (int value)
 
int construction_count ()
 
void set_construction_count (int value)
 
bool IsInobjectSlackTrackingInProgress ()
 
void StartInobjectSlackTracking (Map *map)
 
void CompleteInobjectSlackTracking ()
 
void BeforeVisitingPointers ()
 
void DetachInitialMap ()
 
void AttachInitialMap (Map *map)
 
bool IsApiFunction ()
 
FunctionTemplateInfoget_api_func_data ()
 
bool HasBuiltinFunctionId ()
 
BuiltinFunctionId builtin_function_id ()
 
int num_literals ()
 
void set_num_literals (int value)
 
int start_position_and_type ()
 
void set_start_position_and_type (int value)
 
StringDebugName ()
 
int function_token_position ()
 
void set_function_token_position (int function_token_position)
 
int start_position ()
 
void set_start_position (int start_position)
 
int end_position ()
 
void set_end_position (int end_position)
 
int compiler_hints ()
 
void set_compiler_hints (int value)
 
int ast_node_count ()
 
void set_ast_node_count (int count)
 
int stress_deopt_counter ()
 
void set_stress_deopt_counter (int counter)
 
int profiler_ticks ()
 
int ic_age ()
 
void set_ic_age (int age)
 
void SetThisPropertyAssignmentsInfo (bool has_only_simple_this_property_assignments, FixedArray *this_property_assignments)
 
void ClearThisPropertyAssignmentsInfo ()
 
bool has_only_simple_this_property_assignments ()
 
int code_age ()
 
void set_code_age (int age)
 
LanguageMode language_mode ()
 
void set_language_mode (LanguageMode language_mode)
 
bool is_classic_mode ()
 
bool is_extended_mode ()
 
bool has_deoptimization_support ()
 
void EnableDeoptimizationSupport (Code *recompiled)
 
void DisableOptimization (const char *reason)
 
bool VerifyBailoutId (BailoutId id)
 
bool CanGenerateInlineConstructor (Object *prototype)
 
void ForbidInlineConstructor ()
 
int this_property_assignments_count ()
 
void set_this_property_assignments_count (int value)
 
StringGetThisPropertyAssignmentName (int index)
 
bool IsThisPropertyAssignmentArgument (int index)
 
int GetThisPropertyAssignmentArgument (int index)
 
ObjectGetThisPropertyAssignmentConstant (int index)
 
bool HasSourceCode ()
 
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 ()
 
int SourceSize ()
 
int CalculateInstanceSize ()
 
int CalculateInObjectProperties ()
 
void SourceCodePrint (StringStream *accumulator, int max_length)
 
void ResetForNewContext (int new_ic_age)
 
- Public Member Functions inherited from HeapObject
Mapmap ()
 
void set_map (Map *value)
 
void set_map_no_write_barrier (Map *value)
 
MapWord map_word ()
 
void set_map_word (MapWord map_word)
 
HeapGetHeap ()
 
IsolateGetIsolate ()
 
Address address ()
 
void Iterate (ObjectVisitor *v)
 
void IterateBody (InstanceType type, int object_size, ObjectVisitor *v)
 
int Size ()
 
int SizeFromMap (Map *map)
 
WriteBarrierMode GetWriteBarrierMode (const AssertNoAllocation &)
 
void HeapObjectShortPrint (StringStream *accumulator)
 
 STATIC_CHECK (kMapOffset==Internals::kHeapObjectMapOffset)
 
- Public Member Functions inherited from Object
bool IsObject ()
 
bool IsFixedArrayBase ()
 
bool IsInstanceOf (FunctionTemplateInfo *type)
 
bool IsStruct ()
 
 INLINE (bool IsSpecObject())
 
 INLINE (bool IsSpecFunction())
 
 INLINE (bool IsUndefined())
 
 INLINE (bool IsNull())
 
 INLINE (bool IsTheHole())
 
 INLINE (bool IsTrue())
 
 INLINE (bool IsFalse())
 
bool IsArgumentsMarker ()
 
bool NonFailureIsHeapObject ()
 
bool IsFiller ()
 
double Number ()
 
bool IsNaN ()
 
bool HasValidElements ()
 
bool HasSpecificClassOf (String *name)
 
MUST_USE_RESULT MaybeObject * ToObject ()
 
ObjectToBoolean ()
 
MUST_USE_RESULT MaybeObject * ToObject (Context *native_context)
 
MUST_USE_RESULT MaybeObject * ToSmi ()
 
void Lookup (String *name, LookupResult *result)
 
MUST_USE_RESULT MaybeObject * GetProperty (String *key)
 
MUST_USE_RESULT MaybeObject * GetProperty (String *key, PropertyAttributes *attributes)
 
MUST_USE_RESULT MaybeObject * GetPropertyWithReceiver (Object *receiver, String *key, PropertyAttributes *attributes)
 
MUST_USE_RESULT MaybeObject * GetProperty (Object *receiver, LookupResult *result, String *key, PropertyAttributes *attributes)
 
MUST_USE_RESULT MaybeObject * GetPropertyWithDefinedGetter (Object *receiver, JSReceiver *getter)
 
MUST_USE_RESULT MaybeObject * GetElement (uint32_t index)
 
ObjectGetElementNoExceptionThrown (uint32_t index)
 
MUST_USE_RESULT MaybeObject * GetElementWithReceiver (Object *receiver, uint32_t index)
 
ObjectGetPrototype ()
 
MUST_USE_RESULT MaybeObject * GetHash (CreationFlag flag)
 
bool SameValue (Object *other)
 
bool ToArrayIndex (uint32_t *index)
 
bool IsStringObjectWithCharacterAt (uint32_t index)
 
void VerifyApiCallResultType ()
 
void ShortPrint ()
 
void ShortPrint (FILE *out)
 
void ShortPrint (StringStream *accumulator)
 

Static Public Member Functions

static void AddToOptimizedCodeMap (Handle< SharedFunctionInfo > shared, Handle< Context > native_context, Handle< Code > code, Handle< FixedArray > literals)
 
static bool CompileLazy (Handle< SharedFunctionInfo > shared, ClearExceptionFlag flag)
 
static SharedFunctionInfocast (Object *obj)
 
- Static Public Member Functions inherited from HeapObject
static HeapObjectFromAddress (Address address)
 
static Object ** RawField (HeapObject *obj, int offset)
 
static HeapObjectcast (Object *obj)
 
- Static Public Member Functions inherited from Object
static Handle< ObjectGetProperty (Handle< Object > object, Handle< Object > receiver, LookupResult *result, Handle< String > key, PropertyAttributes *attributes)
 
static Handle< ObjectGetElement (Handle< Object > object, uint32_t index)
 
static Objectcast (Object *value)
 

Static Public Attributes

static const int kEntryLength = 3
 
static const int kGenerousAllocationCount = 8
 
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 kInitialMapOffset
 
static const int kThisPropertyAssignmentsOffset
 
static const int kAstNodeCountOffset
 
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 kThisPropertyAssignmentsCountOffset
 
static const int kOptCountOffset
 
static const int kCountersOffset = kOptCountOffset + kIntSize
 
static const int kStressDeoptCounterOffset = kCountersOffset + kIntSize
 
static const int kSize = kStressDeoptCounterOffset + kIntSize
 
static const int kConstructionCountOffset = kCompilerHintsOffset + 3
 
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 kCodeAgeSize = 3
 
static const int kCodeAgeMask = (1 << kCodeAgeSize) - 1
 
static const int kStrictModeBitWithinByte
 
static const int kExtendedModeBitWithinByte
 
static const int kNativeBitWithinByte
 
static const int kStrictModeByteOffset
 
static const int kExtendedModeByteOffset
 
static const int kNativeByteOffset
 
- Static Public Attributes inherited from HeapObject
static const int kMapOffset = Object::kHeaderSize
 
static const int kHeaderSize = kMapOffset + kPointerSize
 
- Static Public Attributes inherited from Object
static const int kHeaderSize = 0
 

Additional Inherited Members

- Protected Member Functions inherited from HeapObject
void IteratePointers (ObjectVisitor *v, int start, int end)
 
void IteratePointer (ObjectVisitor *v, int offset)
 

Detailed Description

Definition at line 5374 of file objects.h.

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
kHasOnlySimpleThisPropertyAssignments 
kAllowLazyCompilation 
kAllowLazyCompilationWithoutContext 
kLiveObjectsMayExist 
kCodeAgeShift 
kOptimizationDisabled 
kStrictModeFunction 
kExtendedModeFunction 
kUsesArguments 
kHasDuplicateParameters 
kNative 
kBoundFunction 
kIsAnonymous 
kNameShouldPrintAsAnonymous 
kIsFunction 
kDontOptimize 
kDontInline 
kDontCache 
kCompilerHintsCount 

Definition at line 5913 of file objects.h.

Member Function Documentation

void AddToOptimizedCodeMap ( Handle< SharedFunctionInfo shared,
Handle< Context native_context,
Handle< Code code,
Handle< FixedArray literals 
)
static
int ast_node_count ( )
inline
void BeforeVisitingPointers ( )
inline
BuiltinFunctionId builtin_function_id ( )
inline

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

References ASSERT, Smi::cast(), and Smi::value().

int CalculateInObjectProperties ( )
void ClearOptimizedCodeMap ( )

Definition at line 7578 of file objects.cc.

References Smi::FromInt().

Referenced by Heap::AllocateSharedFunctionInfo().

int code_age ( )
inline
bool CompileLazy ( Handle< SharedFunctionInfo shared,
ClearExceptionFlag  flag 
)
static

Definition at line 7570 of file objects.cc.

References ASSERT.

kPropertyAccessorsOffset kNamedPropertyHandlerOffset kInstanceTemplateOffset kAccessCheckInfoOffset kEvalFrominstructionsOffsetOffset kInstanceClassNameOffset kHiddenPrototypeBit kReadOnlyPrototypeBit kIsTopLevelBit kAllowLazyCompilation kUsesArguments kFormalParameterCountOffset kStartPositionAndTypeOffset kCompilerHintsOffset kStressDeoptCounterOffset int construction_count ( )
inline

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

References READ_BYTE_FIELD.

Referenced by SharedFunctionInfo::StartInobjectSlackTracking().

int counters ( )
inline
int deopt_count ( )
inline

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

Referenced by RuntimeProfiler::OptimizeNow().

void DisableOptimization ( const char *  reason)
void DontAdaptArguments ( )
inline

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

References ASSERT, BUILTIN, and v8::internal::code().

void EnableDeoptimizationSupport ( Code recompiled)
int formal_parameter_count ( )
inline
int function_token_position ( )
inline
FunctionTemplateInfo * get_api_func_data ( )
inline

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

References ASSERT, and FunctionTemplateInfo::cast().

int GetThisPropertyAssignmentArgument ( int  index)
Object * GetThisPropertyAssignmentConstant ( int  index)
String * GetThisPropertyAssignmentName ( int  index)
bool has_deoptimization_support ( )
inline
bool has_only_simple_this_property_assignments ( )
inline
bool HasBuiltinFunctionId ( )
inline

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

int ic_age ( )
inline
void increment_deopt_count ( )
inline

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

void InstallFromOptimizedCodeMap ( JSFunction function,
int  index 
)
bool is_classic_mode ( )
inline

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

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

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

bool is_compiled ( )
inline

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

References v8::internal::code().

Referenced by StaticMarkingVisitor< StaticVisitor >::IsFlushable().

bool is_extended_mode ( )
inline
bool IsApiFunction ( )
inline

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

bool IsInobjectSlackTrackingInProgress ( )
inline
int length ( )
inline
int num_literals ( )
inline
int opt_count ( )
inline
int opt_reenable_tries ( )
inline

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

int profiler_ticks ( )
inline

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

References v8::internal::code().

int SearchOptimizedCodeMap ( Context native_context)
void set_ast_node_count ( int  count)
inline
void set_code_age ( int  age)
inline
void set_construction_count ( int  value)
inline

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

References ASSERT, and WRITE_BYTE_FIELD.

Referenced by SharedFunctionInfo::StartInobjectSlackTracking().

void set_counters ( int  value)
inline
void set_deopt_count ( int  value)
inline

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

Referenced by SharedFunctionInfo::ResetForNewContext().

void set_end_position ( int  end_position)
inline
void set_expected_nof_properties ( int  value)
inline
void set_formal_parameter_count ( int  value)
inline
void set_function_token_position ( int  function_token_position)
inline
void set_ic_age ( int  age)
inline

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

Referenced by SharedFunctionInfo::ResetForNewContext().

void set_language_mode ( LanguageMode  language_mode)
inline
void set_length ( int  value)
inline
void set_num_literals ( int  value)
inline
void set_opt_count ( int  opt_count)
inline
void set_opt_reenable_tries ( int  value)
inline

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

void set_start_position ( int  start_position)
inline

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

References v8::internal::start_position_and_type.

void set_start_position_and_type ( int  value)
inline
void set_stress_deopt_counter ( int  counter)
inline
void SetThisPropertyAssignmentsInfo ( bool  has_only_simple_this_property_assignments,
FixedArray this_property_assignments 
)
int SourceSize ( )
int start_position_and_type ( )
inline
int stress_deopt_counter ( )
inline
void TryReenableOptimization ( )
inline

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

References v8::internal::code().

Referenced by RuntimeProfiler::OptimizeNow().

Code * unchecked_code ( )
inline

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

References READ_FIELD.

bool VerifyBailoutId ( BailoutId  id)

Field Documentation

const int kAlignedSize = POINTER_SIZE_ALIGN(kSize)
static

Definition at line 5895 of file objects.h.

const int kAstNodeCountOffset
static
Initial value:

Definition at line 5813 of file objects.h.

const int kCodeAgeMask = (1 << kCodeAgeSize) - 1
static

Definition at line 5911 of file objects.h.

const int kCodeAgeSize = 3
static

Definition at line 5910 of file objects.h.

const int kCodeOffset = kNameOffset + kPointerSize
static
const int kCompilerHintsOffset
static
Initial value:

Definition at line 5868 of file objects.h.

const int kConstructionCountOffset = kCompilerHintsOffset + 3
static

Definition at line 5888 of file objects.h.

const int kConstructStubOffset = kScopeInfoOffset + kPointerSize
static
const int kCountersOffset = kOptCountOffset + kIntSize
static

Definition at line 5876 of file objects.h.

const int kDebugInfoOffset = kScriptOffset + kPointerSize
static

Definition at line 5805 of file objects.h.

const int kDontAdaptArgumentsSentinel = -1
static

Definition at line 5791 of file objects.h.

Referenced by JSFunction::NeedsArgumentsAdaption().

const int kEndPositionOffset
static
Initial value:

Definition at line 5861 of file objects.h.

const int kEntryLength = 3
static

Definition at line 5403 of file objects.h.

Referenced by SharedFunctionInfo::AddToOptimizedCodeMap().

const int kExpectedNofPropertiesOffset
static
Initial value:

Definition at line 5856 of file objects.h.

const int kExtendedModeBitWithinByte
static
Initial value:
=
(kExtendedModeFunction + kCompilerHintsSmiTagSize) % kBitsPerByte

Definition at line 5960 of file objects.h.

const int kExtendedModeByteOffset
static
Initial value:
(kExtendedModeFunction + kCompilerHintsSmiTagSize) / kBitsPerByte

Definition at line 5969 of file objects.h.

const int kFormalParameterCountOffset
static
Initial value:

Definition at line 5853 of file objects.h.

const int kFunctionDataOffset
static
Initial value:

Definition at line 5802 of file objects.h.

const int kFunctionTokenPositionOffset
static
Initial value:

Definition at line 5866 of file objects.h.

const int kGenerousAllocationCount = 8
static

Definition at line 5484 of file objects.h.

Referenced by SharedFunctionInfo::StartInobjectSlackTracking().

const int kInferredNameOffset = kDebugInfoOffset + kPointerSize
static

Definition at line 5806 of file objects.h.

const int kInitialMapOffset
static
Initial value:

Definition at line 5807 of file objects.h.

const int kInstanceClassNameOffset
static
Initial value:

Definition at line 5800 of file objects.h.

const int kIsExpressionBit = 0
static

Definition at line 5904 of file objects.h.

const int kIsTopLevelBit = 1
static

Definition at line 5905 of file objects.h.

const int kLengthOffset
static
Initial value:

Definition at line 5851 of file objects.h.

const int kNameOffset = HeapObject::kHeaderSize
static
const int kNativeBitWithinByte
static
Initial value:
=
(kNative + kCompilerHintsSmiTagSize) % kBitsPerByte

Definition at line 5963 of file objects.h.

const int kNativeByteOffset
static
Initial value:
(kNative + kCompilerHintsSmiTagSize) / kBitsPerByte

Definition at line 5971 of file objects.h.

const int kNumLiteralsOffset
static
Initial value:

Definition at line 5858 of file objects.h.

const int kOptCountOffset
static
Initial value:

Definition at line 5873 of file objects.h.

const int kOptimizedCodeMapOffset = kCodeOffset + kPointerSize
static
const int kScopeInfoOffset = kOptimizedCodeMapOffset + kPointerSize
static

Definition at line 5798 of file objects.h.

const int kScriptOffset = kFunctionDataOffset + kPointerSize
static

Definition at line 5804 of file objects.h.

const int kSize = kStressDeoptCounterOffset + kIntSize
static

Definition at line 5880 of file objects.h.

const int kStartPositionAndTypeOffset
static
Initial value:

Definition at line 5863 of file objects.h.

const int kStartPositionMask = ~((1 << kStartPositionShift) - 1)
static

Definition at line 5907 of file objects.h.

const int kStartPositionShift = 2
static

Definition at line 5906 of file objects.h.

const int kStressDeoptCounterOffset = kCountersOffset + kIntSize
static

Definition at line 5877 of file objects.h.

const int kStrictModeBitWithinByte
static
Initial value:
=
(kStrictModeFunction + kCompilerHintsSmiTagSize) % kBitsPerByte

Definition at line 5957 of file objects.h.

const int kStrictModeByteOffset
static
Initial value:
(kStrictModeFunction + kCompilerHintsSmiTagSize) / kBitsPerByte

Definition at line 5967 of file objects.h.

const int kThisPropertyAssignmentsCountOffset
static
Initial value:

Definition at line 5871 of file objects.h.

const int kThisPropertyAssignmentsOffset
static
Initial value:

Definition at line 5809 of file objects.h.


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