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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // ConfigureHeap (survived_since_last_expansion_, external_allocation_limit_) | 79 // ConfigureHeap (survived_since_last_expansion_, external_allocation_limit_) |
80 // Will be 4 * reserved_semispace_size_ to ensure that young | 80 // Will be 4 * reserved_semispace_size_ to ensure that young |
81 // generation can be aligned to its size. | 81 // generation can be aligned to its size. |
82 survived_since_last_expansion_(0), | 82 survived_since_last_expansion_(0), |
83 sweep_generation_(0), | 83 sweep_generation_(0), |
84 always_allocate_scope_depth_(0), | 84 always_allocate_scope_depth_(0), |
85 linear_allocation_scope_depth_(0), | 85 linear_allocation_scope_depth_(0), |
86 contexts_disposed_(0), | 86 contexts_disposed_(0), |
87 global_ic_age_(0), | 87 global_ic_age_(0), |
88 flush_monomorphic_ics_(false), | 88 flush_monomorphic_ics_(false), |
| 89 allocation_mementos_found_on_scavenge_(0), |
89 scan_on_scavenge_pages_(0), | 90 scan_on_scavenge_pages_(0), |
90 new_space_(this), | 91 new_space_(this), |
91 old_pointer_space_(NULL), | 92 old_pointer_space_(NULL), |
92 old_data_space_(NULL), | 93 old_data_space_(NULL), |
93 code_space_(NULL), | 94 code_space_(NULL), |
94 map_space_(NULL), | 95 map_space_(NULL), |
95 cell_space_(NULL), | 96 cell_space_(NULL), |
96 property_cell_space_(NULL), | 97 property_cell_space_(NULL), |
97 lo_space_(NULL), | 98 lo_space_(NULL), |
98 gc_state_(NOT_IN_GC), | 99 gc_state_(NOT_IN_GC), |
(...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1321 } | 1322 } |
1322 | 1323 |
1323 private: | 1324 private: |
1324 Heap* heap_; | 1325 Heap* heap_; |
1325 }; | 1326 }; |
1326 | 1327 |
1327 | 1328 |
1328 void Heap::Scavenge() { | 1329 void Heap::Scavenge() { |
1329 RelocationLock relocation_lock(this); | 1330 RelocationLock relocation_lock(this); |
1330 | 1331 |
| 1332 allocation_mementos_found_on_scavenge_ = 0; |
| 1333 |
1331 #ifdef VERIFY_HEAP | 1334 #ifdef VERIFY_HEAP |
1332 if (FLAG_verify_heap) VerifyNonPointerSpacePointers(this); | 1335 if (FLAG_verify_heap) VerifyNonPointerSpacePointers(this); |
1333 #endif | 1336 #endif |
1334 | 1337 |
1335 gc_state_ = SCAVENGE; | 1338 gc_state_ = SCAVENGE; |
1336 | 1339 |
1337 // Implements Cheney's copying algorithm | 1340 // Implements Cheney's copying algorithm |
1338 LOG(isolate_, ResourceEvent("scavenge", "begin")); | 1341 LOG(isolate_, ResourceEvent("scavenge", "begin")); |
1339 | 1342 |
1340 // Clear descriptor cache. | 1343 // Clear descriptor cache. |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1468 | 1471 |
1469 // Update how much has survived scavenge. | 1472 // Update how much has survived scavenge. |
1470 IncrementYoungSurvivorsCounter(static_cast<int>( | 1473 IncrementYoungSurvivorsCounter(static_cast<int>( |
1471 (PromotedSpaceSizeOfObjects() - survived_watermark) + new_space_.Size())); | 1474 (PromotedSpaceSizeOfObjects() - survived_watermark) + new_space_.Size())); |
1472 | 1475 |
1473 LOG(isolate_, ResourceEvent("scavenge", "end")); | 1476 LOG(isolate_, ResourceEvent("scavenge", "end")); |
1474 | 1477 |
1475 gc_state_ = NOT_IN_GC; | 1478 gc_state_ = NOT_IN_GC; |
1476 | 1479 |
1477 scavenges_since_last_idle_round_++; | 1480 scavenges_since_last_idle_round_++; |
| 1481 |
| 1482 if (FLAG_trace_track_allocation_sites && |
| 1483 allocation_mementos_found_on_scavenge_ > 0) { |
| 1484 PrintF("AllocationMementos found during scavenge = %d\n", |
| 1485 allocation_mementos_found_on_scavenge_); |
| 1486 } |
1478 } | 1487 } |
1479 | 1488 |
1480 | 1489 |
1481 String* Heap::UpdateNewSpaceReferenceInExternalStringTableEntry(Heap* heap, | 1490 String* Heap::UpdateNewSpaceReferenceInExternalStringTableEntry(Heap* heap, |
1482 Object** p) { | 1491 Object** p) { |
1483 MapWord first_word = HeapObject::cast(*p)->map_word(); | 1492 MapWord first_word = HeapObject::cast(*p)->map_word(); |
1484 | 1493 |
1485 if (!first_word.IsForwardingAddress()) { | 1494 if (!first_word.IsForwardingAddress()) { |
1486 // Unreachable external string can be finalized. | 1495 // Unreachable external string can be finalized. |
1487 heap->FinalizeExternalString(String::cast(*p)); | 1496 heap->FinalizeExternalString(String::cast(*p)); |
(...skipping 6377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7865 if (FLAG_concurrent_recompilation) { | 7874 if (FLAG_concurrent_recompilation) { |
7866 heap_->relocation_mutex_->Lock(); | 7875 heap_->relocation_mutex_->Lock(); |
7867 #ifdef DEBUG | 7876 #ifdef DEBUG |
7868 heap_->relocation_mutex_locked_by_optimizer_thread_ = | 7877 heap_->relocation_mutex_locked_by_optimizer_thread_ = |
7869 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); | 7878 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); |
7870 #endif // DEBUG | 7879 #endif // DEBUG |
7871 } | 7880 } |
7872 } | 7881 } |
7873 | 7882 |
7874 } } // namespace v8::internal | 7883 } } // namespace v8::internal |
OLD | NEW |