< prev index next >

src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdBits.inline.hpp

Print this page




  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_JFR_CHECKPOINT_TYPES_TRACEID_JFRTRACEIDBITS_INLINE_HPP
  26 #define SHARE_VM_JFR_CHECKPOINT_TYPES_TRACEID_JFRTRACEIDBITS_INLINE_HPP
  27 
  28 #include "jfr/utilities/jfrTypes.hpp"
  29 #include "runtime/atomic.hpp"
  30 #include "runtime/orderAccess.inline.hpp"
  31 #include "utilities/macros.hpp"
  32 
  33 #ifdef VM_LITTLE_ENDIAN
  34 static const int low_offset = 0;
  35 static const int leakp_offset = low_offset + 1;
  36 #else
  37 static const int low_offset = 7;
  38 static const int leakp_offset = low_offset - 1;
  39 #endif
  40 
  41 inline void set_bits(jbyte bits, jbyte* const dest) {
  42   assert(dest != NULL, "invariant");
  43   const jbyte current = OrderAccess::load_acquire(dest);
  44   if (bits != (current & bits)) {
  45     *dest |= bits;
  46   }
  47 }
  48 
  49 inline void set_mask(jbyte mask, jbyte* const dest) {
  50   assert(dest != NULL, "invariant");




  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_JFR_CHECKPOINT_TYPES_TRACEID_JFRTRACEIDBITS_INLINE_HPP
  26 #define SHARE_VM_JFR_CHECKPOINT_TYPES_TRACEID_JFRTRACEIDBITS_INLINE_HPP
  27 
  28 #include "jfr/utilities/jfrTypes.hpp"
  29 #include "runtime/atomic.hpp"
  30 #include "runtime/orderAccess.hpp"
  31 #include "utilities/macros.hpp"
  32 
  33 #ifdef VM_LITTLE_ENDIAN
  34 static const int low_offset = 0;
  35 static const int leakp_offset = low_offset + 1;
  36 #else
  37 static const int low_offset = 7;
  38 static const int leakp_offset = low_offset - 1;
  39 #endif
  40 
  41 inline void set_bits(jbyte bits, jbyte* const dest) {
  42   assert(dest != NULL, "invariant");
  43   const jbyte current = OrderAccess::load_acquire(dest);
  44   if (bits != (current & bits)) {
  45     *dest |= bits;
  46   }
  47 }
  48 
  49 inline void set_mask(jbyte mask, jbyte* const dest) {
  50   assert(dest != NULL, "invariant");


< prev index next >