v8-profiler.h   v8-profiler.h 
skipping to change at line 107 skipping to change at line 107
/** Returns the count of samples where function exists. */ /** Returns the count of samples where function exists. */
double GetTotalSamplesCount() const; double GetTotalSamplesCount() const;
/** Returns the count of samples where function was currently executing. */ /** Returns the count of samples where function was currently executing. */
double GetSelfSamplesCount() const; double GetSelfSamplesCount() const;
/** Returns function entry UID. */ /** Returns function entry UID. */
unsigned GetCallUid() const; unsigned GetCallUid() const;
/** Returns id of the node. The id is unique within the tree */
unsigned GetNodeId() const;
/** Returns child nodes count of the node. */ /** Returns child nodes count of the node. */
int GetChildrenCount() const; int GetChildrenCount() const;
/** Retrieves a child node by index. */ /** Retrieves a child node by index. */
const CpuProfileNode* GetChild(int index) const; const CpuProfileNode* GetChild(int index) const;
static const int kNoLineNumberInfo = Message::kNoLineNumberInfo; static const int kNoLineNumberInfo = Message::kNoLineNumberInfo;
}; };
/** /**
skipping to change at line 132 skipping to change at line 135
/** Returns CPU profile UID (assigned by the profiler.) */ /** Returns CPU profile UID (assigned by the profiler.) */
unsigned GetUid() const; unsigned GetUid() const;
/** Returns CPU profile title. */ /** Returns CPU profile title. */
Handle<String> GetTitle() const; Handle<String> GetTitle() const;
/** Returns the root node of the top down call tree. */ /** Returns the root node of the top down call tree. */
const CpuProfileNode* GetTopDownRoot() const; const CpuProfileNode* GetTopDownRoot() const;
/** /**
* Returns number of samples recorded. The samples are not recorded unle
ss
* |record_samples| parameter of CpuProfiler::StartCpuProfiling is true.
*/
int GetSamplesCount() const;
/**
* Returns profile node corresponding to the top frame the sample at
* the given index.
*/
const CpuProfileNode* GetSample(int index) const;
/**
* Deletes the profile and removes it from CpuProfiler's list. * Deletes the profile and removes it from CpuProfiler's list.
* All pointers to nodes previously returned become invalid. * All pointers to nodes previously returned become invalid.
* Profiles with the same uid but obtained using different * Profiles with the same uid but obtained using different
* security token are not deleted, but become inaccessible * security token are not deleted, but become inaccessible
* using FindProfile method. It is embedder's responsibility * using FindProfile method. It is embedder's responsibility
* to call Delete on these profiles. * to call Delete on these profiles.
*/ */
void Delete(); void Delete();
}; };
/** /**
* Interface for controlling CPU profiling. * Interface for controlling CPU profiling. Instance of the
* profiler can be retrieved using v8::Isolate::GetCpuProfiler.
*/ */
class V8EXPORT CpuProfiler { class V8EXPORT CpuProfiler {
public: public:
/** /**
* A note on security tokens usage. As scripts from different * A note on security tokens usage. As scripts from different
* origins can run inside a single V8 instance, it is possible to * origins can run inside a single V8 instance, it is possible to
* have functions from different security contexts intermixed in a * have functions from different security contexts intermixed in a
* single CPU profile. To avoid exposing function names belonging to * single CPU profile. To avoid exposing function names belonging to
* other contexts, filtering by security token is performed while * other contexts, filtering by security token is performed while
* obtaining profiling results. * obtaining profiling results.
*/ */
/** Deprecated. Use GetProfileCount instead. */
static int GetProfilesCount();
/** /**
* Returns the number of profiles collected (doesn't include * Returns the number of profiles collected (doesn't include
* profiles that are being collected at the moment of call.) * profiles that are being collected at the moment of call.)
*/ */
static int GetProfilesCount(); int GetProfileCount();
/** Returns a profile by index. */ /** Deprecated. Use GetCpuProfile instead. */
static const CpuProfile* GetProfile( static const CpuProfile* GetProfile(
int index, int index,
Handle<Value> security_token = Handle<Value>()); Handle<Value> security_token = Handle<Value>());
/** Returns a profile by index. */
const CpuProfile* GetCpuProfile(
int index,
Handle<Value> security_token = Handle<Value>());
/** Returns a profile by uid. */ /** Deprecated. Use FindProfile instead. */
static const CpuProfile* FindProfile( static const CpuProfile* FindProfile(
unsigned uid, unsigned uid,
Handle<Value> security_token = Handle<Value>()); Handle<Value> security_token = Handle<Value>());
/** Returns a profile by uid. */
const CpuProfile* FindCpuProfile(
unsigned uid,
Handle<Value> security_token = Handle<Value>());
/** Deprecated. Use StartCpuProfiling instead. */
static void StartProfiling(Handle<String> title, bool record_samples = fa
lse);
/** /**
* Starts collecting CPU profile. Title may be an empty string. It * Starts collecting CPU profile. Title may be an empty string. It
* is allowed to have several profiles being collected at * is allowed to have several profiles being collected at
* once. Attempts to start collecting several profiles with the same * once. Attempts to start collecting several profiles with the same
* title are silently ignored. While collecting a profile, functions * title are silently ignored. While collecting a profile, functions
* from all security contexts are included in it. The token-based * from all security contexts are included in it. The token-based
* filtering is only performed when querying for a profile. * filtering is only performed when querying for a profile.
*
* |record_samples| parameter controls whether individual samples should
* be recorded in addition to the aggregated tree.
*/ */
static void StartProfiling(Handle<String> title); void StartCpuProfiling(Handle<String> title, bool record_samples = false) ;
/** Deprecated. Use StopCpuProfiling instead. */
static const CpuProfile* StopProfiling(
Handle<String> title,
Handle<Value> security_token = Handle<Value>());
/** /**
* Stops collecting CPU profile with a given title and returns it. * Stops collecting CPU profile with a given title and returns it.
* If the title given is empty, finishes the last profile started. * If the title given is empty, finishes the last profile started.
*/ */
static const CpuProfile* StopProfiling( const CpuProfile* StopCpuProfiling(
Handle<String> title, Handle<String> title,
Handle<Value> security_token = Handle<Value>()); Handle<Value> security_token = Handle<Value>());
/** Deprecated. Use DeleteAllCpuProfiles instead. */
static void DeleteAllProfiles();
/** /**
* Deletes all existing profiles, also cancelling all profiling * Deletes all existing profiles, also cancelling all profiling
* activity. All previously returned pointers to profiles and their * activity. All previously returned pointers to profiles and their
* contents become invalid after this call. * contents become invalid after this call.
*/ */
static void DeleteAllProfiles(); void DeleteAllCpuProfiles();
private:
CpuProfiler();
~CpuProfiler();
CpuProfiler(const CpuProfiler&);
CpuProfiler& operator=(const CpuProfiler&);
}; };
class HeapGraphNode; class HeapGraphNode;
/** /**
* HeapSnapshotEdge represents a directed connection between heap * HeapSnapshotEdge represents a directed connection between heap
* graph nodes: from retainers to retained nodes. * graph nodes: from retainers to retained nodes.
*/ */
class V8EXPORT HeapGraphEdge { class V8EXPORT HeapGraphEdge {
public: public:
skipping to change at line 299 skipping to change at line 342
*/ */
class V8EXPORT HeapSnapshot { class V8EXPORT HeapSnapshot {
public: public:
enum Type { enum Type {
kFull = 0 // Heap snapshot with all instances and references. kFull = 0 // Heap snapshot with all instances and references.
}; };
enum SerializationFormat { enum SerializationFormat {
kJSON = 0 // See format description near 'Serialize' method. kJSON = 0 // See format description near 'Serialize' method.
}; };
/** Returns heap snapshot type. */ /** Deprecated. Returns kFull. */
Type GetType() const; V8_DEPRECATED(Type GetType() const);
/** Returns heap snapshot UID (assigned by the profiler.) */ /** Returns heap snapshot UID (assigned by the profiler.) */
unsigned GetUid() const; unsigned GetUid() const;
/** Returns heap snapshot title. */ /** Returns heap snapshot title. */
Handle<String> GetTitle() const; Handle<String> GetTitle() const;
/** Returns the root node of the heap graph. */ /** Returns the root node of the heap graph. */
const HeapGraphNode* GetRoot() const; const HeapGraphNode* GetRoot() const;
skipping to change at line 362 skipping to change at line 405
* *
* Nodes reference strings, other nodes, and edges by their indexes * Nodes reference strings, other nodes, and edges by their indexes
* in corresponding arrays. * in corresponding arrays.
*/ */
void Serialize(OutputStream* stream, SerializationFormat format) const; void Serialize(OutputStream* stream, SerializationFormat format) const;
}; };
class RetainedObjectInfo; class RetainedObjectInfo;
/** /**
* Interface for controlling heap profiling. * Interface for controlling heap profiling. Instance of the
* profiler can be retrieved using v8::Isolate::GetHeapProfiler.
*/ */
class V8EXPORT HeapProfiler { class V8EXPORT HeapProfiler {
public: public:
/** /**
* Callback function invoked for obtaining RetainedObjectInfo for * Callback function invoked for obtaining RetainedObjectInfo for
* the given JavaScript wrapper object. It is prohibited to enter V8 * the given JavaScript wrapper object. It is prohibited to enter V8
* while the callback is running: only getters on the handle and * while the callback is running: only getters on the handle and
* GetPointerFromInternalField on the objects are allowed. * GetPointerFromInternalField on the objects are allowed.
*/ */
typedef RetainedObjectInfo* (*WrapperInfoCallback) typedef RetainedObjectInfo* (*WrapperInfoCallback)
(uint16_t class_id, Handle<Value> wrapper); (uint16_t class_id, Handle<Value> wrapper);
/** Returns the number of snapshots taken. */ /** Deprecated. Use GetSnapshotCount instead. */
static int GetSnapshotsCount(); static int GetSnapshotsCount();
/** Returns the number of snapshots taken. */
int GetSnapshotCount();
/** Returns a snapshot by index. */ /** Deprecated. Use GetHeapSnapshot instead. */
static const HeapSnapshot* GetSnapshot(int index); static const HeapSnapshot* GetSnapshot(int index);
/** Returns a snapshot by index. */
const HeapSnapshot* GetHeapSnapshot(int index);
/** Returns a profile by uid. */ /** Deprecated. Use FindHeapSnapshot instead. */
static const HeapSnapshot* FindSnapshot(unsigned uid); static const HeapSnapshot* FindSnapshot(unsigned uid);
/** Returns a profile by uid. */
const HeapSnapshot* FindHeapSnapshot(unsigned uid);
/** Deprecated. Use GetObjectId instead. */
static SnapshotObjectId GetSnapshotObjectId(Handle<Value> value);
/** /**
* Returns SnapshotObjectId for a heap object referenced by |value| if * Returns SnapshotObjectId for a heap object referenced by |value| if
* it has been seen by the heap profiler, kUnknownObjectId otherwise. * it has been seen by the heap profiler, kUnknownObjectId otherwise.
*/ */
static SnapshotObjectId GetSnapshotObjectId(Handle<Value> value); SnapshotObjectId GetObjectId(Handle<Value> value);
/** /**
* A constant for invalid SnapshotObjectId. GetSnapshotObjectId will retu rn * A constant for invalid SnapshotObjectId. GetSnapshotObjectId will retu rn
* it in case heap profiler cannot find id for the object passed as * it in case heap profiler cannot find id for the object passed as
* parameter. HeapSnapshot::GetNodeById will always return NULL for such id. * parameter. HeapSnapshot::GetNodeById will always return NULL for such id.
*/ */
static const SnapshotObjectId kUnknownObjectId = 0; static const SnapshotObjectId kUnknownObjectId = 0;
/** /**
* Callback interface for retrieving user friendly names of global object s. * Callback interface for retrieving user friendly names of global object s.
*/ */
class ObjectNameResolver { class ObjectNameResolver {
public: public:
/** /**
* Returns name to be used in the heap snapshot for given node. Returne d * Returns name to be used in the heap snapshot for given node. Returne d
* string must stay alive until snapshot collection is completed. * string must stay alive until snapshot collection is completed.
*/ */
virtual const char* GetName(Handle<Object> object) = 0; virtual const char* GetName(Handle<Object> object) = 0;
protected: protected:
virtual ~ObjectNameResolver() {} virtual ~ObjectNameResolver() {}
}; };
/** Deprecated. Use TakeHeapSnapshot instead. */
static const HeapSnapshot* TakeSnapshot(
Handle<String> title,
HeapSnapshot::Type type = HeapSnapshot::kFull,
ActivityControl* control = NULL,
ObjectNameResolver* global_object_name_resolver = NULL);
/** /**
* Takes a heap snapshot and returns it. Title may be an empty string. * Takes a heap snapshot and returns it. Title may be an empty string.
* See HeapSnapshot::Type for types description.
*/ */
static const HeapSnapshot* TakeSnapshot( const HeapSnapshot* TakeHeapSnapshot(
Handle<String> title, Handle<String> title,
HeapSnapshot::Type type = HeapSnapshot::kFull,
ActivityControl* control = NULL, ActivityControl* control = NULL,
ObjectNameResolver* global_object_name_resolver = NULL); ObjectNameResolver* global_object_name_resolver = NULL);
/** Deprecated. Use StartTrackingHeapObjects instead. */
static void StartHeapObjectsTracking();
/** /**
* Starts tracking of heap objects population statistics. After calling * Starts tracking of heap objects population statistics. After calling
* this method, all heap objects relocations done by the garbage collecto r * this method, all heap objects relocations done by the garbage collecto r
* are being registered. * are being registered.
*/ */
static void StartHeapObjectsTracking(); void StartTrackingHeapObjects();
/** Deprecated. Use GetHeapStats instead. */
static SnapshotObjectId PushHeapObjectsStats(OutputStream* stream);
/** /**
* Adds a new time interval entry to the aggregated statistics array. The * Adds a new time interval entry to the aggregated statistics array. The
* time interval entry contains information on the current heap objects * time interval entry contains information on the current heap objects
* population size. The method also updates aggregated statistics and * population size. The method also updates aggregated statistics and
* reports updates for all previous time intervals via the OutputStream * reports updates for all previous time intervals via the OutputStream
* object. Updates on each time interval are provided as a stream of the * object. Updates on each time interval are provided as a stream of the
* HeapStatsUpdate structure instances. * HeapStatsUpdate structure instances.
* The return value of the function is the last seen heap object Id. * The return value of the function is the last seen heap object Id.
* *
* StartHeapObjectsTracking must be called before the first call to this * StartTrackingHeapObjects must be called before the first call to this
* method. * method.
*/ */
static SnapshotObjectId PushHeapObjectsStats(OutputStream* stream); SnapshotObjectId GetHeapStats(OutputStream* stream);
/** Deprecated. Use StopTrackingHeapObjects instead. */
static void StopHeapObjectsTracking();
/** /**
* Stops tracking of heap objects population statistics, cleans up all * Stops tracking of heap objects population statistics, cleans up all
* collected data. StartHeapObjectsTracking must be called again prior to * collected data. StartHeapObjectsTracking must be called again prior to
* calling PushHeapObjectsStats next time. * calling PushHeapObjectsStats next time.
*/ */
static void StopHeapObjectsTracking(); void StopTrackingHeapObjects();
/** Deprecated. Use DeleteAllHeapSnapshots instead. */
static void DeleteAllSnapshots();
/** /**
* Deletes all snapshots taken. All previously returned pointers to * Deletes all snapshots taken. All previously returned pointers to
* snapshots and their contents become invalid after this call. * snapshots and their contents become invalid after this call.
*/ */
static void DeleteAllSnapshots(); void DeleteAllHeapSnapshots();
/** Binds a callback to embedder's class ID. */ /** Deprecated. Use SetWrapperClassInfoProvider instead. */
static void DefineWrapperClass( static void DefineWrapperClass(
uint16_t class_id, uint16_t class_id,
WrapperInfoCallback callback); WrapperInfoCallback callback);
/** Binds a callback to embedder's class ID. */
void SetWrapperClassInfoProvider(
uint16_t class_id,
WrapperInfoCallback callback);
/** /**
* Default value of persistent handle class ID. Must not be used to * Default value of persistent handle class ID. Must not be used to
* define a class. Can be used to reset a class of a persistent * define a class. Can be used to reset a class of a persistent
* handle. * handle.
*/ */
static const uint16_t kPersistentHandleNoClassId = 0; static const uint16_t kPersistentHandleNoClassId = 0;
/** Returns the number of currently existing persistent handles. */ /**
* Deprecated. Returns the number of currently existing persistent handle
s.
*/
static int GetPersistentHandleCount(); static int GetPersistentHandleCount();
/** Returns memory used for profiler internal data and snapshots. */ /** Deprecated. Use GetHeapProfilerMemorySize instead. */
static size_t GetMemorySizeUsedByProfiler(); static size_t GetMemorySizeUsedByProfiler();
/** Returns memory used for profiler internal data and snapshots. */
size_t GetProfilerMemorySize();
private:
HeapProfiler();
~HeapProfiler();
HeapProfiler(const HeapProfiler&);
HeapProfiler& operator=(const HeapProfiler&);
}; };
/** /**
* Interface for providing information about embedder's objects * Interface for providing information about embedder's objects
* held by global handles. This information is reported in two ways: * held by global handles. This information is reported in two ways:
* *
* 1. When calling AddObjectGroup, an embedder may pass * 1. When calling AddObjectGroup, an embedder may pass
* RetainedObjectInfo instance describing the group. To collect * RetainedObjectInfo instance describing the group. To collect
* this information while taking a heap snapshot, V8 calls GC * this information while taking a heap snapshot, V8 calls GC
* prologue and epilogue callbacks. * prologue and epilogue callbacks.
skipping to change at line 549 skipping to change at line 627
RetainedObjectInfo() {} RetainedObjectInfo() {}
virtual ~RetainedObjectInfo() {} virtual ~RetainedObjectInfo() {}
private: private:
RetainedObjectInfo(const RetainedObjectInfo&); RetainedObjectInfo(const RetainedObjectInfo&);
RetainedObjectInfo& operator=(const RetainedObjectInfo&); RetainedObjectInfo& operator=(const RetainedObjectInfo&);
}; };
/** /**
* A struct for exporting HeapStats data from V8, using "push" model. * A struct for exporting HeapStats data from V8, using "push" model.
* See HeapProfiler::PushHeapObjectsStats. * See HeapProfiler::GetHeapStats.
*/ */
struct HeapStatsUpdate { struct HeapStatsUpdate {
HeapStatsUpdate(uint32_t index, uint32_t count, uint32_t size) HeapStatsUpdate(uint32_t index, uint32_t count, uint32_t size)
: index(index), count(count), size(size) { } : index(index), count(count), size(size) { }
uint32_t index; // Index of the time interval that was changed. uint32_t index; // Index of the time interval that was changed.
uint32_t count; // New value of count field for the interval with this i ndex. uint32_t count; // New value of count field for the interval with this i ndex.
uint32_t size; // New value of size field for the interval with this ind ex. uint32_t size; // New value of size field for the interval with this ind ex.
}; };
} // namespace v8 } // namespace v8
 End of changes. 47 change blocks. 
28 lines changed or deleted 109 lines changed or added


