summaryrefslogtreecommitdiff
path: root/deps/v8/tools/debug_helper/gen-heap-constants.py
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/tools/debug_helper/gen-heap-constants.py')
-rw-r--r--deps/v8/tools/debug_helper/gen-heap-constants.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/deps/v8/tools/debug_helper/gen-heap-constants.py b/deps/v8/tools/debug_helper/gen-heap-constants.py
index 0fd575a994..1d81f2e510 100644
--- a/deps/v8/tools/debug_helper/gen-heap-constants.py
+++ b/deps/v8/tools/debug_helper/gen-heap-constants.py
@@ -16,6 +16,9 @@ out = """
#include <cstdint>
#include <string>
+#include "src/common/ptr-compr-inl.h"
+#include "tools/debug_helper/debug-helper-internal.h"
+
namespace v8_debug_helper_internal {
"""
@@ -51,6 +54,22 @@ def iterate_maps(target_space, camel_space_name):
iterate_maps('map_space', 'MapSpace')
iterate_maps('read_only_space', 'ReadOnlySpace')
+out = out + '\nvoid FillInUnknownHeapAddresses(' + \
+ 'd::HeapAddresses* heap_addresses, uintptr_t any_uncompressed_ptr) {\n'
+if (hasattr(v8heapconst, 'HEAP_FIRST_PAGES')): # Only exists in ptr-compr builds.
+ out = out + ' if (heap_addresses->any_heap_pointer == 0) {\n'
+ out = out + ' heap_addresses->any_heap_pointer = any_uncompressed_ptr;\n'
+ out = out + ' }\n'
+ expected_spaces = set(['map_space', 'read_only_space', 'old_space'])
+ for offset, space_name in v8heapconst.HEAP_FIRST_PAGES.items():
+ if (space_name in expected_spaces):
+ out = out + ' if (heap_addresses->' + space_name + '_first_page == 0) {\n'
+ out = out + ' heap_addresses->' + space_name + \
+ '_first_page = i::DecompressTaggedPointer(any_uncompressed_ptr, ' + \
+ str(offset) + ');\n'
+ out = out + ' }\n'
+out = out + '}\n'
+
out = out + '\n}\n'
try: