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

Side by Side Diff: src/global-handles.cc

Issue 462035: Push bleeding_edge revision 3417 to 1.3 branch. This change unfolds... (Closed) Base URL: http://v8.googlecode.com/svn/branches/1.3/
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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/api.cc ('k') | src/heap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 413
414 414
415 int GlobalHandles::number_of_weak_handles_ = 0; 415 int GlobalHandles::number_of_weak_handles_ = 0;
416 int GlobalHandles::number_of_global_object_weak_handles_ = 0; 416 int GlobalHandles::number_of_global_object_weak_handles_ = 0;
417 417
418 GlobalHandles::Node* GlobalHandles::head_ = NULL; 418 GlobalHandles::Node* GlobalHandles::head_ = NULL;
419 GlobalHandles::Node* GlobalHandles::first_free_ = NULL; 419 GlobalHandles::Node* GlobalHandles::first_free_ = NULL;
420 GlobalHandles::Node* GlobalHandles::first_deallocated_ = NULL; 420 GlobalHandles::Node* GlobalHandles::first_deallocated_ = NULL;
421 421
422 void GlobalHandles::RecordStats(HeapStats* stats) { 422 void GlobalHandles::RecordStats(HeapStats* stats) {
423 stats->global_handle_count = 0; 423 *stats->global_handle_count = 0;
424 stats->weak_global_handle_count = 0; 424 *stats->weak_global_handle_count = 0;
425 stats->pending_global_handle_count = 0; 425 *stats->pending_global_handle_count = 0;
426 stats->near_death_global_handle_count = 0; 426 *stats->near_death_global_handle_count = 0;
427 stats->destroyed_global_handle_count = 0; 427 *stats->destroyed_global_handle_count = 0;
428 for (Node* current = head_; current != NULL; current = current->next()) { 428 for (Node* current = head_; current != NULL; current = current->next()) {
429 stats->global_handle_count++; 429 *stats->global_handle_count += 1;
430 if (current->state_ == Node::WEAK) { 430 if (current->state_ == Node::WEAK) {
431 stats->weak_global_handle_count++; 431 *stats->weak_global_handle_count += 1;
432 } else if (current->state_ == Node::PENDING) { 432 } else if (current->state_ == Node::PENDING) {
433 stats->pending_global_handle_count++; 433 *stats->pending_global_handle_count += 1;
434 } else if (current->state_ == Node::NEAR_DEATH) { 434 } else if (current->state_ == Node::NEAR_DEATH) {
435 stats->near_death_global_handle_count++; 435 *stats->near_death_global_handle_count += 1;
436 } else if (current->state_ == Node::DESTROYED) { 436 } else if (current->state_ == Node::DESTROYED) {
437 stats->destroyed_global_handle_count++; 437 *stats->destroyed_global_handle_count += 1;
438 } 438 }
439 } 439 }
440 } 440 }
441 441
442 #ifdef DEBUG 442 #ifdef DEBUG
443 443
444 void GlobalHandles::PrintStats() { 444 void GlobalHandles::PrintStats() {
445 int total = 0; 445 int total = 0;
446 int weak = 0; 446 int weak = 0;
447 int pending = 0; 447 int pending = 0;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 void GlobalHandles::RemoveObjectGroups() { 492 void GlobalHandles::RemoveObjectGroups() {
493 List<ObjectGroup*>* object_groups = ObjectGroups(); 493 List<ObjectGroup*>* object_groups = ObjectGroups();
494 for (int i = 0; i< object_groups->length(); i++) { 494 for (int i = 0; i< object_groups->length(); i++) {
495 delete object_groups->at(i); 495 delete object_groups->at(i);
496 } 496 }
497 object_groups->Clear(); 497 object_groups->Clear();
498 } 498 }
499 499
500 500
501 } } // namespace v8::internal 501 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698