From 6eb8316e7aaf83ed35185e97acb9320acecbb741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Inf=C3=BChr?= Date: Fri, 28 Oct 2022 15:43:46 +0200 Subject: [PATCH] [execution] Report first old space page as CrashKey MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Maps are now in old space, so start to report the first page in old space now. Bug: v8:12578 Change-Id: Icf08c9074558a2d47bb9f1f8df72cec9668d2b4e Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3986087 Auto-Submit: Dominik Inführ Commit-Queue: Michael Lippautz Reviewed-by: Igor Sheludko Reviewed-by: Michael Lippautz Cr-Commit-Position: refs/heads/main@{#84002} --- include/v8-callbacks.h | 3 ++- src/execution/isolate.cc | 5 +++++ test/unittests/api/isolate-unittest.cc | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/v8-callbacks.h b/include/v8-callbacks.h index c02059a589..0ffdfb6656 100644 --- a/include/v8-callbacks.h +++ b/include/v8-callbacks.h @@ -237,7 +237,8 @@ using LogEventCallback = void (*)(const char* name, enum class CrashKeyId { kIsolateAddress, kReadonlySpaceFirstPageAddress, - kMapSpaceFirstPageAddress, + kMapSpaceFirstPageAddress V8_ENUM_DEPRECATE_SOON("Map space got removed"), + kOldSpaceFirstPageAddress, kCodeRangeBaseAddress, kCodeSpaceFirstPageAddress, kDumpType, diff --git a/src/execution/isolate.cc b/src/execution/isolate.cc index 641ebdc359..f68b81224c 100644 --- a/src/execution/isolate.cc +++ b/src/execution/isolate.cc @@ -4035,6 +4035,11 @@ void Isolate::AddCrashKeysForIsolateAndHeapPointers() { add_crash_key_callback_(v8::CrashKeyId::kReadonlySpaceFirstPageAddress, ToHexString(ro_space_firstpage_address)); + const uintptr_t old_space_firstpage_address = + heap()->old_space()->FirstPageAddress(); + add_crash_key_callback_(v8::CrashKeyId::kOldSpaceFirstPageAddress, + ToHexString(old_space_firstpage_address)); + if (heap()->code_range_base()) { const uintptr_t code_range_base_address = heap()->code_range_base(); add_crash_key_callback_(v8::CrashKeyId::kCodeRangeBaseAddress, diff --git a/test/unittests/api/isolate-unittest.cc b/test/unittests/api/isolate-unittest.cc index a47c6261f6..a5691b95db 100644 --- a/test/unittests/api/isolate-unittest.cc +++ b/test/unittests/api/isolate-unittest.cc @@ -145,10 +145,11 @@ TEST_F(IsolateTest, SetAddCrashKeyCallback) { i::Isolate* i_isolate = reinterpret_cast(isolate()); i::Heap* heap = i_isolate->heap(); - size_t expected_keys_count = 4; + size_t expected_keys_count = 5; EXPECT_EQ(crash_keys.count(v8::CrashKeyId::kIsolateAddress), 1u); EXPECT_EQ(crash_keys.count(v8::CrashKeyId::kReadonlySpaceFirstPageAddress), 1u); + EXPECT_EQ(crash_keys.count(v8::CrashKeyId::kOldSpaceFirstPageAddress), 1u); EXPECT_EQ(crash_keys.count(v8::CrashKeyId::kSnapshotChecksumCalculated), 1u); EXPECT_EQ(crash_keys.count(v8::CrashKeyId::kSnapshotChecksumExpected), 1u);