@@ -54,7 +54,7 @@ namespace v8 {
5454 */
5555class V8_EXPORT TracingCpuProfiler {
5656 public:
57- V8_DEPRECATED (
57+ V8_DEPRECATE_SOON (
5858 " The profiler is created automatically with the isolate.\n "
5959 " No need to create it explicitly." ,
6060 static std::unique_ptr<TracingCpuProfiler> Create (Isolate*));
@@ -278,16 +278,6 @@ class V8_EXPORT CpuProfile {
278278 void Delete ();
279279};
280280
281- enum CpuProfilingMode {
282- // In the resulting CpuProfile tree, intermediate nodes in a stack trace
283- // (from the root to a leaf) will have line numbers that point to the start
284- // line of the function, rather than the line of the callsite of the child.
285- kLeafNodeLineNumbers ,
286- // In the resulting CpuProfile tree, nodes are separated based on the line
287- // number of their callsite in their parent.
288- kCallerLineNumbers ,
289- };
290-
291281/* *
292282 * Interface for controlling CPU profiling. Instance of the
293283 * profiler can be created using v8::CpuProfiler::New method.
@@ -331,13 +321,6 @@ class V8_EXPORT CpuProfiler {
331321 * |record_samples| parameter controls whether individual samples should
332322 * be recorded in addition to the aggregated tree.
333323 */
334- void StartProfiling (Local<String> title, CpuProfilingMode mode,
335- bool record_samples = false );
336- /* *
337- * The same as StartProfiling above, but the CpuProfilingMode defaults to
338- * kLeafNodeLineNumbers mode, which was the previous default behavior of the
339- * profiler.
340- */
341324 void StartProfiling (Local<String> title, bool record_samples = false );
342325
343326 /* *
@@ -660,7 +643,7 @@ class V8_EXPORT AllocationProfile {
660643 * Usage:
661644 * 1) Define derived class of EmbedderGraph::Node for embedder objects.
662645 * 2) Set the build embedder graph callback on the heap profiler using
663- * HeapProfiler::AddBuildEmbedderGraphCallback .
646+ * HeapProfiler::SetBuildEmbedderGraphCallback .
664647 * 3) In the callback use graph->AddEdge(node1, node2) to add an edge from
665648 * node1 to node2.
666649 * 4) To represent references from/to V8 object, construct V8 nodes using
@@ -714,14 +697,11 @@ class V8_EXPORT EmbedderGraph {
714697 virtual Node* AddNode (std::unique_ptr<Node> node) = 0;
715698
716699 /* *
717- * Adds an edge that represents a strong reference from the given
718- * node |from| to the given node |to|. The nodes must be added to the graph
700+ * Adds an edge that represents a strong reference from the given node
701+ * |from| to the given node |to|. The nodes must be added to the graph
719702 * before calling this function.
720- *
721- * If name is nullptr, the edge will have auto-increment indexes, otherwise
722- * it will be named accordingly.
723703 */
724- virtual void AddEdge (Node* from, Node* to, const char * name = nullptr ) = 0;
704+ virtual void AddEdge (Node* from, Node* to) = 0;
725705
726706 virtual ~EmbedderGraph () = default ;
727707};
@@ -771,11 +751,6 @@ class V8_EXPORT HeapProfiler {
771751 * The callback must not trigger garbage collection in V8.
772752 */
773753 typedef void (*BuildEmbedderGraphCallback)(v8::Isolate* isolate,
774- v8::EmbedderGraph* graph,
775- void * data);
776-
777- /* * TODO(addaleax): Remove */
778- typedef void (*LegacyBuildEmbedderGraphCallback)(v8::Isolate* isolate,
779754 v8::EmbedderGraph* graph);
780755
781756 /* * Returns the number of snapshots taken. */
@@ -918,22 +893,15 @@ class V8_EXPORT HeapProfiler {
918893
919894 /* * Binds a callback to embedder's class ID. */
920895 V8_DEPRECATED (
921- " Use AddBuildEmbedderGraphCallback to provide info about embedder nodes" ,
896+ " Use SetBuildEmbedderGraphCallback to provide info about embedder nodes" ,
922897 void SetWrapperClassInfoProvider (uint16_t class_id,
923898 WrapperInfoCallback callback));
924899
925900 V8_DEPRECATED (
926- " Use AddBuildEmbedderGraphCallback to provide info about embedder nodes" ,
901+ " Use SetBuildEmbedderGraphCallback to provide info about embedder nodes" ,
927902 void SetGetRetainerInfosCallback (GetRetainerInfosCallback callback));
928903
929- V8_DEPRECATE_SOON (
930- " Use AddBuildEmbedderGraphCallback to provide info about embedder nodes" ,
931- void SetBuildEmbedderGraphCallback (
932- LegacyBuildEmbedderGraphCallback callback));
933- void AddBuildEmbedderGraphCallback (BuildEmbedderGraphCallback callback,
934- void * data);
935- void RemoveBuildEmbedderGraphCallback (BuildEmbedderGraphCallback callback,
936- void * data);
904+ void SetBuildEmbedderGraphCallback (BuildEmbedderGraphCallback callback);
937905
938906 /* *
939907 * Default value of persistent handle class ID. Must not be used to
@@ -1041,76 +1009,6 @@ struct HeapStatsUpdate {
10411009 uint32_t size; // New value of size field for the interval with this index.
10421010};
10431011
1044- #define CODE_EVENTS_LIST (V ) \
1045- V (Builtin) \
1046- V(Callback) \
1047- V(Eval) \
1048- V(Function) \
1049- V(InterpretedFunction) \
1050- V(Handler) \
1051- V(BytecodeHandler) \
1052- V(LazyCompile) \
1053- V(RegExp) \
1054- V(Script) \
1055- V(Stub)
1056-
1057- /* *
1058- * Note that this enum may be extended in the future. Please include a default
1059- * case if this enum is used in a switch statement.
1060- */
1061- enum CodeEventType {
1062- kUnknownType = 0
1063- #define V (Name ) , k##Name##Type
1064- CODE_EVENTS_LIST (V)
1065- #undef V
1066- };
1067-
1068- /* *
1069- * Representation of a code creation event
1070- */
1071- class V8_EXPORT CodeEvent {
1072- public:
1073- uintptr_t GetCodeStartAddress ();
1074- size_t GetCodeSize ();
1075- Local<String> GetFunctionName ();
1076- Local<String> GetScriptName ();
1077- int GetScriptLine ();
1078- int GetScriptColumn ();
1079- /* *
1080- * NOTE (mmarchini): We can't allocate objects in the heap when we collect
1081- * existing code, and both the code type and the comment are not stored in the
1082- * heap, so we return those as const char*.
1083- */
1084- CodeEventType GetCodeType ();
1085- const char * GetComment ();
1086-
1087- static const char * GetCodeEventTypeName (CodeEventType code_event_type);
1088- };
1089-
1090- /* *
1091- * Interface to listen to code creation events.
1092- */
1093- class V8_EXPORT CodeEventHandler {
1094- public:
1095- /* *
1096- * Creates a new listener for the |isolate|. The isolate must be initialized.
1097- * The listener object must be disposed after use by calling |Dispose| method.
1098- * Multiple listeners can be created for the same isolate.
1099- */
1100- explicit CodeEventHandler (Isolate* isolate);
1101- virtual ~CodeEventHandler ();
1102-
1103- virtual void Handle (CodeEvent* code_event) = 0;
1104-
1105- void Enable ();
1106- void Disable ();
1107-
1108- private:
1109- CodeEventHandler ();
1110- CodeEventHandler (const CodeEventHandler&);
1111- CodeEventHandler& operator =(const CodeEventHandler&);
1112- void * internal_listener_;
1113- };
11141012
11151013} // namespace v8
11161014
0 commit comments