OLD | NEW |
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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 | 423 |
424 | 424 |
425 int GlobalHandles::number_of_weak_handles_ = 0; | 425 int GlobalHandles::number_of_weak_handles_ = 0; |
426 int GlobalHandles::number_of_global_object_weak_handles_ = 0; | 426 int GlobalHandles::number_of_global_object_weak_handles_ = 0; |
427 | 427 |
428 GlobalHandles::Node* GlobalHandles::head_ = NULL; | 428 GlobalHandles::Node* GlobalHandles::head_ = NULL; |
429 GlobalHandles::Node* GlobalHandles::first_free_ = NULL; | 429 GlobalHandles::Node* GlobalHandles::first_free_ = NULL; |
430 GlobalHandles::Node* GlobalHandles::first_deallocated_ = NULL; | 430 GlobalHandles::Node* GlobalHandles::first_deallocated_ = NULL; |
431 | 431 |
432 void GlobalHandles::RecordStats(HeapStats* stats) { | 432 void GlobalHandles::RecordStats(HeapStats* stats) { |
433 stats->global_handle_count = 0; | 433 *stats->global_handle_count = 0; |
434 stats->weak_global_handle_count = 0; | 434 *stats->weak_global_handle_count = 0; |
435 stats->pending_global_handle_count = 0; | 435 *stats->pending_global_handle_count = 0; |
436 stats->near_death_global_handle_count = 0; | 436 *stats->near_death_global_handle_count = 0; |
437 stats->destroyed_global_handle_count = 0; | 437 *stats->destroyed_global_handle_count = 0; |
438 for (Node* current = head_; current != NULL; current = current->next()) { | 438 for (Node* current = head_; current != NULL; current = current->next()) { |
439 stats->global_handle_count++; | 439 *stats->global_handle_count++; |
440 if (current->state_ == Node::WEAK) { | 440 if (current->state_ == Node::WEAK) { |
441 stats->weak_global_handle_count++; | 441 *stats->weak_global_handle_count++; |
442 } else if (current->state_ == Node::PENDING) { | 442 } else if (current->state_ == Node::PENDING) { |
443 stats->pending_global_handle_count++; | 443 *stats->pending_global_handle_count++; |
444 } else if (current->state_ == Node::NEAR_DEATH) { | 444 } else if (current->state_ == Node::NEAR_DEATH) { |
445 stats->near_death_global_handle_count++; | 445 *stats->near_death_global_handle_count++; |
446 } else if (current->state_ == Node::DESTROYED) { | 446 } else if (current->state_ == Node::DESTROYED) { |
447 stats->destroyed_global_handle_count++; | 447 *stats->destroyed_global_handle_count++; |
448 } | 448 } |
449 } | 449 } |
450 } | 450 } |
451 | 451 |
452 #ifdef DEBUG | 452 #ifdef DEBUG |
453 | 453 |
454 void GlobalHandles::PrintStats() { | 454 void GlobalHandles::PrintStats() { |
455 int total = 0; | 455 int total = 0; |
456 int weak = 0; | 456 int weak = 0; |
457 int pending = 0; | 457 int pending = 0; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 void GlobalHandles::RemoveObjectGroups() { | 502 void GlobalHandles::RemoveObjectGroups() { |
503 List<ObjectGroup*>* object_groups = ObjectGroups(); | 503 List<ObjectGroup*>* object_groups = ObjectGroups(); |
504 for (int i = 0; i< object_groups->length(); i++) { | 504 for (int i = 0; i< object_groups->length(); i++) { |
505 delete object_groups->at(i); | 505 delete object_groups->at(i); |
506 } | 506 } |
507 object_groups->Clear(); | 507 object_groups->Clear(); |
508 } | 508 } |
509 | 509 |
510 | 510 |
511 } } // namespace v8::internal | 511 } } // namespace v8::internal |
OLD | NEW |