29 #include "utilities/align.hpp" |
29 #include "utilities/align.hpp" |
30 #include "utilities/debug.hpp" |
30 #include "utilities/debug.hpp" |
31 |
31 |
32 ZPage::ZPage(uint8_t type, ZVirtualMemory vmem, ZPhysicalMemory pmem) : |
32 ZPage::ZPage(uint8_t type, ZVirtualMemory vmem, ZPhysicalMemory pmem) : |
33 _type(type), |
33 _type(type), |
34 _pinned(0), |
34 _active(0), |
35 _numa_id((uint8_t)-1), |
35 _numa_id((uint8_t)-1), |
36 _seqnum(0), |
36 _seqnum(0), |
37 _virtual(vmem), |
37 _virtual(vmem), |
38 _top(start()), |
38 _top(start()), |
39 _livemap(object_max_count()), |
39 _livemap(object_max_count()), |
40 _refcount(0), |
|
41 _forwarding(), |
|
42 _physical(pmem) { |
40 _physical(pmem) { |
43 assert(!_physical.is_null(), "Should not be null"); |
41 assert(!_physical.is_null(), "Should not be null"); |
44 assert(!_virtual.is_null(), "Should not be null"); |
42 assert(!_virtual.is_null(), "Should not be null"); |
45 assert((type == ZPageTypeSmall && size() == ZPageSizeSmall) || |
43 assert((type == ZPageTypeSmall && size() == ZPageSizeSmall) || |
46 (type == ZPageTypeMedium && size() == ZPageSizeMedium) || |
44 (type == ZPageTypeMedium && size() == ZPageSizeMedium) || |
53 assert(is_detached(), "Should be detached"); |
51 assert(is_detached(), "Should be detached"); |
54 } |
52 } |
55 |
53 |
56 void ZPage::reset() { |
54 void ZPage::reset() { |
57 assert(!is_active(), "Should not be active"); |
55 assert(!is_active(), "Should not be active"); |
58 assert(!is_pinned(), "Should not be pinned"); |
|
59 assert(!is_detached(), "Should not be detached"); |
56 assert(!is_detached(), "Should not be detached"); |
60 |
57 |
61 _seqnum = ZGlobalSeqNum; |
58 _seqnum = ZGlobalSeqNum; |
62 _top = start(); |
59 _top = start(); |
63 _livemap.reset(); |
60 _livemap.reset(); |
64 |
61 |
65 // Make sure we don't make the page active before |
62 // Make sure we don't make the page active before |
66 // the reset of the above fields are visible. |
63 // the reset of the above fields are visible. |
67 OrderAccess::storestore(); |
64 OrderAccess::storestore(); |
68 |
65 |
69 _refcount = 1; |
66 _active = 1; |
70 } |
67 } |
71 |
68 |
72 void ZPage::print_on(outputStream* out) const { |
69 void ZPage::print_on(outputStream* out) const { |
73 out->print_cr(" %-6s " PTR_FORMAT " " PTR_FORMAT " " PTR_FORMAT " %s%s%s%s%s%s", |
70 out->print_cr(" %-6s " PTR_FORMAT " " PTR_FORMAT " " PTR_FORMAT " %s%s%s%s", |
74 type_to_string(), start(), top(), end(), |
71 type_to_string(), start(), top(), end(), |
75 is_allocating() ? " Allocating" : "", |
72 is_allocating() ? " Allocating" : "", |
76 is_relocatable() ? " Relocatable" : "", |
73 is_relocatable() ? " Relocatable" : "", |
77 is_forwarding() ? " Forwarding" : "", |
|
78 is_pinned() ? " Pinned" : "", |
|
79 is_detached() ? " Detached" : "", |
74 is_detached() ? " Detached" : "", |
80 !is_active() ? " Inactive" : ""); |
75 !is_active() ? " Inactive" : ""); |
81 } |
76 } |
82 |
77 |
83 void ZPage::print() const { |
78 void ZPage::print() const { |