v8  3.25.30(node0.11.13)
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  DisabledOptimizationReasonBits
 
class  ICAgeBits
 
class  OptCountBits
 
class  OptReenableTriesBits
 

Public Types

enum  CompilerHints {
  kAllowLazyCompilation, kAllowLazyCompilationWithoutContext, kLiveObjectsMayExist, kOptimizationDisabled,
  kStrictModeFunction, kUsesArguments, kHasDuplicateParameters, kNative,
  kInlineBuiltin, kBoundFunction, kIsAnonymous, kNameShouldPrintAsAnonymous,
  kIsFunction, kDontOptimize, kDontInline, kDontCache,
  kDontFlush, kIsGenerator, kCompilerHintsCount
}
 
typedef FixedBodyDescriptor
< kNameOffset,
kInitialMapOffset+kPointerSize,
kSize
BodyDescriptor
 
- Public Types inherited from Object
enum  ValueType { OPTIMAL_REPRESENTATION, FORCE_TAGGED }
 

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 TrimOptimizedCodeMap (int shrink_by)
 
MUST_USE_RESULT MaybeObject * AddToOptimizedCodeMap (Context *native_context, Code *code, FixedArray *literals, BailoutId osr_ast_id)
 
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 profiler_ticks ()
 
int ic_age ()
 
void set_ic_age (int age)
 
StrictMode strict_mode ()
 
void set_strict_mode (StrictMode strict_mode)
 
bool has_deoptimization_support ()
 
void EnableDeoptimizationSupport (Code *recompiled)
 
void DisableOptimization (BailoutReason reason)
 
BailoutReason DisableOptimizationReason ()
 
bool VerifyBailoutId (BailoutId id)
 
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 ()
 
void set_opt_count_and_bailout_reason (int value)
 
int opt_count_and_bailout_reason ()
 
void set_bailout_reason (BailoutReason reason)
 
void set_dont_optimize_reason (BailoutReason reason)
 
bool IsInlineable ()
 
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 DisallowHeapAllocation &promise)
 
void HeapObjectShortPrint (StringStream *accumulator)
 
 STATIC_CHECK (kMapOffset==Internals::kHeapObjectMapOffset)
 
- Public Member Functions inherited from Object
bool IsObject ()
 
bool IsFixedArrayBase ()
 
bool IsExternal ()
 
bool IsAccessorInfo ()
 
bool IsStruct ()
 
 INLINE (bool IsSpecObject())
 
 INLINE (bool IsSpecFunction())
 
bool IsCallable ()
 
 INLINE (bool IsUndefined())
 
 INLINE (bool IsNull())
 
 INLINE (bool IsTheHole())
 
 INLINE (bool IsUninitialized())
 
 INLINE (bool IsTrue())
 
 INLINE (bool IsFalse())
 
bool IsArgumentsMarker ()
 
bool NonFailureIsHeapObject ()
 
bool IsFiller ()
 
double Number ()
 
bool IsNaN ()
 
bool ToInt32 (int32_t *value)
 
bool ToUint32 (uint32_t *value)
 
Representation OptimalRepresentation (ValueType type=OPTIMAL_REPRESENTATION)
 
bool FitsRepresentation (Representation representation)
 
MaybeObject * AllocateNewStorageFor (Heap *heap, Representation representation)
 
bool HasValidElements ()
 
bool HasSpecificClassOf (String *name)
 
MUST_USE_RESULT MaybeObject * ToObject (Isolate *isolate)
 
bool BooleanValue ()
 
MUST_USE_RESULT MaybeObject * ToObject (Context *native_context)
 
MUST_USE_RESULT MaybeObject * ToSmi ()
 
void Lookup (Name *name, LookupResult *result)
 
MUST_USE_RESULT MaybeObject * GetProperty (Name *key)
 
MUST_USE_RESULT MaybeObject * GetProperty (Name *key, PropertyAttributes *attributes)
 
MUST_USE_RESULT MaybeObject * GetPropertyWithReceiver (Object *receiver, Name *key, PropertyAttributes *attributes)
 
