Commit 01079cb8 authored by Hannes Payer's avatar Hannes Payer Committed by Commit Bot

[heap] Removed unused slow object lookup functions.

Change-Id: Ic9be35646beb47d0074154aa2e38dc9527911b01
Reviewed-on: https://chromium-review.googlesource.com/c/1327046
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57551}
parent 2035042e
......@@ -334,8 +334,7 @@ void ArmDebugger::Debug() {
HeapObject* obj = reinterpret_cast<HeapObject*>(*cur);
int value = *cur;
Heap* current_heap = sim_->isolate_->heap();
if (((value & 1) == 0) ||
current_heap->ContainsSlow(obj->address())) {
if (((value & 1) == 0) || current_heap->Contains(obj)) {
PrintF(" (");
if ((value & 1) == 0) {
PrintF("smi %d", value / 2);
......
......@@ -3295,8 +3295,7 @@ void Simulator::Debug() {
HeapObject* obj = reinterpret_cast<HeapObject*>(*cur);
int64_t value = *cur;
Heap* current_heap = isolate_->heap();
if (((value & 1) == 0) ||
current_heap->ContainsSlow(obj->address())) {
if (((value & 1) == 0) || current_heap->Contains(obj)) {
PrintF(" (");
if ((value & kSmiTagMask) == 0) {
DCHECK(SmiValuesAre32Bits() || SmiValuesAre31Bits());
......
......@@ -459,14 +459,6 @@ bool Heap::InReadOnlySpace(Object* object) {
return read_only_space_->Contains(object);
}
bool Heap::InNewSpaceSlow(Address address) {
return new_space_->ContainsSlow(address);
}
bool Heap::InOldSpaceSlow(Address address) {
return old_space_->ContainsSlow(address);
}
// static
Heap* Heap::FromWritableHeapObject(const HeapObject* obj) {
MemoryChunk* chunk = MemoryChunk::FromHeapObject(obj);
......
......@@ -3397,17 +3397,6 @@ bool Heap::Contains(HeapObject* value) {
lo_space_->Contains(value) || read_only_space_->Contains(value));
}
bool Heap::ContainsSlow(Address addr) {
if (memory_allocator()->IsOutsideAllocatedSpace(addr)) {
return false;
}
return HasBeenSetUp() &&
(new_space_->ToSpaceContainsSlow(addr) ||
old_space_->ContainsSlow(addr) || code_space_->ContainsSlow(addr) ||
map_space_->ContainsSlow(addr) || lo_space_->ContainsSlow(addr) ||
read_only_space_->Contains(addr));
}
bool Heap::InSpace(HeapObject* value, AllocationSpace space) {
if (memory_allocator()->IsOutsideAllocatedSpace(value->address())) {
return false;
......
......@@ -949,10 +949,7 @@ class Heap {
// Slow methods that can be used for verification as they can also be used
// with off-heap Addresses.
bool ContainsSlow(Address addr);
bool InSpaceSlow(Address addr, AllocationSpace space);
inline bool InNewSpaceSlow(Address address);
inline bool InOldSpaceSlow(Address address);
// Find the heap which owns this HeapObject. Should never be called for
// objects in RO space.
......
......@@ -154,10 +154,6 @@ bool NewSpace::ToSpaceContainsSlow(Address a) {
return to_space_.ContainsSlow(a);
}
bool NewSpace::FromSpaceContainsSlow(Address a) {
return from_space_.ContainsSlow(a);
}
bool NewSpace::ToSpaceContains(Object* o) { return to_space_.Contains(o); }
bool NewSpace::FromSpaceContains(Object* o) { return from_space_.Contains(o); }
......
......@@ -3462,11 +3462,6 @@ Object* LargeObjectSpace::FindObject(Address a) {
return Smi::kZero; // Signaling not found.
}
LargePage* LargeObjectSpace::FindPageThreadSafe(Address a) {
base::MutexGuard guard(&chunk_map_mutex_);
return FindPage(a);
}
LargePage* LargeObjectSpace::FindPage(Address a) {
const Address key = MemoryChunk::FromAddress(a)->address();
auto it = chunk_map_.find(key);
......
......@@ -2730,7 +2730,6 @@ class NewSpace : public SpaceWithLinearArea {
void UpdateInlineAllocationLimit(size_t size_in_bytes) override;
inline bool ToSpaceContainsSlow(Address a);
inline bool FromSpaceContainsSlow(Address a);
inline bool ToSpaceContains(Object* o);
inline bool FromSpaceContains(Object* o);
......@@ -2984,9 +2983,6 @@ class LargeObjectSpace : public Space {
// The function iterates through all objects in this space, may be slow.
Object* FindObject(Address a);
// Takes the chunk_map_mutex_ and calls FindPage after that.
LargePage* FindPageThreadSafe(Address a);
// Finds a large object page containing the given address, returns nullptr
// if such a page doesn't exist.
LargePage* FindPage(Address a);
......
......@@ -860,9 +860,9 @@ UnalignedSlot Deserializer::ReadDataCase(Isolate* isolate,
}
}
if (emit_write_barrier && write_barrier_needed) {
SLOW_DCHECK(isolate->heap()->ContainsSlow(current_object_address));
GenerationalBarrier(HeapObject::FromAddress(current_object_address),
current.Slot(), current.Read());
HeapObject* object = HeapObject::FromAddress(current_object_address);
SLOW_DCHECK(isolate->heap()->Contains(object));
GenerationalBarrier(object, current.Slot(), current.Read());
}
if (!current_was_incremented) {
current.Advance();
......
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