376 }
377 }
378 void check_watch(const char *operation) const {
379 if (IndexSetWatch != 0) {
380 if (IndexSetWatch == -1 || _serial_number == IndexSetWatch) {
381 tty->print_cr("IndexSet %d : %s", _serial_number, operation);
382 }
383 }
384 }
385
386 public:
387 static void print_statistics();
388
389 #endif
390 };
391
392
393 //-------------------------------- class IndexSetIterator --------------------
394 // An iterator for IndexSets.
395
396 class IndexSetIterator VALUE_OBJ_CLASS_SPEC {
397 friend class IndexSet;
398
399 public:
400
401 // We walk over the bits in a word in chunks of size window_size.
402 enum { window_size = 5,
403 window_mask = right_n_bits(window_size),
404 table_size = (1 << window_size) };
405
406 // For an integer of length window_size, what is the first set bit?
407 static const uint8_t _first_bit[table_size];
408
409 // For an integer of length window_size, what is the second set bit?
410 static const uint8_t _second_bit[table_size];
411
412 private:
413 // The current word we are inspecting
414 uint32_t _current;
415
416 // What element number are we currently on?
|
376 }
377 }
378 void check_watch(const char *operation) const {
379 if (IndexSetWatch != 0) {
380 if (IndexSetWatch == -1 || _serial_number == IndexSetWatch) {
381 tty->print_cr("IndexSet %d : %s", _serial_number, operation);
382 }
383 }
384 }
385
386 public:
387 static void print_statistics();
388
389 #endif
390 };
391
392
393 //-------------------------------- class IndexSetIterator --------------------
394 // An iterator for IndexSets.
395
396 class IndexSetIterator {
397 friend class IndexSet;
398
399 public:
400
401 // We walk over the bits in a word in chunks of size window_size.
402 enum { window_size = 5,
403 window_mask = right_n_bits(window_size),
404 table_size = (1 << window_size) };
405
406 // For an integer of length window_size, what is the first set bit?
407 static const uint8_t _first_bit[table_size];
408
409 // For an integer of length window_size, what is the second set bit?
410 static const uint8_t _second_bit[table_size];
411
412 private:
413 // The current word we are inspecting
414 uint32_t _current;
415
416 // What element number are we currently on?
|