MUST_USE_RESULT MaybeObject * GetProperty (Object *receiver, LookupResult *result, Name *key, PropertyAttributes *attributes)
 
MUST_USE_RESULT MaybeObject * GetPropertyWithDefinedGetter (Object *receiver, JSReceiver *getter)
 
ObjectGetPrototype (Isolate *isolate)
 
MapGetMarkerMap (Isolate *isolate)
 
ObjectGetHash ()
 
bool SameValue (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 SharedFunctionInfocast (Object *obj)
 
- Static Public Member Functions inherited from 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 HeapObjectcast (Object *obj)
 
- Static Public Member Functions inherited from Object
static MUST_USE_RESULT Handle
< Object
ToSmi (Isolate *isolate, Handle< Object > object)
 
static Handle< ObjectGetPropertyWithReceiver (Handle< Object > object, Handle< Object > receiver, Handle< Name > name, PropertyAttributes *attributes)
 
static Handle< ObjectGetProperty (Handle< Object > object, Handle< Name > key)
 
static Handle< ObjectGetProperty (Handle< Object > object, Handle< Object > receiver, LookupResult *result, Handle< Name > key, PropertyAttributes *attributes)
 
static MUST_USE_RESULT
MaybeObject * 
GetPropertyOrFail (Handle< Object > object, Handle< Object > receiver, LookupResult *result, Handle< Name > key, PropertyAttributes *attributes)
 
static Handle< ObjectGetElement (Isolate *isolate, Handle< Object > object, uint32_t index)
 
static Handle< ObjectGetElementNoExceptionThrown (Isolate *isolate, Handle< Object > object, uint32_t index)
 
static Handle< ObjectGetElementWithReceiver (Isolate *isolate, Handle< Object > object, Handle< Object > receiver, uint32_t index)
 
static Handle< ObjectGetOrCreateHash (Handle< Object > object, Isolate *isolate)
 
static Objectcast (Object *value)
 

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 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 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 kOptCountAndBailoutReasonOffset
 
static const int kCountersOffset
 
static const int kSize = kCountersOffset + 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 kStrictModeBitWithinByte
 
static const int kNativeBitWithinByte
 
static const int kStrictModeByteOffset
 
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)
 
void IterateNextCodeLink (ObjectVisitor *v, int offset)
 

Detailed Description

Definition at line 6696 of file objects.h.

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
kAllowLazyCompilation 
kAllowLazyCompilationWithoutContext 
kLiveObjectsMayExist 
kOptimizationDisabled 
kStrictModeFunction 
kUsesArguments 
kHasDuplicateParameters 
kNative 
kInlineBuiltin 
kBoundFunction 
kIsAnonymous 
kNameShouldPrintAsAnonymous 
kIsFunction 
kDontOptimize 
kDontInline 
kDontCache 
kDontFlush 
kIsGenerator 
kCompilerHintsCount 

Definition at line 7211 of file objects.h.

Member Function Documentation

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

Definition at line 9490 of file objects.cc.

References CALL_HEAP_FUNCTION_VOID.

int ast_node_count ( )
inline
void BeforeVisitingPointers ( )
inline
BuiltinFunctionId builtin_function_id ( )
inline
int CalculateInObjectProperties ( )
int compiler_hints ( )
inline
int construction_count ( )
inline
int formal_parameter_count ( )
inline
int function_token_position ( )
inline
FunctionTemplateInfo * get_api_func_data ( )
inline
Code * GetCodeFromOptimizedCodeMap ( int  index)
FixedArray * GetLiteralsFromOptimizedCodeMap ( int  index)
bool has_deoptimization_support ( )
inline
bool HasBuiltinFunctionId ( )
inline

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

Referenced by SharedFunctionInfo::builtin_function_id().

int ic_age ( )
inline
bool is_compiled ( )
inline
bool IsApiFunction ( )
inline

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

Referenced by SharedFunctionInfo::get_api_func_data().

bool IsInlineable ( )

Definition at line 9924 of file objects.cc.

References v8::internal::code().

