src/share/vm/opto/indexSet.cpp

Print this page


   1 /*
   2  * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 







  25 // This file defines the IndexSet class, a set of sparse integer indices.
  26 // This data structure is used by the compiler in its liveness analysis and
  27 // during register allocation.  It also defines an iterator for this class.
  28 
  29 #include "incls/_precompiled.incl"
  30 #include "incls/_indexSet.cpp.incl"
  31 
  32 //-------------------------------- Initializations ------------------------------
  33 
  34 IndexSet::BitBlock  IndexSet::_empty_block     = IndexSet::BitBlock();
  35 
  36 #ifdef ASSERT
  37 // Initialize statistics counters
  38 uint IndexSet::_alloc_new = 0;
  39 uint IndexSet::_alloc_total = 0;
  40 
  41 long IndexSet::_total_bits = 0;
  42 long IndexSet::_total_used_blocks = 0;
  43 long IndexSet::_total_unused_blocks = 0;
  44 
  45 // Per set, or all sets operation tracing
  46 int IndexSet::_serial_count = 1;
  47 #endif
  48 
  49 // What is the first set bit in a 5 bit integer?
  50 const byte IndexSetIterator::_first_bit[32] = {
  51   0, 0, 1, 0,


   1 /*
   2  * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "memory/allocation.inline.hpp"
  27 #include "opto/chaitin.hpp"
  28 #include "opto/compile.hpp"
  29 #include "opto/indexSet.hpp"
  30 #include "opto/regmask.hpp"
  31 
  32 // This file defines the IndexSet class, a set of sparse integer indices.
  33 // This data structure is used by the compiler in its liveness analysis and
  34 // during register allocation.  It also defines an iterator for this class.
  35 



  36 //-------------------------------- Initializations ------------------------------
  37 
  38 IndexSet::BitBlock  IndexSet::_empty_block     = IndexSet::BitBlock();
  39 
  40 #ifdef ASSERT
  41 // Initialize statistics counters
  42 uint IndexSet::_alloc_new = 0;
  43 uint IndexSet::_alloc_total = 0;
  44 
  45 long IndexSet::_total_bits = 0;
  46 long IndexSet::_total_used_blocks = 0;
  47 long IndexSet::_total_unused_blocks = 0;
  48 
  49 // Per set, or all sets operation tracing
  50 int IndexSet::_serial_count = 1;
  51 #endif
  52 
  53 // What is the first set bit in a 5 bit integer?
  54 const byte IndexSetIterator::_first_bit[32] = {
  55   0, 0, 1, 0,