@@ -40,6 +40,15 @@ uint64_t performance_v8_start;
40
40
uint64_t performance_last_gc_start_mark_ = 0 ;
41
41
v8::GCType performance_last_gc_type_ = v8::GCType::kGCTypeAll ;
42
42
43
+ void performance_state::Mark (enum PerformanceMilestone milestone,
44
+ uint64_t ts) {
45
+ this ->milestones [milestone] = ts;
46
+ TRACE_EVENT_INSTANT_WITH_TIMESTAMP0 (
47
+ TRACING_CATEGORY_NODE1 (bootstrap),
48
+ GetPerformanceMilestoneName (milestone),
49
+ TRACE_EVENT_SCOPE_THREAD, ts);
50
+ }
51
+
43
52
double GetCurrentTimeInMicroseconds () {
44
53
#ifdef _WIN32
45
54
// The difference between the Unix Epoch and the Windows Epoch in 100-ns ticks.
@@ -200,14 +209,11 @@ void Measure(const FunctionCallbackInfo<Value>& args) {
200
209
void MarkMilestone (const FunctionCallbackInfo<Value>& args) {
201
210
Environment* env = Environment::GetCurrent (args);
202
211
Local<Context> context = env->context ();
203
- AliasedBuffer<double , v8::Float64Array>& milestones =
204
- env->performance_state ()->milestones ;
205
212
PerformanceMilestone milestone =
206
213
static_cast <PerformanceMilestone>(
207
214
args[0 ]->Int32Value (context).ToChecked ());
208
- if (milestone != NODE_PERFORMANCE_MILESTONE_INVALID) {
209
- milestones[milestone] = PERFORMANCE_NOW ();
210
- }
215
+ if (milestone != NODE_PERFORMANCE_MILESTONE_INVALID)
216
+ env->performance_state ()->Mark (milestone);
211
217
}
212
218
213
219
0 commit comments