bool IsInobjectSlackTrackingInProgress ( )
inline
int num_literals ( )
inline
int opt_reenable_tries ( )
inline
int profiler_ticks ( )
inline

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

References v8::internal::code().

void set_ast_node_count ( int  count)
inline
void set_bailout_reason ( BailoutReason  reason)
inline

Definition at line 7063 of file objects.h.

Referenced by SharedFunctionInfo::DisableOptimization().

void set_compiler_hints ( int  value)
inline
void set_construction_count ( int  value)
inline
void set_dont_optimize_reason ( BailoutReason  reason)
inline

Definition at line 7069 of file objects.h.

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_length ( int  value)
inline
void set_num_literals ( int  value)
inline
void set_opt_count_and_bailout_reason ( int  value)
inline
void set_start_position_and_type ( int  value)
inline
int SourceSize ( )
int start_position_and_type ( )
inline
bool VerifyBailoutId ( BailoutId  id)

Field Documentation

const int kAlignedSize = POINTER_SIZE_ALIGN(kSize)
static

Definition at line 7196 of file objects.h.

const int kAstNodeCountOffset
static
Initial value:

Definition at line 7118 of file objects.h.

const int kCompilerHintsOffset
static
Initial value:

Definition at line 7171 of file objects.h.

const int kConstructionCountOffset = kCompilerHintsOffset + 3
static
const int kConstructStubOffset = kScopeInfoOffset + kPointerSize
static
const int kCountersOffset
static
Initial value:

Definition at line 7177 of file objects.h.

const int kDebugInfoOffset = kScriptOffset + kPointerSize
static

Definition at line 7112 of file objects.h.

const int kDontAdaptArgumentsSentinel = -1
static
const int kEndPositionOffset
static
Initial value:

Definition at line 7164 of file objects.h.

const int kExpectedNofPropertiesOffset
static
Initial value:

Definition at line 7159 of file objects.h.

const int kFormalParameterCountOffset
static
Initial value:

Definition at line 7156 of file objects.h.

const int kFunctionDataOffset
static
Initial value:

Definition at line 7109 of file objects.h.

const int kFunctionTokenPositionOffset
static
Initial value:

Definition at line 7169 of file objects.h.

const int kGenerousAllocationCount = 8
static

Definition at line 6827 of file objects.h.

Referenced by SharedFunctionInfo::StartInobjectSlackTracking(), and TEST().

const int kInferredNameOffset = kDebugInfoOffset + kPointerSize
static

Definition at line 7113 of file objects.h.

const int kInitialLength = kEntriesStart + kEntryLength
static

Definition at line 6748 of file objects.h.

Referenced by SharedFunctionInfo::AddToOptimizedCodeMap().

const int kInitialMapOffset
static
Initial value:

Definition at line 7114 of file objects.h.

const int kInstanceClassNameOffset
static
Initial value:

Definition at line 7107 of file objects.h.

const int kIsExpressionBit = 0
static

Definition at line 7205 of file objects.h.

const int kIsTopLevelBit = 1
static

Definition at line 7206 of file objects.h.

const int kLengthOffset
static
Initial value:

Definition at line 7154 of file objects.h.

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

Definition at line 7261 of file objects.h.

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

Definition at line 7267 of file objects.h.

const int kNextMapIndex = 0
static
const int kNumLiteralsOffset
static
Initial value:

Definition at line 7161 of file objects.h.

const int kOptCountAndBailoutReasonOffset
static
Initial value:

Definition at line 7174 of file objects.h.

const int kScopeInfoOffset = kOptimizedCodeMapOffset + kPointerSize
static

Definition at line 7105 of file objects.h.

const int kScriptOffset = kFunctionDataOffset + kPointerSize
static

Definition at line 7111 of file objects.h.

const int kSize = kCountersOffset + kIntSize
static

Definition at line 7181 of file objects.h.

const int kStartPositionAndTypeOffset
static
Initial value:

Definition at line 7166 of file objects.h.

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

Definition at line 7208 of file objects.h.

Referenced by SharedFunctionInfo::set_start_position().

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

Definition at line 7258 of file objects.h.

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

Definition at line 7265 of file objects.h.


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