src/share/vm/opto/indexSet.hpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/opto/indexSet.hpp Mon May 5 12:29:34 2014
--- new/src/share/vm/opto/indexSet.hpp Mon May 5 12:29:34 2014
*** 104,153 ****
--- 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 *words() { return _data._words; }
! 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 ****
--- 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];
! static const uint8_t _first_bit[table_size];
// For an integer of length window_size, what is the second set bit?
! static const byte _second_bit[table_size];
! static const uint8_t _second_bit[table_size];
private:
// The current word we are inspecting
! uint32 _current;
! 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 *_words;
! 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