Skip to content

Commit 4107b5d

Browse files
Julien GilliMyles Borins
Julien Gilli
authored and
Myles Borins
committed
deps: backport 22c5e46 from V8
This removes the diagnostic code for the issue described in https://bugs.chromium.org/p/chromium/issues/detail?id=454297. That issue is private, probably due to the fact that it contains information about a security vulnerability. The original issue was fixed in V8 by https://codereview.chromium.org/1286343004, which was integrated into node v4.x with c431725, so there's no need for the corresponding diagnostic code anymore. Original commit message: [heap] Remove debugging code of crbug/454297. BUG= Review URL: https://codereview.chromium.org/1420253002 Cr-Commit-Position: refs/heads/master@{#31523} PR-URL: #7584 Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]>
1 parent 7090481 commit 4107b5d

File tree

2 files changed

+1
-101
lines changed

2 files changed

+1
-101
lines changed

deps/v8/include/v8-version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 4
1212
#define V8_MINOR_VERSION 5
1313
#define V8_BUILD_NUMBER 103
14-
#define V8_PATCH_LEVEL 36
14+
#define V8_PATCH_LEVEL 37
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

deps/v8/src/heap/mark-compact.cc

-100
Original file line numberDiff line numberDiff line change
@@ -2908,16 +2908,6 @@ class PointersUpdatingVisitor : public ObjectVisitor {
29082908

29092909
HeapObject* heap_obj = HeapObject::cast(obj);
29102910

2911-
// TODO(ishell): remove, once crbug/454297 is caught.
2912-
#if V8_TARGET_ARCH_64_BIT
2913-
#ifndef V8_OS_AIX // no point checking on AIX as full 64 range is supported
2914-
const uintptr_t kBoundary = V8_UINT64_C(1) << 48;
2915-
STATIC_ASSERT(kBoundary > 0);
2916-
if (reinterpret_cast<uintptr_t>(heap_obj->address()) >= kBoundary) {
2917-
CheckLayoutDescriptorAndDie(heap, slot);
2918-
}
2919-
#endif
2920-
#endif
29212911
MapWord map_word = heap_obj->map_word();
29222912
if (map_word.IsForwardingAddress()) {
29232913
DCHECK(heap->InFromSpace(heap_obj) ||
@@ -2935,100 +2925,10 @@ class PointersUpdatingVisitor : public ObjectVisitor {
29352925
private:
29362926
inline void UpdatePointer(Object** p) { UpdateSlot(heap_, p); }
29372927

2938-
static void CheckLayoutDescriptorAndDie(Heap* heap, Object** slot);
2939-
29402928
Heap* heap_;
29412929
};
29422930

29432931

2944-
#if V8_TARGET_ARCH_64_BIT
2945-
// TODO(ishell): remove, once crbug/454297 is caught.
2946-
void PointersUpdatingVisitor::CheckLayoutDescriptorAndDie(Heap* heap,
2947-
Object** slot) {
2948-
const int kDataBufferSize = 128;
2949-
uintptr_t data[kDataBufferSize] = {0};
2950-
int index = 0;
2951-
data[index++] = 0x10aaaaaaaaUL; // begin marker
2952-
2953-
data[index++] = reinterpret_cast<uintptr_t>(slot);
2954-
data[index++] = 0x15aaaaaaaaUL;
2955-
2956-
Address slot_address = reinterpret_cast<Address>(slot);
2957-
2958-
uintptr_t space_owner_id = 0xb001;
2959-
if (heap->new_space()->ToSpaceContains(slot_address)) {
2960-
space_owner_id = 1;
2961-
} else if (heap->new_space()->FromSpaceContains(slot_address)) {
2962-
space_owner_id = 2;
2963-
} else if (heap->old_space()->ContainsSafe(slot_address)) {
2964-
space_owner_id = 3;
2965-
} else if (heap->code_space()->ContainsSafe(slot_address)) {
2966-
space_owner_id = 4;
2967-
} else if (heap->map_space()->ContainsSafe(slot_address)) {
2968-
space_owner_id = 5;
2969-
} else {
2970-
// Lo space or other.
2971-
space_owner_id = 6;
2972-
}
2973-
data[index++] = space_owner_id;
2974-
data[index++] = 0x20aaaaaaaaUL;
2975-
2976-
// Find map word lying near before the slot address (usually the map word is
2977-
// at -3 words from the slot but just in case we look up further.
2978-
Object** map_slot = slot;
2979-
bool found = false;
2980-
const int kMaxDistanceToMap = 64;
2981-
for (int i = 0; i < kMaxDistanceToMap; i++, map_slot--) {
2982-
Address map_address = reinterpret_cast<Address>(*map_slot);
2983-
if (heap->map_space()->ContainsSafe(map_address)) {
2984-
found = true;
2985-
break;
2986-
}
2987-
}
2988-
data[index++] = found;
2989-
data[index++] = 0x30aaaaaaaaUL;
2990-
data[index++] = reinterpret_cast<uintptr_t>(map_slot);
2991-
data[index++] = 0x35aaaaaaaaUL;
2992-
2993-
if (found) {
2994-
Address obj_address = reinterpret_cast<Address>(map_slot);
2995-
Address end_of_page =
2996-
reinterpret_cast<Address>(Page::FromAddress(obj_address)) +
2997-
Page::kPageSize;
2998-
Address end_address =
2999-
Min(obj_address + kPointerSize * kMaxDistanceToMap, end_of_page);
3000-
int size = static_cast<int>(end_address - obj_address);
3001-
data[index++] = size / kPointerSize;
3002-
data[index++] = 0x40aaaaaaaaUL;
3003-
memcpy(&data[index], reinterpret_cast<void*>(map_slot), size);
3004-
index += size / kPointerSize;
3005-
data[index++] = 0x50aaaaaaaaUL;
3006-
3007-
HeapObject* object = HeapObject::FromAddress(obj_address);
3008-
data[index++] = reinterpret_cast<uintptr_t>(object);
3009-
data[index++] = 0x60aaaaaaaaUL;
3010-
3011-
Map* map = object->map();
3012-
data[index++] = reinterpret_cast<uintptr_t>(map);
3013-
data[index++] = 0x70aaaaaaaaUL;
3014-
3015-
LayoutDescriptor* layout_descriptor = map->layout_descriptor();
3016-
data[index++] = reinterpret_cast<uintptr_t>(layout_descriptor);
3017-
data[index++] = 0x80aaaaaaaaUL;
3018-
3019-
memcpy(&data[index], reinterpret_cast<void*>(map->address()), Map::kSize);
3020-
index += Map::kSize / kPointerSize;
3021-
data[index++] = 0x90aaaaaaaaUL;
3022-
}
3023-
3024-
data[index++] = 0xeeeeeeeeeeUL;
3025-
DCHECK(index < kDataBufferSize);
3026-
base::OS::PrintError("Data: %p\n", static_cast<void*>(data));
3027-
base::OS::Abort();
3028-
}
3029-
#endif
3030-
3031-
30322932
static void UpdatePointer(HeapObject** address, HeapObject* object) {
30332933
MapWord map_word = object->map_word();
30342934
// The store buffer can still contain stale pointers in dead large objects.

0 commit comments

Comments
 (0)