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

Side by Side Diff: src/heap/spaces-inl.h

Issue 2565713002: [heap] Initialize the owner on each page after lospace allocation (Closed)
Patch Set: Simplify msan marking Created 4 years 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.cc ('k') | test/mjsunit/regress/regress-672041.js » ('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 #ifndef V8_HEAP_SPACES_INL_H_ 5 #ifndef V8_HEAP_SPACES_INL_H_
6 #define V8_HEAP_SPACES_INL_H_ 6 #define V8_HEAP_SPACES_INL_H_
7 7
8 #include "src/heap/incremental-marking.h" 8 #include "src/heap/incremental-marking.h"
9 #include "src/heap/spaces.h" 9 #include "src/heap/spaces.h"
10 #include "src/isolate.h" 10 #include "src/isolate.h"
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 return AllocateRaw(size_in_bytes, alignment); 587 return AllocateRaw(size_in_bytes, alignment);
588 } 588 }
589 589
590 LargePage* LargePage::Initialize(Heap* heap, MemoryChunk* chunk, 590 LargePage* LargePage::Initialize(Heap* heap, MemoryChunk* chunk,
591 Executability executable, Space* owner) { 591 Executability executable, Space* owner) {
592 if (executable && chunk->size() > LargePage::kMaxCodePageSize) { 592 if (executable && chunk->size() > LargePage::kMaxCodePageSize) {
593 STATIC_ASSERT(LargePage::kMaxCodePageSize <= TypedSlotSet::kMaxOffset); 593 STATIC_ASSERT(LargePage::kMaxCodePageSize <= TypedSlotSet::kMaxOffset);
594 FATAL("Code page is too large."); 594 FATAL("Code page is too large.");
595 } 595 }
596 heap->incremental_marking()->SetOldSpacePageFlags(chunk); 596 heap->incremental_marking()->SetOldSpacePageFlags(chunk);
597
598 MSAN_ALLOCATED_UNINITIALIZED_MEMORY(chunk->area_start(), chunk->area_size());
599
600 // Initialize the owner field for each contained page (except the first, which
601 // is initialized by MemoryChunk::Initialize).
602 for (Address addr = chunk->address() + Page::kPageSize + Page::kOwnerOffset;
603 addr < chunk->area_end(); addr += Page::kPageSize) {
604 // Clear out kPageHeaderTag.
605 Memory::Address_at(addr) = 0;
606 }
607
597 return static_cast<LargePage*>(chunk); 608 return static_cast<LargePage*>(chunk);
598 } 609 }
599 610
600 size_t LargeObjectSpace::Available() { 611 size_t LargeObjectSpace::Available() {
601 return ObjectSizeFor(heap()->memory_allocator()->Available()); 612 return ObjectSizeFor(heap()->memory_allocator()->Available());
602 } 613 }
603 614
604 615
605 LocalAllocationBuffer LocalAllocationBuffer::InvalidBuffer() { 616 LocalAllocationBuffer LocalAllocationBuffer::InvalidBuffer() {
606 return LocalAllocationBuffer(nullptr, AllocationInfo(nullptr, nullptr)); 617 return LocalAllocationBuffer(nullptr, AllocationInfo(nullptr, nullptr));
(...skipping 19 matching lines...) Expand all
626 other->allocation_info_.Reset(nullptr, nullptr); 637 other->allocation_info_.Reset(nullptr, nullptr);
627 return true; 638 return true;
628 } 639 }
629 return false; 640 return false;
630 } 641 }
631 642
632 } // namespace internal 643 } // namespace internal
633 } // namespace v8 644 } // namespace v8
634 645
635 #endif // V8_HEAP_SPACES_INL_H_ 646 #endif // V8_HEAP_SPACES_INL_H_
OLDNEW
« no previous file with comments | « src/heap/spaces.cc ('k') | test/mjsunit/regress/regress-672041.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698