hotspot/src/share/vm/memory/cardTableModRefBS.cpp
changeset 28830 a252e278c3d9
parent 28029 3feb13c88e48
child 29081 c61eb4914428
equal deleted inserted replaced
28718:6bb984acf342 28830:a252e278c3d9
     1 /*
     1 /*
     2  * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    51   assert(_page_size != 0, "uninitialized, check declaration order");
    51   assert(_page_size != 0, "uninitialized, check declaration order");
    52   const size_t granularity = os::vm_allocation_granularity();
    52   const size_t granularity = os::vm_allocation_granularity();
    53   return align_size_up(_guard_index + 1, MAX2(_page_size, granularity));
    53   return align_size_up(_guard_index + 1, MAX2(_page_size, granularity));
    54 }
    54 }
    55 
    55 
    56 CardTableModRefBS::CardTableModRefBS(MemRegion whole_heap) :
    56 CardTableModRefBS::CardTableModRefBS(MemRegion whole_heap, BarrierSet::Name kind) :
    57   ModRefBarrierSet(),
    57   ModRefBarrierSet(kind),
    58   _whole_heap(whole_heap),
    58   _whole_heap(whole_heap),
    59   _guard_index(0),
    59   _guard_index(0),
    60   _guard_region(),
    60   _guard_region(),
    61   _last_valid_index(0),
    61   _last_valid_index(0),
    62   _page_size(os::vm_page_size()),
    62   _page_size(os::vm_page_size()),
    70   _lowest_non_clean(NULL),
    70   _lowest_non_clean(NULL),
    71   _lowest_non_clean_chunk_size(NULL),
    71   _lowest_non_clean_chunk_size(NULL),
    72   _lowest_non_clean_base_chunk_index(NULL),
    72   _lowest_non_clean_base_chunk_index(NULL),
    73   _last_LNC_resizing_collection(NULL)
    73   _last_LNC_resizing_collection(NULL)
    74 {
    74 {
    75   _kind = BarrierSet::CardTableModRef;
       
    76 
       
    77   assert((uintptr_t(_whole_heap.start())  & (card_size - 1))  == 0, "heap must start at card boundary");
    75   assert((uintptr_t(_whole_heap.start())  & (card_size - 1))  == 0, "heap must start at card boundary");
    78   assert((uintptr_t(_whole_heap.end()) & (card_size - 1))  == 0, "heap must end at card boundary");
    76   assert((uintptr_t(_whole_heap.end()) & (card_size - 1))  == 0, "heap must end at card boundary");
    79 
    77 
    80   assert(card_size <= 512, "card_size must be less than 512"); // why?
    78   assert(card_size <= 512, "card_size must be less than 512"); // why?
    81 
    79