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

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

Issue 465055: Fixed operator precedence bug in heap stat recording. (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 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 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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 += 1;
440 if (current->state_ == Node::WEAK) { 440 if (current->state_ == Node::WEAK) {
441 *stats->weak_global_handle_count++; 441 *stats->weak_global_handle_count += 1;
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 += 1;
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 += 1;
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 += 1;
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
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
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