hotspot/src/share/vm/utilities/hashtable.inline.hpp
changeset 41183 207b92e69457
parent 39982 1a3808e3f4d9
child 46475 75902cea18af
equal deleted inserted replaced
41182:dbd59c1da636 41183:207b92e69457
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    77   return _buckets[i].get_entry();
    77   return _buckets[i].get_entry();
    78 }
    78 }
    79 
    79 
    80 
    80 
    81 template <MEMFLAGS F> inline void HashtableBucket<F>::set_entry(BasicHashtableEntry<F>* l) {
    81 template <MEMFLAGS F> inline void HashtableBucket<F>::set_entry(BasicHashtableEntry<F>* l) {
    82   // Warning: Preserve store ordering.  The SystemDictionary is read
    82   // Warning: Preserve store ordering.  The PackageEntryTable, ModuleEntryTable and
    83   //          without locks.  The new SystemDictionaryEntry must be
    83   //          SystemDictionary are read without locks.  The new entry must be
    84   //          complete before other threads can be allowed to see it
    84   //          complete before other threads can be allowed to see it
    85   //          via a store to _buckets[index].
    85   //          via a store to _buckets[index].
    86   OrderAccess::release_store_ptr(&_entry, l);
    86   OrderAccess::release_store_ptr(&_entry, l);
    87 }
    87 }
    88 
    88 
    89 
    89 
    90 template <MEMFLAGS F> inline BasicHashtableEntry<F>* HashtableBucket<F>::get_entry() const {
    90 template <MEMFLAGS F> inline BasicHashtableEntry<F>* HashtableBucket<F>::get_entry() const {
    91   // Warning: Preserve load ordering.  The SystemDictionary is read
    91   // Warning: Preserve load ordering.  The PackageEntryTable, ModuleEntryTable and
    92   //          without locks.  The new SystemDictionaryEntry must be
    92   //          SystemDictionary are read without locks.  The new entry must be
    93   //          complete before other threads can be allowed to see it
    93   //          complete before other threads can be allowed to see it
    94   //          via a store to _buckets[index].
    94   //          via a store to _buckets[index].
    95   return (BasicHashtableEntry<F>*) OrderAccess::load_ptr_acquire(&_entry);
    95   return (BasicHashtableEntry<F>*) OrderAccess::load_ptr_acquire(&_entry);
    96 }
    96 }
    97 
    97