v8-profiler.h | v8-profiler.h | |||
---|---|---|---|---|
skipping to change at line 182 | skipping to change at line 182 | |||
/** | /** | |||
* 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( | static const CpuProfile* StopProfiling( | |||
Handle<String> title, | Handle<String> title, | |||
Handle<Value> security_token = Handle<Value>()); | Handle<Value> security_token = Handle<Value>()); | |||
}; | }; | |||
class HeapGraphNode; | ||||
/** | ||||
* HeapSnapshotEdge represents a directed connection between heap | ||||
* graph nodes: from retaners to retained nodes. | ||||
*/ | ||||
class V8EXPORT HeapGraphEdge { | ||||
public: | ||||
enum Type { | ||||
CONTEXT_VARIABLE = 0, // A variable from a function context. | ||||
ELEMENT = 1, // An element of an array. | ||||
PROPERTY = 2 // A named object property. | ||||
}; | ||||
/** Returns edge type (see HeapGraphEdge::Type). */ | ||||
Type GetType() const; | ||||
/** | ||||
* Returns edge name. This can be a variable name, an element index, or | ||||
* a property name. | ||||
*/ | ||||
Handle<Value> GetName() const; | ||||
/** Returns origin node. */ | ||||
const HeapGraphNode* GetFromNode() const; | ||||
/** Returns destination node. */ | ||||
const HeapGraphNode* GetToNode() const; | ||||
}; | ||||
class V8EXPORT HeapGraphPath { | ||||
public: | ||||
/** Returns the number of edges in the path. */ | ||||
int GetEdgesCount() const; | ||||
/** Returns an edge from the path. */ | ||||
const HeapGraphEdge* GetEdge(int index) const; | ||||
/** Returns origin node. */ | ||||
const HeapGraphNode* GetFromNode() const; | ||||
/** Returns destination node. */ | ||||
const HeapGraphNode* GetToNode() const; | ||||
}; | ||||
/** | ||||
* HeapGraphNode represents a node in a heap graph. | ||||
*/ | ||||
class V8EXPORT HeapGraphNode { | ||||
public: | ||||
enum Type { | ||||
INTERNAL = 0, // Internal node, a virtual one, for housekeeping. | ||||
ARRAY = 1, // An array of elements. | ||||
STRING = 2, // A string. | ||||
OBJECT = 3, // A JS object (except for arrays and strings). | ||||
CODE = 4, // Compiled code. | ||||
CLOSURE = 5 // Function closure. | ||||
}; | ||||
/** Returns node type (see HeapGraphNode::Type). */ | ||||
Type GetType() const; | ||||
/** | ||||
* Returns node name. Depending on node's type this can be the name | ||||
* of the constructor (for objects), the name of the function (for | ||||
* closures), string value, or an empty string (for compiled code). | ||||
*/ | ||||
Handle<String> GetName() const; | ||||
/** Returns node's own size, in bytes. */ | ||||
int GetSelfSize() const; | ||||
/** Returns node's network (self + reachable nodes) size, in bytes. */ | ||||
int GetTotalSize() const; | ||||
/** | ||||
* Returns node's private size, in bytes. That is, the size of memory | ||||
* that will be reclaimed having this node collected. | ||||
*/ | ||||
int GetPrivateSize() const; | ||||
/** Returns child nodes count of the node. */ | ||||
int GetChildrenCount() const; | ||||
/** Retrieves a child by index. */ | ||||
const HeapGraphEdge* GetChild(int index) const; | ||||
/** Returns retainer nodes count of the node. */ | ||||
int GetRetainersCount() const; | ||||
/** Returns a retainer by index. */ | ||||
const HeapGraphEdge* GetRetainer(int index) const; | ||||
/** Returns the number of simple retaining paths from the root to the nod | ||||
e. */ | ||||
int GetRetainingPathsCount() const; | ||||
/** Returns a retaining path by index. */ | ||||
const HeapGraphPath* GetRetainingPath(int index) const; | ||||
}; | ||||
/** | ||||
* HeapSnapshots record the state of the JS heap at some moment. | ||||
*/ | ||||
class V8EXPORT HeapSnapshot { | ||||
public: | ||||
/** Returns heap snapshot UID (assigned by the profiler.) */ | ||||
unsigned GetUid() const; | ||||
/** Returns heap snapshot title. */ | ||||
Handle<String> GetTitle() const; | ||||
/** Returns the root node of the heap graph. */ | ||||
const HeapGraphNode* GetHead() const; | ||||
}; | ||||
/** | ||||
* Interface for controlling heap profiling. | ||||
*/ | ||||
class V8EXPORT HeapProfiler { | ||||
public: | ||||
/** Returns the number of snapshots taken. */ | ||||
static int GetSnapshotsCount(); | ||||
/** Returns a snapshot by index. */ | ||||
static const HeapSnapshot* GetSnapshot(int index); | ||||
/** Returns a profile by uid. */ | ||||
static const HeapSnapshot* FindSnapshot(unsigned uid); | ||||
/** Takes a heap snapshot and returns it. Title may be an empty string. * | ||||
/ | ||||
static const HeapSnapshot* TakeSnapshot(Handle<String> title); | ||||
}; | ||||
} // namespace v8 | } // namespace v8 | |||
#undef V8EXPORT | #undef V8EXPORT | |||
#endif // V8_V8_PROFILER_H_ | #endif // V8_V8_PROFILER_H_ | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 135 lines changed or added | |||
v8.h | v8.h | |||
---|---|---|---|---|
skipping to change at line 1545 | skipping to change at line 1545 | |||
Local<Object> Clone(); | Local<Object> Clone(); | |||
/** | /** | |||
* Set the backing store of the indexed properties to be managed by the | * Set the backing store of the indexed properties to be managed by the | |||
* embedding layer. Access to the indexed properties will follow the rule s | * embedding layer. Access to the indexed properties will follow the rule s | |||
* spelled out in CanvasPixelArray. | * spelled out in CanvasPixelArray. | |||
* Note: The embedding program still owns the data and needs to ensure th at | * Note: The embedding program still owns the data and needs to ensure th at | |||
* the backing store is preserved while V8 has a reference. | * the backing store is preserved while V8 has a reference. | |||
*/ | */ | |||
void SetIndexedPropertiesToPixelData(uint8_t* data, int length); | void SetIndexedPropertiesToPixelData(uint8_t* data, int length); | |||
bool HasIndexedPropertiesInPixelData(); | ||||
uint8_t* GetIndexedPropertiesPixelData(); | ||||
int GetIndexedPropertiesPixelDataLength(); | ||||
/** | /** | |||
* Set the backing store of the indexed properties to be managed by the | * Set the backing store of the indexed properties to be managed by the | |||
* embedding layer. Access to the indexed properties will follow the rule s | * embedding layer. Access to the indexed properties will follow the rule s | |||
* spelled out for the CanvasArray subtypes in the WebGL specification. | * spelled out for the CanvasArray subtypes in the WebGL specification. | |||
* Note: The embedding program still owns the data and needs to ensure th at | * Note: The embedding program still owns the data and needs to ensure th at | |||
* the backing store is preserved while V8 has a reference. | * the backing store is preserved while V8 has a reference. | |||
*/ | */ | |||
void SetIndexedPropertiesToExternalArrayData(void* data, | void SetIndexedPropertiesToExternalArrayData(void* data, | |||
ExternalArrayType array_type , | ExternalArrayType array_type , | |||
int number_of_elements); | int number_of_elements); | |||
bool HasIndexedPropertiesInExternalArrayData(); | ||||
void* GetIndexedPropertiesExternalArrayData(); | ||||
ExternalArrayType GetIndexedPropertiesExternalArrayDataType(); | ||||
int GetIndexedPropertiesExternalArrayDataLength(); | ||||
static Local<Object> New(); | static Local<Object> New(); | |||
static inline Object* Cast(Value* obj); | static inline Object* Cast(Value* obj); | |||
private: | private: | |||
Object(); | Object(); | |||
static void CheckCast(Value* obj); | static void CheckCast(Value* obj); | |||
Local<Value> CheckedGetInternalField(int index); | Local<Value> CheckedGetInternalField(int index); | |||
void* SlowGetPointerFromInternalField(int index); | void* SlowGetPointerFromInternalField(int index); | |||
/** | /** | |||
skipping to change at line 1727 | skipping to change at line 1734 | |||
/** | /** | |||
* Returns the value if the setter intercepts the request. | * Returns the value if the setter intercepts the request. | |||
* Otherwise, returns an empty handle. | * Otherwise, returns an empty handle. | |||
*/ | */ | |||
typedef Handle<Value> (*NamedPropertySetter)(Local<String> property, | typedef Handle<Value> (*NamedPropertySetter)(Local<String> property, | |||
Local<Value> value, | Local<Value> value, | |||
const AccessorInfo& info); | const AccessorInfo& info); | |||
/** | /** | |||
* Returns a non-empty handle if the interceptor intercepts the request. | * Returns a non-empty handle if the interceptor intercepts the request. | |||
* The result is either boolean (true if property exists and false | * The result is an integer encoding property attributes (like v8::None, | |||
* otherwise) or an integer encoding property attributes. | * v8::DontEnum, etc.) | |||
*/ | */ | |||
#ifdef USE_NEW_QUERY_CALLBACKS | ||||
typedef Handle<Integer> (*NamedPropertyQuery)(Local<String> property, | typedef Handle<Integer> (*NamedPropertyQuery)(Local<String> property, | |||
const AccessorInfo& info); | const AccessorInfo& info); | |||
#else | ||||
typedef Handle<Boolean> (*NamedPropertyQuery)(Local<String> property, | ||||
const AccessorInfo& info); | ||||
#endif | ||||
typedef Handle<Value> (*NamedPropertyQueryImpl)(Local<String> property, | ||||
const AccessorInfo& info); | ||||
/** | /** | |||
* Returns a non-empty handle if the deleter intercepts the request. | * Returns a non-empty handle if the deleter intercepts the request. | |||
* The return value is true if the property could be deleted and false | * The return value is true if the property could be deleted and false | |||
* otherwise. | * otherwise. | |||
*/ | */ | |||
typedef Handle<Boolean> (*NamedPropertyDeleter)(Local<String> property, | typedef Handle<Boolean> (*NamedPropertyDeleter)(Local<String> property, | |||
const AccessorInfo& info); | const AccessorInfo& info); | |||
/** | /** | |||
skipping to change at line 1982 | skipping to change at line 1981 | |||
AccessorGetter getter, | AccessorGetter getter, | |||
AccessorSetter setter, | AccessorSetter setter, | |||
Handle<Value> data, | Handle<Value> data, | |||
AccessControl settings, | AccessControl settings, | |||
PropertyAttribute attributes); | PropertyAttribute attributes); | |||
void SetNamedInstancePropertyHandler(NamedPropertyGetter getter, | void SetNamedInstancePropertyHandler(NamedPropertyGetter getter, | |||
NamedPropertySetter setter, | NamedPropertySetter setter, | |||
NamedPropertyQuery query, | NamedPropertyQuery query, | |||
NamedPropertyDeleter remover, | NamedPropertyDeleter remover, | |||
NamedPropertyEnumerator enumerator, | NamedPropertyEnumerator enumerator, | |||
Handle<Value> data) { | Handle<Value> data); | |||
NamedPropertyQueryImpl casted = | ||||
reinterpret_cast<NamedPropertyQueryImpl>(query); | ||||
SetNamedInstancePropertyHandlerImpl(getter, | ||||
setter, | ||||
casted, | ||||
remover, | ||||
enumerator, | ||||
data); | ||||
} | ||||
void SetIndexedInstancePropertyHandler(IndexedPropertyGetter getter, | void SetIndexedInstancePropertyHandler(IndexedPropertyGetter getter, | |||
IndexedPropertySetter setter, | IndexedPropertySetter setter, | |||
IndexedPropertyQuery query, | IndexedPropertyQuery query, | |||
IndexedPropertyDeleter remover, | IndexedPropertyDeleter remover, | |||
IndexedPropertyEnumerator enumerat or, | IndexedPropertyEnumerator enumerat or, | |||
Handle<Value> data); | Handle<Value> data); | |||
void SetInstanceCallAsFunctionHandler(InvocationCallback callback, | void SetInstanceCallAsFunctionHandler(InvocationCallback callback, | |||
Handle<Value> data); | Handle<Value> data); | |||
friend class Context; | friend class Context; | |||
friend class ObjectTemplate; | friend class ObjectTemplate; | |||
private: | ||||
void SetNamedInstancePropertyHandlerImpl(NamedPropertyGetter getter, | ||||
NamedPropertySetter setter, | ||||
NamedPropertyQueryImpl query, | ||||
NamedPropertyDeleter remover, | ||||
NamedPropertyEnumerator enumerat | ||||
or, | ||||
Handle<Value> data); | ||||
}; | }; | |||
/** | /** | |||
* An ObjectTemplate is used to create objects at runtime. | * An ObjectTemplate is used to create objects at runtime. | |||
* | * | |||
* Properties added to an ObjectTemplate are added to each object | * Properties added to an ObjectTemplate are added to each object | |||
* created from the ObjectTemplate. | * created from the ObjectTemplate. | |||
*/ | */ | |||
class V8EXPORT ObjectTemplate : public Template { | class V8EXPORT ObjectTemplate : public Template { | |||
public: | public: | |||
skipping to change at line 2066 | skipping to change at line 2049 | |||
/** | /** | |||
* Sets a named property handler on the object template. | * Sets a named property handler on the object template. | |||
* | * | |||
* Whenever a named property is accessed on objects created from | * Whenever a named property is accessed on objects created from | |||
* this object template, the provided callback is invoked instead of | * this object template, the provided callback is invoked instead of | |||
* accessing the property directly on the JavaScript object. | * accessing the property directly on the JavaScript object. | |||
* | * | |||
* \param getter The callback to invoke when getting a property. | * \param getter The callback to invoke when getting a property. | |||
* \param setter The callback to invoke when setting a property. | * \param setter The callback to invoke when setting a property. | |||
* \param query The callback to invoke to check if an object has a proper | * \param query The callback to invoke to check if a property is present, | |||
ty. | * and if present, get its attributes. | |||
* \param deleter The callback to invoke when deleting a property. | * \param deleter The callback to invoke when deleting a property. | |||
* \param enumerator The callback to invoke to enumerate all the named | * \param enumerator The callback to invoke to enumerate all the named | |||
* properties of an object. | * properties of an object. | |||
* \param data A piece of data that will be passed to the callbacks | * \param data A piece of data that will be passed to the callbacks | |||
* whenever they are invoked. | * whenever they are invoked. | |||
*/ | */ | |||
void SetNamedPropertyHandler(NamedPropertyGetter getter, | void SetNamedPropertyHandler(NamedPropertyGetter getter, | |||
NamedPropertySetter setter = 0, | NamedPropertySetter setter = 0, | |||
NamedPropertyQuery query = 0, | NamedPropertyQuery query = 0, | |||
NamedPropertyDeleter deleter = 0, | NamedPropertyDeleter deleter = 0, | |||
NamedPropertyEnumerator enumerator = 0, | NamedPropertyEnumerator enumerator = 0, | |||
Handle<Value> data = Handle<Value>()) { | Handle<Value> data = Handle<Value>()); | |||
NamedPropertyQueryImpl casted = | ||||
reinterpret_cast<NamedPropertyQueryImpl>(query); | ||||
SetNamedPropertyHandlerImpl(getter, | ||||
setter, | ||||
casted, | ||||
deleter, | ||||
enumerator, | ||||
data); | ||||
} | ||||
private: | ||||
void SetNamedPropertyHandlerImpl(NamedPropertyGetter getter, | ||||
NamedPropertySetter setter, | ||||
NamedPropertyQueryImpl query, | ||||
NamedPropertyDeleter deleter, | ||||
NamedPropertyEnumerator enumerator, | ||||
Handle<Value> data); | ||||
public: | ||||
/** | /** | |||
* Sets an indexed property handler on the object template. | * Sets an indexed property handler on the object template. | |||
* | * | |||
* Whenever an indexed property is accessed on objects created from | * Whenever an indexed property is accessed on objects created from | |||
* this object template, the provided callback is invoked instead of | * this object template, the provided callback is invoked instead of | |||
* accessing the property directly on the JavaScript object. | * accessing the property directly on the JavaScript object. | |||
* | * | |||
* \param getter The callback to invoke when getting a property. | * \param getter The callback to invoke when getting a property. | |||
* \param setter The callback to invoke when setting a property. | * \param setter The callback to invoke when setting a property. | |||
End of changes. 9 change blocks. | ||||
50 lines changed or deleted | 13 lines changed or added | |||