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

Unified Diff: src/global-handles.cc

Issue 462019: Added recording of heap and global handle stats in a stack-allocated (Closed)
Patch Set: Created 11 years 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/global-handles.h ('k') | src/heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/global-handles.cc
diff --git a/src/global-handles.cc b/src/global-handles.cc
index e519d7077fa5e4fa34517410f427bf73a62a31a9..5b01f61f3af5a1fba7fd1a8064eca55b5a7f2ea1 100644
--- a/src/global-handles.cc
+++ b/src/global-handles.cc
@@ -429,6 +429,26 @@ GlobalHandles::Node* GlobalHandles::head_ = NULL;
GlobalHandles::Node* GlobalHandles::first_free_ = NULL;
GlobalHandles::Node* GlobalHandles::first_deallocated_ = NULL;
+void GlobalHandles::RecordStats(HeapStats* stats) {
+ stats->global_handle_count = 0;
+ stats->weak_global_handle_count = 0;
+ stats->pending_global_handle_count = 0;
+ stats->near_death_global_handle_count = 0;
+ stats->destroyed_global_handle_count = 0;
+ for (Node* current = head_; current != NULL; current = current->next()) {
+ stats->global_handle_count++;
+ if (current->state_ == Node::WEAK) {
+ stats->weak_global_handle_count++;
+ } else if (current->state_ == Node::PENDING) {
+ stats->pending_global_handle_count++;
+ } else if (current->state_ == Node::NEAR_DEATH) {
+ stats->near_death_global_handle_count++;
+ } else if (current->state_ == Node::DESTROYED) {
+ stats->destroyed_global_handle_count++;
+ }
+ }
+}
+
#ifdef DEBUG
void GlobalHandles::PrintStats() {
« no previous file with comments | « src/global-handles.h ('k') | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698