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

Side by Side Diff: src/heap.cc

Issue 25655004: Print out how many AllocationMementos were found during mark-sweep. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 months 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/heap.h ('k') | src/heap-inl.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 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
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 allocation_mementos_found_(0),
90 scan_on_scavenge_pages_(0), 90 scan_on_scavenge_pages_(0),
91 new_space_(this), 91 new_space_(this),
92 old_pointer_space_(NULL), 92 old_pointer_space_(NULL),
93 old_data_space_(NULL), 93 old_data_space_(NULL),
94 code_space_(NULL), 94 code_space_(NULL),
95 map_space_(NULL), 95 map_space_(NULL),
96 cell_space_(NULL), 96 cell_space_(NULL),
97 property_cell_space_(NULL), 97 property_cell_space_(NULL),
98 lo_space_(NULL), 98 lo_space_(NULL),
99 gc_state_(NOT_IN_GC), 99 gc_state_(NOT_IN_GC),
(...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 } 1322 }
1323 1323
1324 private: 1324 private:
1325 Heap* heap_; 1325 Heap* heap_;
1326 }; 1326 };
1327 1327
1328 1328
1329 void Heap::Scavenge() { 1329 void Heap::Scavenge() {
1330 RelocationLock relocation_lock(this); 1330 RelocationLock relocation_lock(this);
1331 1331
1332 allocation_mementos_found_on_scavenge_ = 0; 1332 allocation_mementos_found_ = 0;
1333 1333
1334 #ifdef VERIFY_HEAP 1334 #ifdef VERIFY_HEAP
1335 if (FLAG_verify_heap) VerifyNonPointerSpacePointers(this); 1335 if (FLAG_verify_heap) VerifyNonPointerSpacePointers(this);
1336 #endif 1336 #endif
1337 1337
1338 gc_state_ = SCAVENGE; 1338 gc_state_ = SCAVENGE;
1339 1339
1340 // Implements Cheney's copying algorithm 1340 // Implements Cheney's copying algorithm
1341 LOG(isolate_, ResourceEvent("scavenge", "begin")); 1341 LOG(isolate_, ResourceEvent("scavenge", "begin"));
1342 1342
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1472 // Update how much has survived scavenge. 1472 // Update how much has survived scavenge.
1473 IncrementYoungSurvivorsCounter(static_cast<int>( 1473 IncrementYoungSurvivorsCounter(static_cast<int>(
1474 (PromotedSpaceSizeOfObjects() - survived_watermark) + new_space_.Size())); 1474 (PromotedSpaceSizeOfObjects() - survived_watermark) + new_space_.Size()));
1475 1475
1476 LOG(isolate_, ResourceEvent("scavenge", "end")); 1476 LOG(isolate_, ResourceEvent("scavenge", "end"));
1477 1477
1478 gc_state_ = NOT_IN_GC; 1478 gc_state_ = NOT_IN_GC;
1479 1479
1480 scavenges_since_last_idle_round_++; 1480 scavenges_since_last_idle_round_++;
1481 1481
1482 if (FLAG_trace_track_allocation_sites && 1482 if (FLAG_trace_track_allocation_sites && allocation_mementos_found_ > 0) {
1483 allocation_mementos_found_on_scavenge_ > 0) {
1484 PrintF("AllocationMementos found during scavenge = %d\n", 1483 PrintF("AllocationMementos found during scavenge = %d\n",
1485 allocation_mementos_found_on_scavenge_); 1484 allocation_mementos_found_);
1486 } 1485 }
1487 } 1486 }
1488 1487
1489 1488
1490 String* Heap::UpdateNewSpaceReferenceInExternalStringTableEntry(Heap* heap, 1489 String* Heap::UpdateNewSpaceReferenceInExternalStringTableEntry(Heap* heap,
1491 Object** p) { 1490 Object** p) {
1492 MapWord first_word = HeapObject::cast(*p)->map_word(); 1491 MapWord first_word = HeapObject::cast(*p)->map_word();
1493 1492
1494 if (!first_word.IsForwardingAddress()) { 1493 if (!first_word.IsForwardingAddress()) {
1495 // Unreachable external string can be finalized. 1494 // Unreachable external string can be finalized.
(...skipping 6375 matching lines...) Expand 10 before | Expand all | Expand 10 after
7871 if (FLAG_concurrent_recompilation) { 7870 if (FLAG_concurrent_recompilation) {
7872 heap_->relocation_mutex_->Lock(); 7871 heap_->relocation_mutex_->Lock();
7873 #ifdef DEBUG 7872 #ifdef DEBUG
7874 heap_->relocation_mutex_locked_by_optimizer_thread_ = 7873 heap_->relocation_mutex_locked_by_optimizer_thread_ =
7875 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); 7874 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread();
7876 #endif // DEBUG 7875 #endif // DEBUG
7877 } 7876 }
7878 } 7877 }
7879 7878
7880 } } // namespace v8::internal 7879 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698