From 0baef0ce95067643299808bf2e322d096d1c6934 Mon Sep 17 00:00:00 2001 From: xicilion Date: Sat, 28 Sep 2024 05:54:55 +0800 Subject: [PATCH] v8, refactor: disable snapshot checksum verification to support loading dumped code cache. --- v8/patch/readme.md | 6 +++++- v8/src/snapshot/code-serializer.cc | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/v8/patch/readme.md b/v8/patch/readme.md index cb5da38be..cd87a945c 100644 --- a/v8/patch/readme.md +++ b/v8/patch/readme.md @@ -108,4 +108,8 @@ bool OS::IsHardwareEnforcedShadowStacksEnabled() { // #if defined(_MSC_VER) && !defined(__clang__) #define V8_COMPILER_IS_MSVC // #endif -``` \ No newline at end of file +``` +#### src/snapshot/code-serializer.cc +```cpp +// return SerializedCodeSanityCheckResult::kReadOnlySnapshotChecksumMismatch; +``` diff --git a/v8/src/snapshot/code-serializer.cc b/v8/src/snapshot/code-serializer.cc index 1f164b51d..ce5c8f113 100644 --- a/v8/src/snapshot/code-serializer.cc +++ b/v8/src/snapshot/code-serializer.cc @@ -735,7 +735,7 @@ SerializedCodeSanityCheckResult SerializedCodeData::SanityCheckWithoutSource( uint32_t ro_snapshot_checksum = GetHeaderValue(kReadOnlySnapshotChecksumOffset); if (ro_snapshot_checksum != expected_ro_snapshot_checksum) { - return SerializedCodeSanityCheckResult::kReadOnlySnapshotChecksumMismatch; + // return SerializedCodeSanityCheckResult::kReadOnlySnapshotChecksumMismatch; } uint32_t payload_length = GetHeaderValue(kPayloadLengthOffset); uint32_t max_payload_length = size_ - kHeaderSize;