OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |