Commit 557c745e authored by Irina Yatsenko's avatar Irina Yatsenko Committed by Commit Bot

Add full heap dump crash key trigger and use it for crashes under ScavengePage.

Bug: chromium:1010312
Change-Id: I46ca9349f15f3dac896a4ab631be672c1979cc48
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1838927
Commit-Queue: Irina Yatsenko <irinayat@microsoft.com>
Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64167}
parent 3104dd42
......@@ -6958,6 +6958,7 @@ enum class CrashKeyId {
kReadonlySpaceFirstPageAddress,
kMapSpaceFirstPageAddress,
kCodeSpaceFirstPageAddress,
kDumpType,
};
typedef void (*AddCrashKeyCallback)(CrashKeyId id, const std::string& value);
......
......@@ -1418,6 +1418,11 @@ class Isolate final : private HiddenFactory {
bool HasPrepareStackTraceCallback() const;
void SetAddCrashKeyCallback(AddCrashKeyCallback callback);
void AddCrashKey(CrashKeyId id, const std::string& value) {
if (add_crash_key_callback_) {
add_crash_key_callback_(id, value);
}
}
void SetRAILMode(RAILMode rail_mode);
......
......@@ -437,7 +437,22 @@ void Scavenger::AddPageToSweeperIfNecessary(MemoryChunk* page) {
}
}
// Remove this crashkey after chromium:1010312 is fixed.
class ScopedFullHeapCrashKey {
public:
explicit ScopedFullHeapCrashKey(Isolate* isolate) : isolate_(isolate) {
isolate_->AddCrashKey(v8::CrashKeyId::kDumpType, "heap");
}
~ScopedFullHeapCrashKey() {
isolate_->AddCrashKey(v8::CrashKeyId::kDumpType, "");
}
private:
Isolate* isolate_ = nullptr;
};
void Scavenger::ScavengePage(MemoryChunk* page) {
ScopedFullHeapCrashKey collect_full_heap_dump_if_crash(heap_->isolate());
CodePageMemoryModificationScope memory_modification_scope(page);
InvalidatedSlotsFilter filter = InvalidatedSlotsFilter::OldToNew(page);
RememberedSet<OLD_TO_NEW>::Iterate(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment