Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Unified Diff: src/heap/heap.cc

Issue 2078403002: [heap] Filter out stale left-trimmed handles (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove check that ensure that only a single handle points to left-trimmed array Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index e724ea420a4cd9c5fe77e83c0c03df291ad5a01a..f7dc451efaea61504113b699334aca4e8bd444b3 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -3160,10 +3160,6 @@ FixedArrayBase* Heap::LeftTrimFixedArray(FixedArrayBase* object,
DCHECK(!lo_space()->Contains(object));
DCHECK(object->map() != fixed_cow_array_map());
- // Ensure that the no handle-scope has more than one pointer to the same
- // backing-store.
- SLOW_DCHECK(CountHandlesForObject(object) <= 1);
-
STATIC_ASSERT(FixedArrayBase::kMapOffset == 0);
STATIC_ASSERT(FixedArrayBase::kLengthOffset == kPointerSize);
STATIC_ASSERT(FixedArrayBase::kHeaderSize == 2 * kPointerSize);
@@ -5723,32 +5719,6 @@ void Heap::PrintHandles() {
#endif
-#ifdef ENABLE_SLOW_DCHECKS
-
-class CountHandleVisitor : public ObjectVisitor {
- public:
- explicit CountHandleVisitor(Object* object) : object_(object) {}
-
- void VisitPointers(Object** start, Object** end) override {
- for (Object** p = start; p < end; p++) {
- if (object_ == reinterpret_cast<Object*>(*p)) count_++;
- }
- }
-
- int count() { return count_; }
-
- private:
- Object* object_;
- int count_ = 0;
-};
-
-int Heap::CountHandlesForObject(Object* object) {
- CountHandleVisitor v(object);
- isolate_->handle_scope_implementer()->Iterate(&v);
- return v.count();
-}
-#endif
-
class CheckHandleCountVisitor : public ObjectVisitor {
public:
CheckHandleCountVisitor() : handle_count_(0) {}
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698