src/share/vm/opto/indexSet.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Cdiff src/share/vm/opto/indexSet.hpp

src/share/vm/opto/indexSet.hpp

Print this page

        

*** 104,153 **** // A BitBlock is composed of some number of 32 bit words. When a BitBlock // is not in use by any IndexSet, it is stored on a free list. The next field // is used by IndexSet to mainting this free list. union { ! uint32 _words[words_per_block]; BitBlock *_next; } _data; // accessors ! uint32 *words() { return _data._words; } void set_next(BitBlock *next) { _data._next = next; } BitBlock *next() { return _data._next; } // Operations. A BitBlock supports four simple operations, // clear(), member(), insert(), and remove(). These methods do // not assume that the block index has been masked out. void clear() { ! memset(words(), 0, sizeof(uint32) * words_per_block); } bool member(uint element) { uint word_index = IndexSet::get_word_index(element); uint bit_index = IndexSet::get_bit_index(element); ! return ((words()[word_index] & (uint32)(0x1 << bit_index)) != 0); } bool insert(uint element) { uint word_index = IndexSet::get_word_index(element); uint bit_index = IndexSet::get_bit_index(element); ! uint32 bit = (0x1 << bit_index); ! uint32 before = words()[word_index]; words()[word_index] = before | bit; return ((before & bit) != 0); } bool remove(uint element) { uint word_index = IndexSet::get_word_index(element); uint bit_index = IndexSet::get_bit_index(element); ! uint32 bit = (0x1 << bit_index); ! uint32 before = words()[word_index]; words()[word_index] = before & ~bit; return ((before & bit) != 0); } }; --- 104,153 ---- // A BitBlock is composed of some number of 32 bit words. When a BitBlock // is not in use by any IndexSet, it is stored on a free list. The next field // is used by IndexSet to mainting this free list. union { ! uint32_t _words[words_per_block]; BitBlock *_next; } _data; // accessors ! uint32_t* words() { return _data._words; } void set_next(BitBlock *next) { _data._next = next; } BitBlock *next() { return _data._next; } // Operations. A BitBlock supports four simple operations, // clear(), member(), insert(), and remove(). These methods do // not assume that the block index has been masked out. void clear() { ! memset(words(), 0, sizeof(uint32_t) * words_per_block); } bool member(uint element) { uint word_index = IndexSet::get_word_index(element); uint bit_index = IndexSet::get_bit_index(element); ! return ((words()[word_index] & (uint32_t)(0x1 << bit_index)) != 0); } bool insert(uint element) { uint word_index = IndexSet::get_word_index(element); uint bit_index = IndexSet::get_bit_index(element); ! uint32_t bit = (0x1 << bit_index); ! uint32_t before = words()[word_index]; words()[word_index] = before | bit; return ((before & bit) != 0); } bool remove(uint element) { uint word_index = IndexSet::get_word_index(element); uint bit_index = IndexSet::get_bit_index(element); ! uint32_t bit = (0x1 << bit_index); ! uint32_t before = words()[word_index]; words()[word_index] = before & ~bit; return ((before & bit) != 0); } };
*** 402,428 **** enum { window_size = 5, window_mask = right_n_bits(window_size), table_size = (1 << window_size) }; // For an integer of length window_size, what is the first set bit? ! static const byte _first_bit[table_size]; // For an integer of length window_size, what is the second set bit? ! static const byte _second_bit[table_size]; private: // The current word we are inspecting ! uint32 _current; // What element number are we currently on? uint _value; // The index of the next word we will inspect uint _next_word; // A pointer to the contents of the current block ! uint32 *_words; // The index of the next block we will inspect uint _next_block; // A pointer to the blocks in our set --- 402,428 ---- enum { window_size = 5, window_mask = right_n_bits(window_size), table_size = (1 << window_size) }; // For an integer of length window_size, what is the first set bit? ! static const uint8_t _first_bit[table_size]; // For an integer of length window_size, what is the second set bit? ! static const uint8_t _second_bit[table_size]; private: // The current word we are inspecting ! uint32_t _current; // What element number are we currently on? uint _value; // The index of the next word we will inspect uint _next_word; // A pointer to the contents of the current block ! uint32_t *_words; // The index of the next block we will inspect uint _next_block; // A pointer to the blocks in our set
src/share/vm/opto/indexSet.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File