| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 361a643 commit 0aa255a
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3820,6 +3820,9 @@ cases: | |||
| 3820 | 3820 | options were set, but the port number chosen was invalid or unavailable. | |
| 3821 | 3821 | * `13` **Unfinished Top-Level Await**: `await` was used outside of a function | |
| 3822 | 3822 | in the top-level code, but the passed `Promise` never resolved. | |
| 3823 | + * `14` **Snapshot Failure**: Node.js was started to build a V8 startup | ||
| 3824 | + snapshot and it failed because certain requirements of the state of | ||
| 3825 | + the application were not met. | ||
| 3823 | 3826 | * `>128` **Signal Exits**: If Node.js receives a fatal signal such as | |
| 3824 | 3827 | `SIGKILL` or `SIGHUP`, then its exit code will be `128` plus the | |
| 3825 | 3828 | value of the signal code. This is a standard POSIX practice, since | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -963,13 +963,17 @@ struct EnvSerializeInfo { | |||
| 963 | 963 | }; | |
| 964 | 964 | ||
| 965 | 965 | struct SnapshotData { | |
| 966 | - // The result of v8::SnapshotCreator::CreateBlob() during the snapshot | ||
| 967 | - // building process. | ||
| 968 | - v8::StartupData v8_snapshot_blob_data; | ||
| 966 | + enum class DataOwnership { kOwned, kNotOwned }; | ||
| 969 | 967 | ||
| 970 | 968 | static const size_t kNodeBaseContextIndex = 0; | |
| 971 | 969 | static const size_t kNodeMainContextIndex = kNodeBaseContextIndex + 1; | |
| 972 | 970 | ||
| 971 | + DataOwnership data_ownership = DataOwnership::kOwned; | ||
| 972 | + | ||
| 973 | + // The result of v8::SnapshotCreator::CreateBlob() during the snapshot | ||
| 974 | + // building process. | ||
| 975 | + v8::StartupData v8_snapshot_blob_data{nullptr, 0}; | ||
| 976 | + | ||
| 973 | 977 | std::vector<size_t> isolate_data_indices; | |
| 974 | 978 | // TODO(joyeecheung): there should be a vector of env_info once we snapshot | |
| 975 | 979 | // the worker environments. | |
@@ -979,6 +983,15 @@ struct SnapshotData { | |||
| 979 | 983 | // read only space. We use native_module::CodeCacheInfo because | |
| 980 | 984 | // v8::ScriptCompiler::CachedData is not copyable. | |
| 981 | 985 | std::vector<native_module::CodeCacheInfo> code_cache; | |
| 986 | + | ||
| 987 | + ~SnapshotData(); | ||
| 988 | + | ||
| 989 | + SnapshotData(const SnapshotData&) = delete; | ||
| 990 | + SnapshotData& operator=(const SnapshotData&) = delete; | ||
| 991 | + SnapshotData(SnapshotData&&) = delete; | ||
| 992 | + SnapshotData& operator=(SnapshotData&&) = delete; | ||
| 993 | + | ||
| 994 | + SnapshotData() = default; | ||
| 982 | 995 | }; | |
| 983 | 996 | ||
| 984 | 997 | class Environment : public MemoryRetainer { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,13 +15,14 @@ struct SnapshotData; | |||
| 15 | 15 | ||
| 16 | 16 | class NODE_EXTERN_PRIVATE SnapshotBuilder { | |
| 17 | 17 | public: | |
| 18 | - static std::string Generate(const std::vector<std::string> args, | ||
| 19 | - const std::vector<std::string> exec_args); | ||
| 18 | + static int Generate(std::ostream& out, | ||
| 19 | + const std::vector<std::string> args, | ||
| 20 | + const std::vector<std::string> exec_args); | ||
| 20 | 21 | ||
| 21 | 22 | // Generate the snapshot into out. | |
| 22 | - static void Generate(SnapshotData* out, | ||
| 23 | - const std::vector<std::string> args, | ||
| 24 | - const std::vector<std::string> exec_args); | ||
| 23 | + static int Generate(SnapshotData* out, | ||
| 24 | + const std::vector<std::string> args, | ||
| 25 | + const std::vector<std::string> exec_args); | ||
| 25 | 26 | ||
| 26 | 27 | // If nullptr is returned, the binary is not built with embedded | |
| 27 | 28 | // snapshot. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments