diff options
Diffstat (limited to 'deps/v8/test/mkgrokdump/mkgrokdump.cc')
-rw-r--r-- | deps/v8/test/mkgrokdump/mkgrokdump.cc | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/deps/v8/test/mkgrokdump/mkgrokdump.cc b/deps/v8/test/mkgrokdump/mkgrokdump.cc index 8c07576d3a..5f39a063e4 100644 --- a/deps/v8/test/mkgrokdump/mkgrokdump.cc +++ b/deps/v8/test/mkgrokdump/mkgrokdump.cc @@ -26,10 +26,9 @@ static const char* kHeader = "\n" "# List of known V8 instance types.\n"; -// Non-snapshot builds allocate objects to different places. // Debug builds emit debug code, affecting code object sizes. // Embedded builtins cause objects to be allocated in different locations. -#if defined(V8_EMBEDDED_BUILTINS) && defined(V8_USE_SNAPSHOT) && !defined(DEBUG) +#if defined(V8_EMBEDDED_BUILTINS) && !defined(DEBUG) static const char* kBuild = "shipping"; #else static const char* kBuild = "non-shipping"; @@ -97,6 +96,14 @@ static void DumpKnownObject(FILE* out, i::Heap* heap, const char* space_name, #undef RO_ROOT_LIST_CASE } +static void DumpSpaceFirstPageAddress(FILE* out, i::PagedSpace* space) { + const char* name = space->name(); + i::Address first_page = reinterpret_cast<i::Address>(space->first_page()); + i::Tagged_t compressed = i::CompressTagged(first_page); + uintptr_t unsigned_compressed = static_cast<uint32_t>(compressed); + i::PrintF(out, " 0x%08" V8PRIxPTR ": \"%s\",\n", unsigned_compressed, name); +} + static int DumpHeapConstants(FILE* out, const char* argv0) { // Start up V8. std::unique_ptr<v8::Platform> platform = v8::platform::NewDefaultPlatform(); @@ -164,6 +171,29 @@ static int DumpHeapConstants(FILE* out, const char* argv0) { i::PrintF(out, "}\n"); } + if (COMPRESS_POINTERS_BOOL) { + // Dump a list of addresses for the first page of each space that contains + // objects in the other tables above. This is only useful if two + // assumptions hold: + // 1. Those pages are positioned deterministically within the heap + // reservation block during snapshot deserialization. + // 2. Those pages cannot ever be moved (such as by compaction). + i::PrintF(out, + "\n# Lower 32 bits of first page addresses for various heap " + "spaces.\n"); + i::PrintF(out, "HEAP_FIRST_PAGES = {\n"); + i::PagedSpaceIterator it(heap); + for (i::PagedSpace* s = it.Next(); s != nullptr; s = it.Next()) { + // Code page is different on Windows vs Linux (bug v8:9844), so skip it. + if (s->identity() == i::CODE_SPACE) { + continue; + } + DumpSpaceFirstPageAddress(out, s); + } + DumpSpaceFirstPageAddress(out, read_only_heap->read_only_space()); + i::PrintF(out, "}\n"); + } + // Dump frame markers i::PrintF(out, "\n# List of known V8 Frame Markers.\n"); #define DUMP_MARKER(T, class) i::PrintF(out, " \"%s\",\n", #T); |