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

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

Issue 1010803012: Merge cellspace into old pointer space (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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/objects-visiting-inl.h ('k') | src/heap/spaces.cc » ('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_H_ 5 #ifndef V8_HEAP_SPACES_H_
6 #define V8_HEAP_SPACES_H_ 6 #define V8_HEAP_SPACES_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/base/atomicops.h" 9 #include "src/base/atomicops.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 2639 matching lines...) Expand 10 before | Expand all | Expand 10 after
2650 } 2650 }
2651 2651
2652 const int max_map_space_pages_; 2652 const int max_map_space_pages_;
2653 2653
2654 public: 2654 public:
2655 TRACK_MEMORY("MapSpace") 2655 TRACK_MEMORY("MapSpace")
2656 }; 2656 };
2657 2657
2658 2658
2659 // ----------------------------------------------------------------------------- 2659 // -----------------------------------------------------------------------------
2660 // Old space for simple property cell objects
2661
2662 class CellSpace : public PagedSpace {
2663 public:
2664 // Creates a property cell space object with a maximum capacity.
2665 CellSpace(Heap* heap, intptr_t max_capacity, AllocationSpace id)
2666 : PagedSpace(heap, max_capacity, id, NOT_EXECUTABLE) {}
2667
2668 virtual int RoundSizeDownToObjectAlignment(int size) {
2669 if (base::bits::IsPowerOfTwo32(Cell::kSize)) {
2670 return RoundDown(size, Cell::kSize);
2671 } else {
2672 return (size / Cell::kSize) * Cell::kSize;
2673 }
2674 }
2675
2676 protected:
2677 virtual void VerifyObject(HeapObject* obj);
2678
2679 public:
2680 TRACK_MEMORY("CellSpace")
2681 };
2682
2683
2684 // -----------------------------------------------------------------------------
2685 // Large objects ( > Page::kMaxHeapObjectSize ) are allocated and managed by 2660 // Large objects ( > Page::kMaxHeapObjectSize ) are allocated and managed by
2686 // the large object space. A large object is allocated from OS heap with 2661 // the large object space. A large object is allocated from OS heap with
2687 // extra padding bytes (Page::kPageSize + Page::kObjectStartOffset). 2662 // extra padding bytes (Page::kPageSize + Page::kObjectStartOffset).
2688 // A large object always starts at Page::kObjectStartOffset to a page. 2663 // A large object always starts at Page::kObjectStartOffset to a page.
2689 // Large objects do not move during garbage collections. 2664 // Large objects do not move during garbage collections.
2690 2665
2691 class LargeObjectSpace : public Space { 2666 class LargeObjectSpace : public Space {
2692 public: 2667 public:
2693 LargeObjectSpace(Heap* heap, intptr_t max_capacity, AllocationSpace id); 2668 LargeObjectSpace(Heap* heap, intptr_t max_capacity, AllocationSpace id);
2694 virtual ~LargeObjectSpace() {} 2669 virtual ~LargeObjectSpace() {}
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
2860 count = 0; 2835 count = 0;
2861 } 2836 }
2862 // Must be small, since an iteration is used for lookup. 2837 // Must be small, since an iteration is used for lookup.
2863 static const int kMaxComments = 64; 2838 static const int kMaxComments = 64;
2864 }; 2839 };
2865 #endif 2840 #endif
2866 } 2841 }
2867 } // namespace v8::internal 2842 } // namespace v8::internal
2868 2843
2869 #endif // V8_HEAP_SPACES_H_ 2844 #endif // V8_HEAP_SPACES_H_
OLDNEW
« no previous file with comments | « src/heap/objects-visiting-inl.h ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698