src/hotspot/share/gc/z/zGlobals.hpp
changeset 59149 3b998574be4b
parent 58811 38f4701d6587
equal deleted inserted replaced
59148:877c000fd688 59149:3b998574be4b
    48 const size_t      ZHeapViews                    = ZPlatformHeapViews;
    48 const size_t      ZHeapViews                    = ZPlatformHeapViews;
    49 
    49 
    50 // Virtual memory to physical memory ratio
    50 // Virtual memory to physical memory ratio
    51 const size_t      ZVirtualToPhysicalRatio       = 16; // 16:1
    51 const size_t      ZVirtualToPhysicalRatio       = 16; // 16:1
    52 
    52 
    53 //
       
    54 // Page Tiers (assuming ZGranuleSize=2M)
       
    55 // -------------------------------------
       
    56 //
       
    57 //                 Page Size        Object Size      Object Alignment
       
    58 //                 --------------------------------------------------
       
    59 //  Small          2M               <= 265K          MinObjAlignmentInBytes
       
    60 //  Medium         32M              <= 4M            4K
       
    61 //  Large          N x 2M           > 4M             2M
       
    62 //
       
    63 
       
    64 // Page types
    53 // Page types
    65 const uint8_t     ZPageTypeSmall                = 0;
    54 const uint8_t     ZPageTypeSmall                = 0;
    66 const uint8_t     ZPageTypeMedium               = 1;
    55 const uint8_t     ZPageTypeMedium               = 1;
    67 const uint8_t     ZPageTypeLarge                = 2;
    56 const uint8_t     ZPageTypeLarge                = 2;
    68 
    57 
    69 // Page size shifts
    58 // Page size shifts
    70 const size_t      ZPageSizeSmallShift           = ZGranuleSizeShift;
    59 const size_t      ZPageSizeSmallShift           = ZGranuleSizeShift;
    71 const size_t      ZPageSizeMediumShift          = ZPageSizeSmallShift + 4;
    60 extern size_t     ZPageSizeMediumShift;
    72 
    61 
    73 // Page sizes
    62 // Page sizes
    74 const size_t      ZPageSizeSmall                = (size_t)1 << ZPageSizeSmallShift;
    63 const size_t      ZPageSizeSmall                = (size_t)1 << ZPageSizeSmallShift;
    75 const size_t      ZPageSizeMedium               = (size_t)1 << ZPageSizeMediumShift;
    64 extern size_t     ZPageSizeMedium;
    76 
    65 
    77 // Object size limits
    66 // Object size limits
    78 const size_t      ZObjectSizeLimitSmall         = (ZPageSizeSmall / 8);  // Allow 12.5% waste
    67 const size_t      ZObjectSizeLimitSmall         = ZPageSizeSmall / 8; // 12.5% max waste
    79 const size_t      ZObjectSizeLimitMedium        = (ZPageSizeMedium / 8); // Allow 12.5% waste
    68 extern size_t     ZObjectSizeLimitMedium;
    80 
    69 
    81 // Object alignment shifts
    70 // Object alignment shifts
    82 extern const int& ZObjectAlignmentSmallShift;
    71 extern const int& ZObjectAlignmentSmallShift;
    83 const int         ZObjectAlignmentMediumShift   = ZPageSizeMediumShift - 13; // 8192 objects per page
    72 extern int        ZObjectAlignmentMediumShift;
    84 const int         ZObjectAlignmentLargeShift    = ZPageSizeSmallShift;
    73 const int         ZObjectAlignmentLargeShift    = ZGranuleSizeShift;
    85 
    74 
    86 // Object alignments
    75 // Object alignments
    87 extern const int& ZObjectAlignmentSmall;
    76 extern const int& ZObjectAlignmentSmall;
    88 const int         ZObjectAlignmentMedium        = 1 << ZObjectAlignmentMediumShift;
    77 extern int        ZObjectAlignmentMedium;
    89 const int         ZObjectAlignmentLarge         = 1 << ZObjectAlignmentLargeShift;
    78 const int         ZObjectAlignmentLarge         = 1 << ZObjectAlignmentLargeShift;
    90 
    79 
    91 //
    80 //
    92 // Good/Bad mask states
    81 // Good/Bad mask states
    93 // --------------------
    82 // --------------------