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

Unified Diff: src/heap/heap.cc

Issue 1157393002: Version 4.3.61.26 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.3
Patch Set: Created 5 years, 7 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/json-parser.h » ('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 157024939d529c0e4513b0c00a5bb7bb24364876..42510dca0684c7f1d05c3607a98a2e6239d83caa 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -620,6 +620,7 @@ void Heap::GarbageCollectionEpilogue() {
if (FLAG_gc_verbose) Print();
if (FLAG_code_stats) ReportCodeStatistics("After GC");
#endif
+ if (FLAG_check_handle_count) CheckHandleCount();
if (FLAG_deopt_every_n_garbage_collections > 0) {
// TODO(jkummerow/ulan/jarin): This is not safe! We can't assume that
// the topmost optimized frame can be deoptimized safely, because it
@@ -5698,6 +5699,24 @@ void Heap::PrintHandles() {
#endif
+class CheckHandleCountVisitor : public ObjectVisitor {
+ public:
+ CheckHandleCountVisitor() : handle_count_(0) {}
+ ~CheckHandleCountVisitor() { CHECK(handle_count_ < 2000); }
+ void VisitPointers(Object** start, Object** end) {
+ handle_count_ += end - start;
+ }
+
+ private:
+ ptrdiff_t handle_count_;
+};
+
+
+void Heap::CheckHandleCount() {
+ CheckHandleCountVisitor v;
+ isolate_->handle_scope_implementer()->Iterate(&v);
+}
+
Space* AllSpaces::next() {
switch (counter_++) {
« no previous file with comments | « src/heap/heap.h ('k') | src/json-parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698