OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 #endif | 438 #endif |
439 | 439 |
440 isolate_->counters()->alive_after_last_gc()->Set( | 440 isolate_->counters()->alive_after_last_gc()->Set( |
441 static_cast<int>(SizeOfObjects())); | 441 static_cast<int>(SizeOfObjects())); |
442 | 442 |
443 isolate_->counters()->symbol_table_capacity()->Set( | 443 isolate_->counters()->symbol_table_capacity()->Set( |
444 symbol_table()->Capacity()); | 444 symbol_table()->Capacity()); |
445 isolate_->counters()->number_of_symbols()->Set( | 445 isolate_->counters()->number_of_symbols()->Set( |
446 symbol_table()->NumberOfElements()); | 446 symbol_table()->NumberOfElements()); |
447 | 447 |
448 isolate_->counters()->new_space_bytes_available()->Set( | 448 #define UPDATE_COUNTERS_FOR_SPACE(space) \ |
449 static_cast<int>(new_space()->Available())); | 449 isolate_->counters()->space##_bytes_available()->Set( \ |
450 isolate_->counters()->new_space_bytes_committed()->Set( | 450 static_cast<int>(space()->Available())); \ |
451 static_cast<int>(new_space()->CommittedMemory())); | 451 isolate_->counters()->space##_bytes_committed()->Set( \ |
452 isolate_->counters()->new_space_bytes_used()->Set( | 452 static_cast<int>(space()->CommittedMemory())); \ |
453 static_cast<int>(new_space()->SizeOfObjects())); | 453 isolate_->counters()->space##_bytes_used()->Set( \ |
454 | 454 static_cast<int>(space()->SizeOfObjects())); \ |
455 isolate_->counters()->old_pointer_space_bytes_available()->Set( | 455 if (space()->CommittedMemory() > 0) { \ |
456 static_cast<int>(old_pointer_space()->Available())); | 456 isolate_->counters()->external_fragmentation_##space()->AddSample( \ |
457 isolate_->counters()->old_pointer_space_bytes_committed()->Set( | 457 static_cast<int>( \ |
458 static_cast<int>(old_pointer_space()->CommittedMemory())); | 458 (space()->SizeOfObjects() * 100) / space()->CommittedMemory())); \ |
459 isolate_->counters()->old_pointer_space_bytes_used()->Set( | 459 } |
460 static_cast<int>(old_pointer_space()->SizeOfObjects())); | 460 UPDATE_COUNTERS_FOR_SPACE(new_space) |
461 | 461 UPDATE_COUNTERS_FOR_SPACE(old_pointer_space) |
462 isolate_->counters()->old_data_space_bytes_available()->Set( | 462 UPDATE_COUNTERS_FOR_SPACE(old_data_space) |
463 static_cast<int>(old_data_space()->Available())); | 463 UPDATE_COUNTERS_FOR_SPACE(code_space) |
464 isolate_->counters()->old_data_space_bytes_committed()->Set( | 464 UPDATE_COUNTERS_FOR_SPACE(map_space) |
465 static_cast<int>(old_data_space()->CommittedMemory())); | 465 UPDATE_COUNTERS_FOR_SPACE(cell_space) |
466 isolate_->counters()->old_data_space_bytes_used()->Set( | 466 UPDATE_COUNTERS_FOR_SPACE(lo_space) |
467 static_cast<int>(old_data_space()->SizeOfObjects())); | 467 #undef UPDATE_COUNTERS_FOR_SPACE |
468 | |
469 isolate_->counters()->code_space_bytes_available()->Set( | |
470 static_cast<int>(code_space()->Available())); | |
471 isolate_->counters()->code_space_bytes_committed()->Set( | |
472 static_cast<int>(code_space()->CommittedMemory())); | |
473 isolate_->counters()->code_space_bytes_used()->Set( | |
474 static_cast<int>(code_space()->SizeOfObjects())); | |
475 | |
476 isolate_->counters()->map_space_bytes_available()->Set( | |
477 static_cast<int>(map_space()->Available())); | |
478 isolate_->counters()->map_space_bytes_committed()->Set( | |
479 static_cast<int>(map_space()->CommittedMemory())); | |
480 isolate_->counters()->map_space_bytes_used()->Set( | |
481 static_cast<int>(map_space()->SizeOfObjects())); | |
482 | |
483 isolate_->counters()->cell_space_bytes_available()->Set( | |
484 static_cast<int>(cell_space()->Available())); | |
485 isolate_->counters()->cell_space_bytes_committed()->Set( | |
486 static_cast<int>(cell_space()->CommittedMemory())); | |
487 isolate_->counters()->cell_space_bytes_used()->Set( | |
488 static_cast<int>(cell_space()->SizeOfObjects())); | |
489 | |
490 isolate_->counters()->lo_space_bytes_available()->Set( | |
491 static_cast<int>(lo_space()->Available())); | |
492 isolate_->counters()->lo_space_bytes_committed()->Set( | |
493 static_cast<int>(lo_space()->CommittedMemory())); | |
494 isolate_->counters()->lo_space_bytes_used()->Set( | |
495 static_cast<int>(lo_space()->SizeOfObjects())); | |
496 | 468 |
497 #if defined(DEBUG) | 469 #if defined(DEBUG) |
498 ReportStatisticsAfterGC(); | 470 ReportStatisticsAfterGC(); |
499 #endif // DEBUG | 471 #endif // DEBUG |
500 #ifdef ENABLE_DEBUGGER_SUPPORT | 472 #ifdef ENABLE_DEBUGGER_SUPPORT |
501 isolate_->debug()->AfterGarbageCollection(); | 473 isolate_->debug()->AfterGarbageCollection(); |
502 #endif // ENABLE_DEBUGGER_SUPPORT | 474 #endif // ENABLE_DEBUGGER_SUPPORT |
503 } | 475 } |
504 | 476 |
505 | 477 |
(...skipping 6713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7219 } else { | 7191 } else { |
7220 p ^= 0x1d1ed & (Page::kPageSize - 1); // I died. | 7192 p ^= 0x1d1ed & (Page::kPageSize - 1); // I died. |
7221 } | 7193 } |
7222 remembered_unmapped_pages_[remembered_unmapped_pages_index_] = | 7194 remembered_unmapped_pages_[remembered_unmapped_pages_index_] = |
7223 reinterpret_cast<Address>(p); | 7195 reinterpret_cast<Address>(p); |
7224 remembered_unmapped_pages_index_++; | 7196 remembered_unmapped_pages_index_++; |
7225 remembered_unmapped_pages_index_ %= kRememberedUnmappedPages; | 7197 remembered_unmapped_pages_index_ %= kRememberedUnmappedPages; |
7226 } | 7198 } |
7227 | 7199 |
7228 } } // namespace v8::internal | 7200 } } // namespace v8::internal |
OLD | NEW |