hotspot/src/share/vm/utilities/bitMap.cpp
changeset 29580 a67a581cfe11
parent 27880 afb974a04396
child 37057 03b3e1870228
equal deleted inserted replaced
29477:82f545c6572b 29580:a67a581cfe11
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 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.
    31 
    31 
    32 BitMap::BitMap(bm_word_t* map, idx_t size_in_bits) :
    32 BitMap::BitMap(bm_word_t* map, idx_t size_in_bits) :
    33   _map(map), _size(size_in_bits), _map_allocator(false)
    33   _map(map), _size(size_in_bits), _map_allocator(false)
    34 {
    34 {
    35   assert(sizeof(bm_word_t) == BytesPerWord, "Implementation assumption.");
    35   assert(sizeof(bm_word_t) == BytesPerWord, "Implementation assumption.");
    36   assert(size_in_bits >= 0, "just checking");
       
    37 }
    36 }
    38 
    37 
    39 
    38 
    40 BitMap::BitMap(idx_t size_in_bits, bool in_resource_area) :
    39 BitMap::BitMap(idx_t size_in_bits, bool in_resource_area) :
    41   _map(NULL), _size(0), _map_allocator(false)
    40   _map(NULL), _size(0), _map_allocator(false)
    43   assert(sizeof(bm_word_t) == BytesPerWord, "Implementation assumption.");
    42   assert(sizeof(bm_word_t) == BytesPerWord, "Implementation assumption.");
    44   resize(size_in_bits, in_resource_area);
    43   resize(size_in_bits, in_resource_area);
    45 }
    44 }
    46 
    45 
    47 void BitMap::resize(idx_t size_in_bits, bool in_resource_area) {
    46 void BitMap::resize(idx_t size_in_bits, bool in_resource_area) {
    48   assert(size_in_bits >= 0, "just checking");
       
    49   idx_t old_size_in_words = size_in_words();
    47   idx_t old_size_in_words = size_in_words();
    50   bm_word_t* old_map = map();
    48   bm_word_t* old_map = map();
    51 
    49 
    52   _size = size_in_bits;
    50   _size = size_in_bits;
    53   idx_t new_size_in_words = size_in_words();
    51   idx_t new_size_in_words = size_in_words();