GCC Code Coverage Report
Directory: ../ Exec Total Coverage
File: /home/iojs/build/workspace/node-test-commit-linux-coverage-daily/nodes/benchmark/out/../src/node_snapshotable.cc Lines: 5 13 38.5 %
Date: 2021-02-11 04:11:15 Branches: 3 14 21.4 %

Line Branch Exec Source
1
2
#include "node_snapshotable.h"
3
#include "base_object-inl.h"
4
5
namespace node {
6
7
using v8::Local;
8
using v8::Object;
9
using v8::StartupData;
10
11
void DeserializeNodeInternalFields(Local<Object> holder,
12
                                   int index,
13
                                   v8::StartupData payload,
14
                                   void* env) {
15
  if (payload.raw_size == 0) {
16
    holder->SetAlignedPointerInInternalField(index, nullptr);
17
    return;
18
  }
19
  // No embedder object in the builtin snapshot yet.
20
  UNREACHABLE();
21
}
22
23
656
StartupData SerializeNodeContextInternalFields(Local<Object> holder,
24
                                               int index,
25
                                               void* env) {
26
1312
  void* ptr = holder->GetAlignedPointerFromInternalField(index);
27

656
  if (ptr == nullptr || ptr == env) {
28
656
    return StartupData{nullptr, 0};
29
  }
30
  if (ptr == env && index == ContextEmbedderIndex::kEnvironment) {
31
    return StartupData{nullptr, 0};
32
  }
33
34
  // No embedder objects in the builtin snapshot yet.
35
  UNREACHABLE();
36
  return StartupData{nullptr, 0};
37
}
38
39

14097
}  // namespace node