Commit 386ed8a9 authored by Seth Brenith's avatar Seth Brenith Committed by Commit Bot

Update postmortem tools to use unsigned compressed pointers

The tests were already passing because they happened to use objects
allocated in the lower half of the heap reservation, but this small
change should make behavior more consistent.

Change-Id: Ib6be3123d347234f4771c213f2209bfe6e19c569
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1860332Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#64294}
parent 609f566b
......@@ -12,9 +12,7 @@ namespace v8_debug_helper_internal {
bool IsPointerCompressed(uintptr_t address) {
#if COMPRESS_POINTERS_BOOL
STATIC_ASSERT(i::kPtrComprHeapReservationSize == uintptr_t{1} << 32);
intptr_t signed_address = static_cast<intptr_t>(address);
return signed_address >= INT32_MIN && signed_address <= INT32_MAX;
return address < i::kPtrComprHeapReservationSize;
#else
return false;
#endif
......
......@@ -171,7 +171,7 @@ using ObjectPropertiesResultPtr =
// Get information about the given object pointer, which could be:
// - A tagged pointer, strong or weak
// - A cleared weak pointer
// - A compressed tagged pointer, sign-extended to 64 bits
// - A compressed tagged pointer, zero-extended to 64 bits
// - A tagged small integer
// The type hint is only used if the object's Map is missing or corrupt. It
// should be the fully-qualified name of a class that inherits from
......
......@@ -62,9 +62,6 @@ if (hasattr(v8heapconst, 'HEAP_FIRST_PAGES')): # Only exists in ptr-compr build
out = out + ' }\n'
expected_spaces = set(['map_space', 'read_only_space', 'old_space'])
for offset, space_name in v8heapconst.HEAP_FIRST_PAGES.items():
# Turn 32-bit unsigned value into signed.
if offset >= 0x80000000:
offset -= 0x100000000
if (space_name in expected_spaces):
out = out + ' if (heap_addresses->' + space_name + '_first_page == 0) {\n'
out = out + ' heap_addresses->' + space_name + \
......
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