v8  3.11.10(node0.8.26)
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, kLiveObjectsMayExist, kCodeAgeShift,
  kOptimizationDisabled = kCodeAgeShift + kCodeAgeSize, kStrictModeFunction, kExtendedModeFunction, kUsesArguments,
  kHasDuplicateParameters, kNative, kBoundFunction, kIsAnonymous,
  kNameShouldPrintAsAnonymous, kIsFunction, kDontOptimize, kDontInline,
  kCompilerHintsCount
}
 
typedef FixedBodyDescriptor
< kNameOffset,
kThisPropertyAssignmentsOffset+kPointerSize,
kSize
BodyDescriptor
 

Public Member Functions

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 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 ()
 
bool VerifyBailoutId (int 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)
 
void SharedFunctionInfoIterateBody (ObjectVisitor *v)
 
- 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 *global_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 ShortPrint ()
 
void ShortPrint (FILE *out)
 
void ShortPrint (StringStream *accumulator)
 

Static Public Member Functions

static bool EnsureCompiled (Handle< SharedFunctionInfo > shared, ClearExceptionFlag flag)
 
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 kGenerousAllocationCount = 8
 
static const int kDontAdaptArgumentsSentinel = -1
 
static const int kNameOffset = HeapObject::kHeaderSize
 
static const int kCodeOffset = kNameOffset + kPointerSize
 
static const int kScopeInfoOffset = kCodeOffset + 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 5215 of file objects.h.

Member Typedef Documentation

Member Enumeration Documentation

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

Definition at line 5722 of file objects.h.

Member Function Documentation

int ast_node_count ( )
inline
BuiltinFunctionId builtin_function_id ( )
inline

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

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

int CalculateInObjectProperties ( )
int code_age ( )
inline

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

References v8::internal::compiler_hints.

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

Definition at line 7458 of file objects.cc.

Referenced by SharedFunctionInfo::EnsureCompiled().

kPropertyAccessorsOffset kNamedPropertyHandlerOffset kInstanceTemplateOffset kAccessCheckInfoOffset kEvalFrominstructionsOffsetOffset kThisPropertyAssignmentsOffset kNeedsAccessCheckBit kIsExpressionBit kHasOnlySimpleThisPropertyAssignments kUsesArguments kFormalParameterCountOffset kStartPositionAndTypeOffset kCompilerHintsOffset kStressDeoptCounterOffset int construction_count ( )
inline

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

References READ_BYTE_FIELD.

Referenced by SharedFunctionInfo::StartInobjectSlackTracking().

int counters ( )
inline
int deopt_count ( )
inline

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

Referenced by RuntimeProfiler::OptimizeNow().

void DontAdaptArguments ( )
inline

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

References ASSERT, and Code::BUILTIN.

void EnableDeoptimizationSupport ( Code recompiled)
bool EnsureCompiled ( Handle< SharedFunctionInfo shared,
ClearExceptionFlag  flag 
)
static

Definition at line 7438 of file objects.cc.

References SharedFunctionInfo::CompileLazy().

int formal_parameter_count ( )
inline
int function_token_position ( )
inline
FunctionTemplateInfo * get_api_func_data ( )
inline

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

References ASSERT, and FunctionTemplateInfo::cast().

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

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

int ic_age ( )
inline
void increment_deopt_count ( )
inline

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

bool is_classic_mode ( )
inline

Definition at line 3860 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 3945 of file objects-inl.h.

bool is_extended_mode ( )
inline
bool IsApiFunction ( )
inline

Definition at line 3951 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 4012 of file objects-inl.h.

int profiler_ticks ( )
inline

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

References Code::FUNCTION.

void set_ast_node_count ( int  count)
inline
void set_code_age ( int  age)
inline

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

References v8::internal::compiler_hints.

void set_construction_count ( int  value)
inline

Definition at line 3792 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 3999 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 3989 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 4017 of file objects-inl.h.

void set_start_position ( int  start_position)
inline

Definition at line 3907 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 
)
void SharedFunctionInfoIterateBody ( ObjectVisitor *  v)
int SourceSize ( )
int start_position_and_type ( )
inline
int stress_deopt_counter ( )
inline
void TryReenableOptimization ( )
inline

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

Referenced by RuntimeProfiler::OptimizeNow().

Code * unchecked_code ( )
inline

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

References READ_FIELD.

bool VerifyBailoutId ( int  id)

Field Documentation

const int kAlignedSize = POINTER_SIZE_ALIGN(kSize)
static

Definition at line 5704 of file objects.h.

const int kAstNodeCountOffset
static
Initial value:

Definition at line 5622 of file objects.h.

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

Definition at line 5720 of file objects.h.

const int kCodeAgeSize = 3
static

Definition at line 5719 of file objects.h.

const int kCodeOffset = kNameOffset + kPointerSize
static

Definition at line 5606 of file objects.h.

const int kCompilerHintsOffset
static
Initial value:

Definition at line 5677 of file objects.h.

const int kConstructionCountOffset = kCompilerHintsOffset + 3
static

Definition at line 5697 of file objects.h.

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

Definition at line 5685 of file objects.h.

const int kDebugInfoOffset = kScriptOffset + kPointerSize
static

Definition at line 5614 of file objects.h.

const int kDontAdaptArgumentsSentinel = -1
static

Definition at line 5601 of file objects.h.

Referenced by JSFunction::NeedsArgumentsAdaption().

const int kEndPositionOffset
static
Initial value:

Definition at line 5670 of file objects.h.

const int kExpectedNofPropertiesOffset
static
Initial value:

Definition at line 5665 of file objects.h.

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

Definition at line 5767 of file objects.h.

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

Definition at line 5776 of file objects.h.

const int kFormalParameterCountOffset
static
Initial value:

Definition at line 5662 of file objects.h.

const int kFunctionDataOffset
static
Initial value:

Definition at line 5611 of file objects.h.

const int kFunctionTokenPositionOffset
static
Initial value:

Definition at line 5675 of file objects.h.

const int kGenerousAllocationCount = 8
static

Definition at line 5302 of file objects.h.

Referenced by SharedFunctionInfo::StartInobjectSlackTracking().

const int kInferredNameOffset = kDebugInfoOffset + kPointerSize
static

Definition at line 5615 of file objects.h.

const int kInitialMapOffset
static
Initial value:

Definition at line 5616 of file objects.h.

const int kInstanceClassNameOffset
static
Initial value:

Definition at line 5609 of file objects.h.

const int kIsExpressionBit = 0
static

Definition at line 5713 of file objects.h.

const int kIsTopLevelBit = 1
static

Definition at line 5714 of file objects.h.

const int kLengthOffset
static
Initial value:

Definition at line 5660 of file objects.h.

const int kNameOffset = HeapObject::kHeaderSize
static

Definition at line 5605 of file objects.h.

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

Definition at line 5770 of file objects.h.

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

Definition at line 5778 of file objects.h.

const int kNumLiteralsOffset
static
Initial value:

Definition at line 5667 of file objects.h.

const int kOptCountOffset
static
Initial value:

Definition at line 5682 of file objects.h.

const int kScopeInfoOffset = kCodeOffset + kPointerSize
static

Definition at line 5607 of file objects.h.

const int kScriptOffset = kFunctionDataOffset + kPointerSize
static

Definition at line 5613 of file objects.h.

const int kSize = kStressDeoptCounterOffset + kIntSize
static

Definition at line 5689 of file objects.h.

const int kStartPositionAndTypeOffset
static
Initial value:

Definition at line 5672 of file objects.h.

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

Definition at line 5716 of file objects.h.

const int kStartPositionShift = 2
static

Definition at line 5715 of file objects.h.

const int kStressDeoptCounterOffset = kCountersOffset + kIntSize
static

Definition at line 5686 of file objects.h.

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

Definition at line 5764 of file objects.h.

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

Definition at line 5774 of file objects.h.

const int kThisPropertyAssignmentsCountOffset
static
Initial value:

Definition at line 5680 of file objects.h.

const int kThisPropertyAssignmentsOffset
static
Initial value:

Definition at line 5618 of file objects.h.


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