src/java.base/share/classes/java/lang/invoke/X-VarHandleByteArrayView.java.template
changeset 48710 38872bed90e0
parent 47216 71c04702a3d5
child 52220 9c260a6b6471
equal deleted inserted replaced
48709:2d9dad1b821a 48710:38872bed90e0
     1 /*
     1 /*
     2  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2015, 2018, 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.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   532             return address;
   532             return address;
   533         }
   533         }
   534 
   534 
   535         @ForceInline
   535         @ForceInline
   536         static $type$ get(ByteBufferHandle handle, Object obb, int index) {
   536         static $type$ get(ByteBufferHandle handle, Object obb, int index) {
   537             ByteBuffer bb = (ByteBuffer) obb;
   537             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   538 #if[floatingPoint]
   538 #if[floatingPoint]
   539             $rawType$ rawValue = UNSAFE.get$RawType$Unaligned(
   539             $rawType$ rawValue = UNSAFE.get$RawType$Unaligned(
   540                     UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   540                     UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   541                     ((long) index(bb, index)) + UNSAFE.getLong(bb, BUFFER_ADDRESS),
   541                     ((long) index(bb, index)) + UNSAFE.getLong(bb, BUFFER_ADDRESS),
   542                     handle.be);
   542                     handle.be);
   549 #end[floatingPoint]
   549 #end[floatingPoint]
   550         }
   550         }
   551 
   551 
   552         @ForceInline
   552         @ForceInline
   553         static void set(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   553         static void set(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   554             ByteBuffer bb = (ByteBuffer) obb;
   554             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   555 #if[floatingPoint]
   555 #if[floatingPoint]
   556             UNSAFE.put$RawType$Unaligned(
   556             UNSAFE.put$RawType$Unaligned(
   557                     UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   557                     UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   558                     ((long) indexRO(bb, index)) + UNSAFE.getLong(bb, BUFFER_ADDRESS),
   558                     ((long) indexRO(bb, index)) + UNSAFE.getLong(bb, BUFFER_ADDRESS),
   559                     $Type$.$type$ToRaw$RawType$Bits(value),
   559                     $Type$.$type$ToRaw$RawType$Bits(value),
   567 #end[floatingPoint]
   567 #end[floatingPoint]
   568         }
   568         }
   569 
   569 
   570         @ForceInline
   570         @ForceInline
   571         static $type$ getVolatile(ByteBufferHandle handle, Object obb, int index) {
   571         static $type$ getVolatile(ByteBufferHandle handle, Object obb, int index) {
   572             ByteBuffer bb = (ByteBuffer) obb;
   572             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   573             return convEndian(handle.be,
   573             return convEndian(handle.be,
   574                               UNSAFE.get$RawType$Volatile(
   574                               UNSAFE.get$RawType$Volatile(
   575                                       UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   575                                       UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   576                                       address(bb, index(bb, index))));
   576                                       address(bb, index(bb, index))));
   577         }
   577         }
   578 
   578 
   579         @ForceInline
   579         @ForceInline
   580         static void setVolatile(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   580         static void setVolatile(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   581             ByteBuffer bb = (ByteBuffer) obb;
   581             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   582             UNSAFE.put$RawType$Volatile(
   582             UNSAFE.put$RawType$Volatile(
   583                     UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   583                     UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   584                     address(bb, indexRO(bb, index)),
   584                     address(bb, indexRO(bb, index)),
   585                     convEndian(handle.be, value));
   585                     convEndian(handle.be, value));
   586         }
   586         }
   587 
   587 
   588         @ForceInline
   588         @ForceInline
   589         static $type$ getAcquire(ByteBufferHandle handle, Object obb, int index) {
   589         static $type$ getAcquire(ByteBufferHandle handle, Object obb, int index) {
   590             ByteBuffer bb = (ByteBuffer) obb;
   590             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   591             return convEndian(handle.be,
   591             return convEndian(handle.be,
   592                               UNSAFE.get$RawType$Acquire(
   592                               UNSAFE.get$RawType$Acquire(
   593                                       UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   593                                       UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   594                                       address(bb, index(bb, index))));
   594                                       address(bb, index(bb, index))));
   595         }
   595         }
   596 
   596 
   597         @ForceInline
   597         @ForceInline
   598         static void setRelease(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   598         static void setRelease(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   599             ByteBuffer bb = (ByteBuffer) obb;
   599             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   600             UNSAFE.put$RawType$Release(
   600             UNSAFE.put$RawType$Release(
   601                     UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   601                     UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   602                     address(bb, indexRO(bb, index)),
   602                     address(bb, indexRO(bb, index)),
   603                     convEndian(handle.be, value));
   603                     convEndian(handle.be, value));
   604         }
   604         }
   605 
   605 
   606         @ForceInline
   606         @ForceInline
   607         static $type$ getOpaque(ByteBufferHandle handle, Object obb, int index) {
   607         static $type$ getOpaque(ByteBufferHandle handle, Object obb, int index) {
   608             ByteBuffer bb = (ByteBuffer) obb;
   608             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   609             return convEndian(handle.be,
   609             return convEndian(handle.be,
   610                               UNSAFE.get$RawType$Opaque(
   610                               UNSAFE.get$RawType$Opaque(
   611                                       UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   611                                       UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   612                                       address(bb, index(bb, index))));
   612                                       address(bb, index(bb, index))));
   613         }
   613         }
   614 
   614 
   615         @ForceInline
   615         @ForceInline
   616         static void setOpaque(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   616         static void setOpaque(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   617             ByteBuffer bb = (ByteBuffer) obb;
   617             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   618             UNSAFE.put$RawType$Opaque(
   618             UNSAFE.put$RawType$Opaque(
   619                     UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   619                     UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   620                     address(bb, indexRO(bb, index)),
   620                     address(bb, indexRO(bb, index)),
   621                     convEndian(handle.be, value));
   621                     convEndian(handle.be, value));
   622         }
   622         }
   623 #if[CAS]
   623 #if[CAS]
   624 
   624 
   625         @ForceInline
   625         @ForceInline
   626         static boolean compareAndSet(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
   626         static boolean compareAndSet(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
   627             ByteBuffer bb = (ByteBuffer) obb;
   627             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   628             return UNSAFE.compareAndSet$RawType$(
   628             return UNSAFE.compareAndSet$RawType$(
   629                     UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   629                     UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   630                     address(bb, indexRO(bb, index)),
   630                     address(bb, indexRO(bb, index)),
   631                     convEndian(handle.be, expected), convEndian(handle.be, value));
   631                     convEndian(handle.be, expected), convEndian(handle.be, value));
   632         }
   632         }
   633 
   633 
   634         @ForceInline
   634         @ForceInline
   635         static $type$ compareAndExchange(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
   635         static $type$ compareAndExchange(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
   636             ByteBuffer bb = (ByteBuffer) obb;
   636             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   637             return convEndian(handle.be,
   637             return convEndian(handle.be,
   638                               UNSAFE.compareAndExchange$RawType$(
   638                               UNSAFE.compareAndExchange$RawType$(
   639                                       UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   639                                       UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   640                                       address(bb, indexRO(bb, index)),
   640                                       address(bb, indexRO(bb, index)),
   641                                       convEndian(handle.be, expected), convEndian(handle.be, value)));
   641                                       convEndian(handle.be, expected), convEndian(handle.be, value)));
   642         }
   642         }
   643 
   643 
   644         @ForceInline
   644         @ForceInline
   645         static $type$ compareAndExchangeAcquire(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
   645         static $type$ compareAndExchangeAcquire(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
   646             ByteBuffer bb = (ByteBuffer) obb;
   646             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   647             return convEndian(handle.be,
   647             return convEndian(handle.be,
   648                               UNSAFE.compareAndExchange$RawType$Acquire(
   648                               UNSAFE.compareAndExchange$RawType$Acquire(
   649                                       UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   649                                       UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   650                                       address(bb, indexRO(bb, index)),
   650                                       address(bb, indexRO(bb, index)),
   651                                       convEndian(handle.be, expected), convEndian(handle.be, value)));
   651                                       convEndian(handle.be, expected), convEndian(handle.be, value)));
   652         }
   652         }
   653 
   653 
   654         @ForceInline
   654         @ForceInline
   655         static $type$ compareAndExchangeRelease(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
   655         static $type$ compareAndExchangeRelease(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
   656             ByteBuffer bb = (ByteBuffer) obb;
   656             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   657             return convEndian(handle.be,
   657             return convEndian(handle.be,
   658                               UNSAFE.compareAndExchange$RawType$Release(
   658                               UNSAFE.compareAndExchange$RawType$Release(
   659                                       UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   659                                       UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   660                                       address(bb, indexRO(bb, index)),
   660                                       address(bb, indexRO(bb, index)),
   661                                       convEndian(handle.be, expected), convEndian(handle.be, value)));
   661                                       convEndian(handle.be, expected), convEndian(handle.be, value)));
   662         }
   662         }
   663 
   663 
   664         @ForceInline
   664         @ForceInline
   665         static boolean weakCompareAndSetPlain(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
   665         static boolean weakCompareAndSetPlain(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
   666             ByteBuffer bb = (ByteBuffer) obb;
   666             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   667             return UNSAFE.weakCompareAndSet$RawType$Plain(
   667             return UNSAFE.weakCompareAndSet$RawType$Plain(
   668                     UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   668                     UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   669                     address(bb, indexRO(bb, index)),
   669                     address(bb, indexRO(bb, index)),
   670                     convEndian(handle.be, expected), convEndian(handle.be, value));
   670                     convEndian(handle.be, expected), convEndian(handle.be, value));
   671         }
   671         }
   672 
   672 
   673         @ForceInline
   673         @ForceInline
   674         static boolean weakCompareAndSet(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
   674         static boolean weakCompareAndSet(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
   675             ByteBuffer bb = (ByteBuffer) obb;
   675             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   676             return UNSAFE.weakCompareAndSet$RawType$(
   676             return UNSAFE.weakCompareAndSet$RawType$(
   677                     UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   677                     UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   678                     address(bb, indexRO(bb, index)),
   678                     address(bb, indexRO(bb, index)),
   679                     convEndian(handle.be, expected), convEndian(handle.be, value));
   679                     convEndian(handle.be, expected), convEndian(handle.be, value));
   680         }
   680         }
   681 
   681 
   682         @ForceInline
   682         @ForceInline
   683         static boolean weakCompareAndSetAcquire(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
   683         static boolean weakCompareAndSetAcquire(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
   684             ByteBuffer bb = (ByteBuffer) obb;
   684             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   685             return UNSAFE.weakCompareAndSet$RawType$Acquire(
   685             return UNSAFE.weakCompareAndSet$RawType$Acquire(
   686                     UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   686                     UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   687                     address(bb, indexRO(bb, index)),
   687                     address(bb, indexRO(bb, index)),
   688                     convEndian(handle.be, expected), convEndian(handle.be, value));
   688                     convEndian(handle.be, expected), convEndian(handle.be, value));
   689         }
   689         }
   690 
   690 
   691         @ForceInline
   691         @ForceInline
   692         static boolean weakCompareAndSetRelease(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
   692         static boolean weakCompareAndSetRelease(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
   693             ByteBuffer bb = (ByteBuffer) obb;
   693             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   694             return UNSAFE.weakCompareAndSet$RawType$Release(
   694             return UNSAFE.weakCompareAndSet$RawType$Release(
   695                     UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   695                     UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   696                     address(bb, indexRO(bb, index)),
   696                     address(bb, indexRO(bb, index)),
   697                     convEndian(handle.be, expected), convEndian(handle.be, value));
   697                     convEndian(handle.be, expected), convEndian(handle.be, value));
   698         }
   698         }
   699 
   699 
   700         @ForceInline
   700         @ForceInline
   701         static $type$ getAndSet(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   701         static $type$ getAndSet(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   702             ByteBuffer bb = (ByteBuffer) obb;
   702             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   703             return convEndian(handle.be,
   703             return convEndian(handle.be,
   704                               UNSAFE.getAndSet$RawType$(
   704                               UNSAFE.getAndSet$RawType$(
   705                                       UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   705                                       UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   706                                       address(bb, indexRO(bb, index)),
   706                                       address(bb, indexRO(bb, index)),
   707                                       convEndian(handle.be, value)));
   707                                       convEndian(handle.be, value)));
   708         }
   708         }
   709 
   709 
   710         @ForceInline
   710         @ForceInline
   711         static $type$ getAndSetAcquire(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   711         static $type$ getAndSetAcquire(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   712             ByteBuffer bb = (ByteBuffer) obb;
   712             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   713             return convEndian(handle.be,
   713             return convEndian(handle.be,
   714                               UNSAFE.getAndSet$RawType$Acquire(
   714                               UNSAFE.getAndSet$RawType$Acquire(
   715                                       UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   715                                       UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   716                                       address(bb, indexRO(bb, index)),
   716                                       address(bb, indexRO(bb, index)),
   717                                       convEndian(handle.be, value)));
   717                                       convEndian(handle.be, value)));
   718         }
   718         }
   719 
   719 
   720         @ForceInline
   720         @ForceInline
   721         static $type$ getAndSetRelease(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   721         static $type$ getAndSetRelease(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   722             ByteBuffer bb = (ByteBuffer) obb;
   722             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   723             return convEndian(handle.be,
   723             return convEndian(handle.be,
   724                               UNSAFE.getAndSet$RawType$Release(
   724                               UNSAFE.getAndSet$RawType$Release(
   725                                       UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   725                                       UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   726                                       address(bb, indexRO(bb, index)),
   726                                       address(bb, indexRO(bb, index)),
   727                                       convEndian(handle.be, value)));
   727                                       convEndian(handle.be, value)));
   729 #end[CAS]
   729 #end[CAS]
   730 #if[AtomicAdd]
   730 #if[AtomicAdd]
   731 
   731 
   732         @ForceInline
   732         @ForceInline
   733         static $type$ getAndAdd(ByteBufferHandle handle, Object obb, int index, $type$ delta) {
   733         static $type$ getAndAdd(ByteBufferHandle handle, Object obb, int index, $type$ delta) {
   734             ByteBuffer bb = (ByteBuffer) obb;
   734             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   735             if (handle.be == BE) {
   735             if (handle.be == BE) {
   736                 return UNSAFE.getAndAdd$RawType$(
   736                 return UNSAFE.getAndAdd$RawType$(
   737                         UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   737                         UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   738                         address(bb, indexRO(bb, index)),
   738                         address(bb, indexRO(bb, index)),
   739                         delta);
   739                         delta);
   742             }
   742             }
   743         }
   743         }
   744 
   744 
   745         @ForceInline
   745         @ForceInline
   746         static $type$ getAndAddAcquire(ByteBufferHandle handle, Object obb, int index, $type$ delta) {
   746         static $type$ getAndAddAcquire(ByteBufferHandle handle, Object obb, int index, $type$ delta) {
   747             ByteBuffer bb = (ByteBuffer) obb;
   747             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   748             if (handle.be == BE) {
   748             if (handle.be == BE) {
   749                 return UNSAFE.getAndAdd$RawType$Acquire(
   749                 return UNSAFE.getAndAdd$RawType$Acquire(
   750                         UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   750                         UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   751                         address(bb, indexRO(bb, index)),
   751                         address(bb, indexRO(bb, index)),
   752                         delta);
   752                         delta);
   755             }
   755             }
   756         }
   756         }
   757 
   757 
   758         @ForceInline
   758         @ForceInline
   759         static $type$ getAndAddRelease(ByteBufferHandle handle, Object obb, int index, $type$ delta) {
   759         static $type$ getAndAddRelease(ByteBufferHandle handle, Object obb, int index, $type$ delta) {
   760             ByteBuffer bb = (ByteBuffer) obb;
   760             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   761             if (handle.be == BE) {
   761             if (handle.be == BE) {
   762                 return UNSAFE.getAndAdd$RawType$Release(
   762                 return UNSAFE.getAndAdd$RawType$Release(
   763                         UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   763                         UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   764                         address(bb, indexRO(bb, index)),
   764                         address(bb, indexRO(bb, index)),
   765                         delta);
   765                         delta);
   783 #end[AtomicAdd]
   783 #end[AtomicAdd]
   784 #if[Bitwise]
   784 #if[Bitwise]
   785 
   785 
   786         @ForceInline
   786         @ForceInline
   787         static $type$ getAndBitwiseOr(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   787         static $type$ getAndBitwiseOr(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   788             ByteBuffer bb = (ByteBuffer) obb;
   788             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   789             if (handle.be == BE) {
   789             if (handle.be == BE) {
   790                 return UNSAFE.getAndBitwiseOr$RawType$(
   790                 return UNSAFE.getAndBitwiseOr$RawType$(
   791                         UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   791                         UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   792                         address(bb, indexRO(bb, index)),
   792                         address(bb, indexRO(bb, index)),
   793                         value);
   793                         value);
   796             }
   796             }
   797         }
   797         }
   798 
   798 
   799         @ForceInline
   799         @ForceInline
   800         static $type$ getAndBitwiseOrRelease(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   800         static $type$ getAndBitwiseOrRelease(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   801             ByteBuffer bb = (ByteBuffer) obb;
   801             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   802             if (handle.be == BE) {
   802             if (handle.be == BE) {
   803                 return UNSAFE.getAndBitwiseOr$RawType$Release(
   803                 return UNSAFE.getAndBitwiseOr$RawType$Release(
   804                         UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   804                         UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   805                         address(bb, indexRO(bb, index)),
   805                         address(bb, indexRO(bb, index)),
   806                         value);
   806                         value);
   809             }
   809             }
   810         }
   810         }
   811 
   811 
   812         @ForceInline
   812         @ForceInline
   813         static $type$ getAndBitwiseOrAcquire(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   813         static $type$ getAndBitwiseOrAcquire(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   814             ByteBuffer bb = (ByteBuffer) obb;
   814             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   815             if (handle.be == BE) {
   815             if (handle.be == BE) {
   816                 return UNSAFE.getAndBitwiseOr$RawType$Acquire(
   816                 return UNSAFE.getAndBitwiseOr$RawType$Acquire(
   817                         UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   817                         UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   818                         address(bb, indexRO(bb, index)),
   818                         address(bb, indexRO(bb, index)),
   819                         value);
   819                         value);
   835             return expectedValue;
   835             return expectedValue;
   836         }
   836         }
   837 
   837 
   838         @ForceInline
   838         @ForceInline
   839         static $type$ getAndBitwiseAnd(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   839         static $type$ getAndBitwiseAnd(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   840             ByteBuffer bb = (ByteBuffer) obb;
   840             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   841             if (handle.be == BE) {
   841             if (handle.be == BE) {
   842                 return UNSAFE.getAndBitwiseAnd$RawType$(
   842                 return UNSAFE.getAndBitwiseAnd$RawType$(
   843                         UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   843                         UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   844                         address(bb, indexRO(bb, index)),
   844                         address(bb, indexRO(bb, index)),
   845                         value);
   845                         value);
   848             }
   848             }
   849         }
   849         }
   850 
   850 
   851         @ForceInline
   851         @ForceInline
   852         static $type$ getAndBitwiseAndRelease(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   852         static $type$ getAndBitwiseAndRelease(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   853             ByteBuffer bb = (ByteBuffer) obb;
   853             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   854             if (handle.be == BE) {
   854             if (handle.be == BE) {
   855                 return UNSAFE.getAndBitwiseAnd$RawType$Release(
   855                 return UNSAFE.getAndBitwiseAnd$RawType$Release(
   856                         UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   856                         UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   857                         address(bb, indexRO(bb, index)),
   857                         address(bb, indexRO(bb, index)),
   858                         value);
   858                         value);
   861             }
   861             }
   862         }
   862         }
   863 
   863 
   864         @ForceInline
   864         @ForceInline
   865         static $type$ getAndBitwiseAndAcquire(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   865         static $type$ getAndBitwiseAndAcquire(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   866             ByteBuffer bb = (ByteBuffer) obb;
   866             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   867             if (handle.be == BE) {
   867             if (handle.be == BE) {
   868                 return UNSAFE.getAndBitwiseAnd$RawType$Acquire(
   868                 return UNSAFE.getAndBitwiseAnd$RawType$Acquire(
   869                         UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   869                         UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   870                         address(bb, indexRO(bb, index)),
   870                         address(bb, indexRO(bb, index)),
   871                         value);
   871                         value);
   888         }
   888         }
   889 
   889 
   890 
   890 
   891         @ForceInline
   891         @ForceInline
   892         static $type$ getAndBitwiseXor(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   892         static $type$ getAndBitwiseXor(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   893             ByteBuffer bb = (ByteBuffer) obb;
   893             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   894             if (handle.be == BE) {
   894             if (handle.be == BE) {
   895                 return UNSAFE.getAndBitwiseXor$RawType$(
   895                 return UNSAFE.getAndBitwiseXor$RawType$(
   896                         UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   896                         UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   897                         address(bb, indexRO(bb, index)),
   897                         address(bb, indexRO(bb, index)),
   898                         value);
   898                         value);
   901             }
   901             }
   902         }
   902         }
   903 
   903 
   904         @ForceInline
   904         @ForceInline
   905         static $type$ getAndBitwiseXorRelease(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   905         static $type$ getAndBitwiseXorRelease(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   906             ByteBuffer bb = (ByteBuffer) obb;
   906             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   907             if (handle.be == BE) {
   907             if (handle.be == BE) {
   908                 return UNSAFE.getAndBitwiseXor$RawType$Release(
   908                 return UNSAFE.getAndBitwiseXor$RawType$Release(
   909                         UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   909                         UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   910                         address(bb, indexRO(bb, index)),
   910                         address(bb, indexRO(bb, index)),
   911                         value);
   911                         value);
   914             }
   914             }
   915         }
   915         }
   916 
   916 
   917         @ForceInline
   917         @ForceInline
   918         static $type$ getAndBitwiseXorAcquire(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   918         static $type$ getAndBitwiseXorAcquire(ByteBufferHandle handle, Object obb, int index, $type$ value) {
   919             ByteBuffer bb = (ByteBuffer) obb;
   919             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
   920             if (handle.be == BE) {
   920             if (handle.be == BE) {
   921                 return UNSAFE.getAndBitwiseXor$RawType$Acquire(
   921                 return UNSAFE.getAndBitwiseXor$RawType$Acquire(
   922                         UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   922                         UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   923                         address(bb, indexRO(bb, index)),
   923                         address(bb, indexRO(bb, index)),
   924                         value);
   924                         value);