 v8.h   v8.h 
skipping to change at line 106 skipping to change at line 106
* The v8 JavaScript engine. * The v8 JavaScript engine.
*/ */
namespace v8 { namespace v8 {
class AccessorInfo; class AccessorInfo;
class AccessorSignature; class AccessorSignature;
class Array; class Array;
class Boolean; class Boolean;
class BooleanObject; class BooleanObject;
class Context; class Context;
class CpuProfiler;
class Data; class Data;
class Date; class Date;
class DeclaredAccessorDescriptor; class DeclaredAccessorDescriptor;
class External; class External;
class Function; class Function;
class FunctionTemplate; class FunctionTemplate;
class HeapProfiler;
class ImplementationUtilities; class ImplementationUtilities;
class Int32; class Int32;
class Integer; class Integer;
class Isolate; class Isolate;
class Number; class Number;
class NumberObject; class NumberObject;
class Object; class Object;
class ObjectOperationDescriptor; class ObjectOperationDescriptor;
class ObjectTemplate; class ObjectTemplate;
class Primitive; class Primitive;
skipping to change at line 2955 skipping to change at line 2957
* global garbage collections more often than it would otherwise in an at tempt * global garbage collections more often than it would otherwise in an at tempt
* to garbage collect the JavaScript objects that keep the externally * to garbage collect the JavaScript objects that keep the externally
* allocated memory alive. * allocated memory alive.
* *
* \param change_in_bytes the change in externally allocated memory that is * \param change_in_bytes the change in externally allocated memory that is
* kept alive by JavaScript objects. * kept alive by JavaScript objects.
* \returns the adjusted value. * \returns the adjusted value.
*/ */
intptr_t AdjustAmountOfExternalAllocatedMemory(intptr_t change_in_bytes); intptr_t AdjustAmountOfExternalAllocatedMemory(intptr_t change_in_bytes);
/**
* Returns heap profiler for this isolate. Will return NULL until the iso
late
* is initialized.
*/
HeapProfiler* GetHeapProfiler();
/**
* Returns CPU profiler for this isolate. Will return NULL until the isol
ate
* is initialized.
*/
CpuProfiler* GetCpuProfiler();
private: private:
Isolate(); Isolate();
Isolate(const Isolate&); Isolate(const Isolate&);
~Isolate(); ~Isolate();
Isolate& operator=(const Isolate&); Isolate& operator=(const Isolate&);
void* operator new(size_t size); void* operator new(size_t size);
void operator delete(void*, size_t); void operator delete(void*, size_t);
}; };
class V8EXPORT StartupData { class V8EXPORT StartupData {
skipping to change at line 4186 skipping to change at line 4200
// the implementation of v8. // the implementation of v8.
static const int kHeapObjectMapOffset = 0; static const int kHeapObjectMapOffset = 0;
static const int kMapInstanceTypeOffset = 1 * kApiPointerSize + kApiIntSi ze; static const int kMapInstanceTypeOffset = 1 * kApiPointerSize + kApiIntSi ze;
static const int kStringResourceOffset = 3 * kApiPointerSize; static const int kStringResourceOffset = 3 * kApiPointerSize;
static const int kOddballKindOffset = 3 * kApiPointerSize; static const int kOddballKindOffset = 3 * kApiPointerSize;
static const int kForeignAddressOffset = kApiPointerSize; static const int kForeignAddressOffset = kApiPointerSize;
static const int kJSObjectHeaderSize = 3 * kApiPointerSize; static const int kJSObjectHeaderSize = 3 * kApiPointerSize;
static const int kFixedArrayHeaderSize = 2 * kApiPointerSize; static const int kFixedArrayHeaderSize = 2 * kApiPointerSize;
static const int kContextHeaderSize = 2 * kApiPointerSize; static const int kContextHeaderSize = 2 * kApiPointerSize;
static const int kContextEmbedderDataIndex = 54; static const int kContextEmbedderDataIndex = 55;
static const int kFullStringRepresentationMask = 0x07; static const int kFullStringRepresentationMask = 0x07;
static const int kStringEncodingMask = 0x4; static const int kStringEncodingMask = 0x4;
static const int kExternalTwoByteRepresentationTag = 0x02; static const int kExternalTwoByteRepresentationTag = 0x02;
static const int kExternalAsciiRepresentationTag = 0x06; static const int kExternalAsciiRepresentationTag = 0x06;
static const int kIsolateStateOffset = 0; static const int kIsolateStateOffset = 0;
static const int kIsolateEmbedderDataOffset = 1 * kApiPointerSize; static const int kIsolateEmbedderDataOffset = 1 * kApiPointerSize;
static const int kIsolateRootsOffset = 3 * kApiPointerSize; static const int kIsolateRootsOffset = 3 * kApiPointerSize;
static const int kUndefinedValueRootIndex = 5; static const int kUndefinedValueRootIndex = 5;
static const int kNullValueRootIndex = 7; static const int kNullValueRootIndex = 7;
 End of changes. 4 change blocks. 
1 lines changed or deleted 17 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/