6
6
#define V8_V8_PROFILER_H_
7
7
8
8
#include < limits.h>
9
+ #include < memory>
9
10
#include < unordered_set>
10
11
#include < vector>
12
+
11
13
#include " v8.h" // NOLINT(build/include)
12
14
13
15
/* *
@@ -143,9 +145,8 @@ class V8_EXPORT CpuProfileNode {
143
145
unsigned GetHitCount () const ;
144
146
145
147
/* * Returns function entry UID. */
146
- V8_DEPRECATE_SOON (
147
- " Use GetScriptId, GetLineNumber, and GetColumnNumber instead." ,
148
- unsigned GetCallUid () const );
148
+ V8_DEPRECATED (" Use GetScriptId, GetLineNumber, and GetColumnNumber instead." )
149
+ unsigned GetCallUid () const ;
149
150
150
151
/* * Returns id of the node. The id is unique within the tree */
151
152
unsigned GetNodeId () const ;
@@ -370,20 +371,6 @@ class V8_EXPORT CpuProfiler {
370
371
*/
371
372
CpuProfile* StopProfiling (Local<String> title);
372
373
373
- /* *
374
- * Force collection of a sample. Must be called on the VM thread.
375
- * Recording the forced sample does not contribute to the aggregated
376
- * profile statistics.
377
- */
378
- V8_DEPRECATED (" Use static CollectSample(Isolate*) instead." ,
379
- void CollectSample ());
380
-
381
- /* *
382
- * Tells the profiler whether the embedder is idle.
383
- */
384
- V8_DEPRECATED (" Use Isolate::SetIdle(bool) instead." ,
385
- void SetIdle (bool is_idle));
386
-
387
374
/* *
388
375
* Generate more detailed source positions to code objects. This results in
389
376
* better results when mapping profiling samples to script source.
@@ -989,7 +976,8 @@ struct HeapStatsUpdate {
989
976
V (LazyCompile) \
990
977
V (RegExp) \
991
978
V (Script) \
992
- V(Stub)
979
+ V (Stub) \
980
+ V (Relocation)
993
981
994
982
/* *
995
983
* Note that this enum may be extended in the future. Please include a default
@@ -1022,10 +1010,12 @@ class V8_EXPORT CodeEvent {
1022
1010
const char * GetComment ();
1023
1011
1024
1012
static const char * GetCodeEventTypeName (CodeEventType code_event_type);
1013
+
1014
+ uintptr_t GetPreviousCodeStartAddress ();
1025
1015
};
1026
1016
1027
1017
/* *
1028
- * Interface to listen to code creation events.
1018
+ * Interface to listen to code creation and code relocation events.
1029
1019
*/
1030
1020
class V8_EXPORT CodeEventHandler {
1031
1021
public:
@@ -1037,9 +1027,26 @@ class V8_EXPORT CodeEventHandler {
1037
1027
explicit CodeEventHandler (Isolate* isolate);
1038
1028
virtual ~CodeEventHandler ();
1039
1029
1030
+ /* *
1031
+ * Handle is called every time a code object is created or moved. Information
1032
+ * about each code event will be available through the `code_event`
1033
+ * parameter.
1034
+ *
1035
+ * When the CodeEventType is kRelocationType, the code for this CodeEvent has
1036
+ * moved from `GetPreviousCodeStartAddress()` to `GetCodeStartAddress()`.
1037
+ */
1040
1038
virtual void Handle (CodeEvent* code_event) = 0;
1041
1039
1040
+ /* *
1041
+ * Call `Enable()` to starts listening to code creation and code relocation
1042
+ * events. These events will be handled by `Handle()`.
1043
+ */
1042
1044
void Enable ();
1045
+
1046
+ /* *
1047
+ * Call `Disable()` to stop listening to code creation and code relocation
1048
+ * events.
1049
+ */
1043
1050
void Disable ();
1044
1051
1045
1052
private:
0 commit comments