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

Side by Side Diff: src/heap/heap.cc

Issue 1201773005: Use CHECK_LT in CheckHandleCountVisitor for better error message (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/once.h" 10 #include "src/base/once.h"
(...skipping 5959 matching lines...) Expand 10 before | Expand all | Expand 10 after
5970 PrintF("Handles:\n"); 5970 PrintF("Handles:\n");
5971 PrintHandleVisitor v; 5971 PrintHandleVisitor v;
5972 isolate_->handle_scope_implementer()->Iterate(&v); 5972 isolate_->handle_scope_implementer()->Iterate(&v);
5973 } 5973 }
5974 5974
5975 #endif 5975 #endif
5976 5976
5977 class CheckHandleCountVisitor : public ObjectVisitor { 5977 class CheckHandleCountVisitor : public ObjectVisitor {
5978 public: 5978 public:
5979 CheckHandleCountVisitor() : handle_count_(0) {} 5979 CheckHandleCountVisitor() : handle_count_(0) {}
5980 ~CheckHandleCountVisitor() { CHECK(handle_count_ < 2000); } 5980 ~CheckHandleCountVisitor() { CHECK_LT(handle_count_, 2000); }
5981 void VisitPointers(Object** start, Object** end) { 5981 void VisitPointers(Object** start, Object** end) {
5982 handle_count_ += end - start; 5982 handle_count_ += end - start;
5983 } 5983 }
5984 5984
5985 private: 5985 private:
5986 ptrdiff_t handle_count_; 5986 ptrdiff_t handle_count_;
5987 }; 5987 };
5988 5988
5989 5989
5990 void Heap::CheckHandleCount() { 5990 void Heap::CheckHandleCount() {
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
6832 *object_type = "CODE_TYPE"; \ 6832 *object_type = "CODE_TYPE"; \
6833 *object_sub_type = "CODE_AGE/" #name; \ 6833 *object_sub_type = "CODE_AGE/" #name; \
6834 return true; 6834 return true;
6835 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) 6835 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME)
6836 #undef COMPARE_AND_RETURN_NAME 6836 #undef COMPARE_AND_RETURN_NAME
6837 } 6837 }
6838 return false; 6838 return false;
6839 } 6839 }
6840 } // namespace internal 6840 } // namespace internal
6841 } // namespace v8 6841 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698