From f4a6142b84a5ef4a9627428eb9df1e9b23a266b0 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 11 Oct 2021 12:49:40 +0200 Subject: [PATCH] src: ensure V8 initialized before marking milestone --- src/env.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/env.cc b/src/env.cc index 1cc7da1ce15f43..2cb2dccdf32ba4 100644 --- a/src/env.cc +++ b/src/env.cc @@ -458,8 +458,11 @@ void Environment::InitializeMainContext(Local context, environment_start_time_); performance_state_->Mark(performance::NODE_PERFORMANCE_MILESTONE_NODE_START, per_process::node_start_time); - performance_state_->Mark(performance::NODE_PERFORMANCE_MILESTONE_V8_START, - performance::performance_v8_start); + + if (per_process::v8_initialized) { + performance_state_->Mark(performance::NODE_PERFORMANCE_MILESTONE_V8_START, + performance::performance_v8_start); + } } Environment::~Environment() {