 +void __sanitizer_cov_reset_edgeguards();
 +
 +#endif
-diff --git a/src/d8.cc b/src/d8.cc
+diff --git a/src/d8/d8.cc b/src/d8/d8.cc
 index 3c1d523c66..5887795f22 100644
---- a/src/d8.cc
-+++ b/src/d8.cc
-@@ -28,6 +28,7 @@
+--- a/src/d8/d8.cc
++++ b/src/d8/d8.cc
+@@ -28,5 +28,6 @@
  #include "src/base/platform/time.h"
  #include "src/base/sys-info.h"
- #include "src/basic-block-profiler.h"
-+#include "src/cov.h"
- #include "src/d8-console.h"
- #include "src/d8-platforms.h"
- #include "src/d8.h"
-@@ -61,6 +62,12 @@
++#include "src/d8/cov.h"
+ #include "src/d8/d8-console.h"
+ #include "src/d8/d8-platforms.h"
+ #include "src/d8/d8.h"
+@@ -70,6 +71,12 @@
  #define CHECK(condition) assert(condition)
  #endif
- 
+
 +// REPRL defines
 +#define REPRL_CRFD 100
 +#define REPRL_CWFD 101

index 38783c0dac..0c59f91cb0 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -3907,6 +3907,8 @@ v8_executable("d8") {
   sources = [
     "src/async-hooks-wrapper.cc",
     "src/async-hooks-wrapper.h",
+    "src/cov.cc",
+    "src/cov.h",
     "src/d8-console.cc",
     "src/d8-console.h",
     "src/d8-js.cc",
diff --git a/src/cov.cc b/src/cov.cc
new file mode 100644
index 0000000000..8b5e9cf0ca
--- /dev/null
+++ b/src/cov.cc
@@ -0,0 +1,61 @@
+#include <inttypes.h>
+#include <fcntl.h>

     if (options.trace_enabled) {
       platform::tracing::TraceConfig* trace_config;
       if (options.trace_config) {
@@ -3509,8 +3598,17 @@ int Shell::Main(int argc, char* argv[]) {
     evaluation_context_.Reset();
     stringify_function_.Reset();
     CollectGarbage(isolate);
