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

Side by Side Diff: src/heap/spaces.cc

Issue 1244353002: Use a lock in pages to synchronize sweeper threads to allow others to wait on concurrently swept pa… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « src/heap/spaces.h ('k') | src/heap/spaces-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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/base/platform/platform.h" 8 #include "src/base/platform/platform.h"
9 #include "src/full-codegen.h" 9 #include "src/full-codegen.h"
10 #include "src/heap/mark-compact.h" 10 #include "src/heap/mark-compact.h"
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 chunk->area_end_ = area_end; 492 chunk->area_end_ = area_end;
493 chunk->flags_ = 0; 493 chunk->flags_ = 0;
494 chunk->set_owner(owner); 494 chunk->set_owner(owner);
495 chunk->InitializeReservedMemory(); 495 chunk->InitializeReservedMemory();
496 chunk->slots_buffer_ = NULL; 496 chunk->slots_buffer_ = NULL;
497 chunk->skip_list_ = NULL; 497 chunk->skip_list_ = NULL;
498 chunk->write_barrier_counter_ = kWriteBarrierCounterGranularity; 498 chunk->write_barrier_counter_ = kWriteBarrierCounterGranularity;
499 chunk->progress_bar_ = 0; 499 chunk->progress_bar_ = 0;
500 chunk->high_water_mark_ = static_cast<int>(area_start - base); 500 chunk->high_water_mark_ = static_cast<int>(area_start - base);
501 chunk->set_parallel_sweeping(SWEEPING_DONE); 501 chunk->set_parallel_sweeping(SWEEPING_DONE);
502 chunk->mutex_ = NULL;
502 chunk->available_in_small_free_list_ = 0; 503 chunk->available_in_small_free_list_ = 0;
503 chunk->available_in_medium_free_list_ = 0; 504 chunk->available_in_medium_free_list_ = 0;
504 chunk->available_in_large_free_list_ = 0; 505 chunk->available_in_large_free_list_ = 0;
505 chunk->available_in_huge_free_list_ = 0; 506 chunk->available_in_huge_free_list_ = 0;
506 chunk->non_available_small_blocks_ = 0; 507 chunk->non_available_small_blocks_ = 0;
507 chunk->ResetLiveBytes(); 508 chunk->ResetLiveBytes();
508 Bitmap::Clear(chunk); 509 Bitmap::Clear(chunk);
509 chunk->initialize_scan_on_scavenge(false); 510 chunk->initialize_scan_on_scavenge(false);
510 chunk->SetFlag(WAS_SWEPT); 511 chunk->SetFlag(WAS_SWEPT);
511 512
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 ObjectSpace space = 759 ObjectSpace space =
759 static_cast<ObjectSpace>(1 << chunk->owner()->identity()); 760 static_cast<ObjectSpace>(1 << chunk->owner()->identity());
760 PerformAllocationCallback(space, kAllocationActionFree, chunk->size()); 761 PerformAllocationCallback(space, kAllocationActionFree, chunk->size());
761 } 762 }
762 763
763 isolate_->heap()->RememberUnmappedPage(reinterpret_cast<Address>(chunk), 764 isolate_->heap()->RememberUnmappedPage(reinterpret_cast<Address>(chunk),
764 chunk->IsEvacuationCandidate()); 765 chunk->IsEvacuationCandidate());
765 766
766 delete chunk->slots_buffer(); 767 delete chunk->slots_buffer();
767 delete chunk->skip_list(); 768 delete chunk->skip_list();
769 delete chunk->mutex();
768 770
769 base::VirtualMemory* reservation = chunk->reserved_memory(); 771 base::VirtualMemory* reservation = chunk->reserved_memory();
770 if (reservation->IsReserved()) { 772 if (reservation->IsReserved()) {
771 FreeMemory(reservation, chunk->executable()); 773 FreeMemory(reservation, chunk->executable());
772 } else { 774 } else {
773 FreeMemory(chunk->address(), chunk->size(), chunk->executable()); 775 FreeMemory(chunk->address(), chunk->size(), chunk->executable());
774 } 776 }
775 } 777 }
776 778
777 779
(...skipping 2361 matching lines...) Expand 10 before | Expand all | Expand 10 after
3139 object->ShortPrint(); 3141 object->ShortPrint();
3140 PrintF("\n"); 3142 PrintF("\n");
3141 } 3143 }
3142 printf(" --------------------------------------\n"); 3144 printf(" --------------------------------------\n");
3143 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); 3145 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes());
3144 } 3146 }
3145 3147
3146 #endif // DEBUG 3148 #endif // DEBUG
3147 } // namespace internal 3149 } // namespace internal
3148 } // namespace v8 3150 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/spaces.h ('k') | src/heap/spaces-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698