hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.hpp
changeset 25351 7c198a690050
parent 24093 095cc0a63ed9
child 29680 e5203ed6d805
equal deleted inserted replaced
25350:6423a57e5451 25351:7c198a690050
    82 // http://openjdk.java.net/jeps/192
    82 // http://openjdk.java.net/jeps/192
    83 //
    83 //
    84 
    84 
    85 #include "memory/allocation.hpp"
    85 #include "memory/allocation.hpp"
    86 #include "oops/oop.hpp"
    86 #include "oops/oop.hpp"
       
    87 #include "runtime/atomic.hpp"
    87 
    88 
    88 class OopClosure;
    89 class OopClosure;
    89 class BoolObjectClosure;
    90 class BoolObjectClosure;
    90 class ThreadClosure;
    91 class ThreadClosure;
    91 class outputStream;
    92 class outputStream;
   172     return _rehashed_table != NULL;
   173     return _rehashed_table != NULL;
   173   }
   174   }
   174 
   175 
   175   // Atomically claims the next available queue for exclusive access by
   176   // Atomically claims the next available queue for exclusive access by
   176   // the current thread. Returns the queue number of the claimed queue.
   177   // the current thread. Returns the queue number of the claimed queue.
   177   size_t claim_queue() {
   178   size_t claim_queue();
   178     return (size_t)Atomic::add_ptr(1, &_next_queue) - 1;
       
   179   }
       
   180 
   179 
   181   // Atomically claims the next available table partition for exclusive
   180   // Atomically claims the next available table partition for exclusive
   182   // access by the current thread. Returns the table bucket number where
   181   // access by the current thread. Returns the table bucket number where
   183   // the claimed partition starts.
   182   // the claimed partition starts.
   184   size_t claim_table_partition(size_t partition_size) {
   183   size_t claim_table_partition(size_t partition_size);
   185     return (size_t)Atomic::add_ptr(partition_size, &_next_bucket) - partition_size;
       
   186   }
       
   187 
   184 
   188   // Applies and returns the result from the is_alive closure, or
   185   // Applies and returns the result from the is_alive closure, or
   189   // returns true if no such closure was provided.
   186   // returns true if no such closure was provided.
   190   bool is_alive(oop o) {
   187   bool is_alive(oop o) {
   191     if (_is_alive != NULL) {
   188     if (_is_alive != NULL) {