src/share/vm/libadt/vectset.hpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/libadt/vectset.hpp Mon May 5 12:29:05 2014
--- new/src/share/vm/libadt/vectset.hpp Mon May 5 12:29:04 2014
*** 45,55 ****
--- 45,55 ----
//------------------------------VectorSet--------------------------------------
class VectorSet : public Set {
friend class VectorSetI; // Friendly iterator class
protected:
uint size; // Size of data IN LONGWORDS (32bits)
! uint32 *data; // The data, bit packed
! uint32_t* data; // The data, bit packed
void slamin( const VectorSet& s ); // Initialize one set with another
int compare(const VectorSet &s) const; // Compare set contents
void grow(uint newsize); // Grow vector to required bitsize
*** 97,116 ****
--- 97,116 ----
void Clear(void); // Clear a set
uint Size(void) const; // Number of elements in the Set.
void Sort(void); // Sort before iterating
int hash() const; // Hash function
void Reset(void) { // Reset a set
! memset( data, 0, size*sizeof(uint32_t) );
}
/* Removed for MCC BUG
operator const VectorSet* (void) const { return this; } */
const VectorSet *asVectorSet() const { return this; }
// Expose internals for speed-critical fast iterators
uint word_size() const { return size; }
! uint32 *EXPOSE() const { return data; }
! uint32_t* EXPOSE() const { return data; }
// Fast inlined "test and set". Replaces the idiom:
// if( visited[idx] ) return;
// visited <<= idx;
// With:
*** 118,129 ****
--- 118,129 ----
//
int test_set( uint elem ) {
uint word = elem >> 5; // Get the longword offset
if( word >= size ) // Beyond the last?
return test_set_grow(elem); // Then grow; set; return 0;
! uint32_t mask = 1L << (elem & 31); // Get bit mask
! uint32_t datum = data[word] & mask;// Get bit
data[word] |= mask; // Set bit
return datum; // Return bit
}
int test_set_grow( uint elem ) { // Insert & return 0;
(*this) <<= elem; // Insert into set
*** 132,152 ****
--- 132,152 ----
// Fast inlined test
int test( uint elem ) const {
uint word = elem >> 5; // Get the longword offset
if( word >= size ) return 0; // Beyond the last?
! uint32_t mask = 1L << (elem & 31); // Get bit mask
return data[word] & mask; // Get bit
}
// Fast inlined set
void set( uint elem ) {
uint word = elem >> 5; // Get the longword offset
if( word >= size ) { // Beyond the last?
test_set_grow(elem); // Then grow and set
} else {
! uint32_t mask = 1L << (elem & 31); // Get bit mask
data[word] |= mask; // Set bit
}
}
*** 162,172 ****
--- 162,172 ----
class VectorSetI : public StackObj {
friend class VectorSet;
const VectorSet *s;
uint i, j;
! uint32_t mask;
uint next(void);
public:
uint elem; // The publically accessible element
src/share/vm/libadt/vectset.hpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File