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

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

Issue 1577853007: [heap] Parallel newspace evacuation, semispace copy, and compaction \o/ (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Disable concurrent sweeping for test expecting # of pages released Created 4 years, 10 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/heap.h ('k') | src/heap/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 // 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/heap/heap.h" 5 #include "src/heap/heap.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/ast/scopeinfo.h" 9 #include "src/ast/scopeinfo.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 const HashMap& local_pretenuring_feedback) { 512 const HashMap& local_pretenuring_feedback) {
513 AllocationSite* site = nullptr; 513 AllocationSite* site = nullptr;
514 for (HashMap::Entry* local_entry = local_pretenuring_feedback.Start(); 514 for (HashMap::Entry* local_entry = local_pretenuring_feedback.Start();
515 local_entry != nullptr; 515 local_entry != nullptr;
516 local_entry = local_pretenuring_feedback.Next(local_entry)) { 516 local_entry = local_pretenuring_feedback.Next(local_entry)) {
517 site = reinterpret_cast<AllocationSite*>(local_entry->key); 517 site = reinterpret_cast<AllocationSite*>(local_entry->key);
518 MapWord map_word = site->map_word(); 518 MapWord map_word = site->map_word();
519 if (map_word.IsForwardingAddress()) { 519 if (map_word.IsForwardingAddress()) {
520 site = AllocationSite::cast(map_word.ToForwardingAddress()); 520 site = AllocationSite::cast(map_word.ToForwardingAddress());
521 } 521 }
522 DCHECK(site->IsAllocationSite()); 522
523 // We have not validated the allocation site yet, since we have not
524 // dereferenced the site during collecting information.
525 // This is an inlined check of AllocationMemento::IsValid.
526 if (!site->IsAllocationSite() || site->IsZombie()) continue;
527
523 int value = 528 int value =
524 static_cast<int>(reinterpret_cast<intptr_t>(local_entry->value)); 529 static_cast<int>(reinterpret_cast<intptr_t>(local_entry->value));
525 DCHECK_GT(value, 0); 530 DCHECK_GT(value, 0);
526 531
527 { 532 if (site->IncrementMementoFoundCount(value)) {
528 // TODO(mlippautz): For parallel processing we need synchronization here. 533 global_pretenuring_feedback_->LookupOrInsert(site,
529 if (site->IncrementMementoFoundCount(value)) { 534 ObjectHash(site->address()));
530 global_pretenuring_feedback_->LookupOrInsert(
531 site, static_cast<uint32_t>(bit_cast<uintptr_t>(site)));
532 }
533 } 535 }
534 } 536 }
535 } 537 }
536 538
537 539
538 class Heap::PretenuringScope { 540 class Heap::PretenuringScope {
539 public: 541 public:
540 explicit PretenuringScope(Heap* heap) : heap_(heap) { 542 explicit PretenuringScope(Heap* heap) : heap_(heap) {
541 heap_->global_pretenuring_feedback_ = 543 heap_->global_pretenuring_feedback_ =
542 new HashMap(HashMap::PointersMatch, kInitialFeedbackCapacity); 544 new HashMap(HashMap::PointersMatch, kInitialFeedbackCapacity);
(...skipping 5701 matching lines...) Expand 10 before | Expand all | Expand 10 after
6244 } 6246 }
6245 6247
6246 6248
6247 // static 6249 // static
6248 int Heap::GetStaticVisitorIdForMap(Map* map) { 6250 int Heap::GetStaticVisitorIdForMap(Map* map) {
6249 return StaticVisitorBase::GetVisitorId(map); 6251 return StaticVisitorBase::GetVisitorId(map);
6250 } 6252 }
6251 6253
6252 } // namespace internal 6254 } // namespace internal
6253 } // namespace v8 6255 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698