java.lang.invoke.VarHandleDoubles Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of qbicc-rt-java.base Show documentation
Show all versions of qbicc-rt-java.base Show documentation
The Qbicc builder for the java.base JDK module
/*
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.lang.invoke;
import jdk.internal.util.Preconditions;
import jdk.internal.vm.annotation.ForceInline;
import java.lang.invoke.VarHandle.VarHandleDesc;
import java.util.Objects;
import java.util.Optional;
import org.qbicc.rt.annotation.Tracking;
import static java.lang.invoke.MethodHandleStatics.UNSAFE;
// -- This file was mechanically generated: Do not edit! -- //
@Tracking("src/java.base/share/classes/java/lang/invoke/X-VarHandle.java.template")
final class VarHandleDoubles {
static class FieldInstanceReadOnly extends VarHandle {
final long fieldOffset;
final Class> receiverType;
FieldInstanceReadOnly(Class> receiverType, long fieldOffset) {
this(receiverType, fieldOffset, FieldInstanceReadOnly.FORM, false);
}
protected FieldInstanceReadOnly(Class> receiverType, long fieldOffset,
VarForm form, boolean exact) {
super(form, exact);
this.fieldOffset = fieldOffset;
this.receiverType = receiverType;
}
@Override
public FieldInstanceReadOnly withInvokeExactBehavior() {
return hasInvokeExactBehavior()
? this
: new FieldInstanceReadOnly(receiverType, fieldOffset, vform, true);
}
@Override
public FieldInstanceReadOnly withInvokeBehavior() {
return !hasInvokeExactBehavior()
? this
: new FieldInstanceReadOnly(receiverType, fieldOffset, vform, false);
}
@Override
final MethodType accessModeTypeUncached(AccessType at) {
return at.accessModeType(receiverType, double.class);
}
@Override
public Optional describeConstable() {
var receiverTypeRef = receiverType.describeConstable();
var fieldTypeRef = double.class.describeConstable();
if (!receiverTypeRef.isPresent() || !fieldTypeRef.isPresent())
return Optional.empty();
// Reflect on this VarHandle to extract the field name
String name = VarHandles.getFieldFromReceiverAndOffset(
receiverType, fieldOffset, double.class).getName();
return Optional.of(VarHandleDesc.ofField(receiverTypeRef.get(), name, fieldTypeRef.get()));
}
@ForceInline
static double get(VarHandle ob, Object holder) {
FieldInstanceReadOnly handle = (FieldInstanceReadOnly)ob;
return UNSAFE.getDouble(Objects.requireNonNull(handle.receiverType.cast(holder)),
handle.fieldOffset);
}
// @Override
public double get(Object holder) {
return UNSAFE.getDouble(Objects.requireNonNull(receiverType.cast(holder)), fieldOffset);
}
@ForceInline
static double getVolatile(VarHandle ob, Object holder) {
FieldInstanceReadOnly handle = (FieldInstanceReadOnly)ob;
return UNSAFE.getDoubleVolatile(Objects.requireNonNull(handle.receiverType.cast(holder)),
handle.fieldOffset);
}
// @Override
public double getVolatile(Object holder) {
return UNSAFE.getDoubleVolatile(Objects.requireNonNull(receiverType.cast(holder)), fieldOffset);
}
@ForceInline
static double getOpaque(VarHandle ob, Object holder) {
FieldInstanceReadOnly handle = (FieldInstanceReadOnly)ob;
return UNSAFE.getDoubleOpaque(Objects.requireNonNull(handle.receiverType.cast(holder)),
handle.fieldOffset);
}
// @Override
public double getOpaque(Object holder) {
return UNSAFE.getDoubleOpaque(Objects.requireNonNull(receiverType.cast(holder)), fieldOffset);
}
@ForceInline
static double getAcquire(VarHandle ob, Object holder) {
FieldInstanceReadOnly handle = (FieldInstanceReadOnly)ob;
return UNSAFE.getDoubleAcquire(Objects.requireNonNull(handle.receiverType.cast(holder)),
handle.fieldOffset);
}
// @Override
public double getAcquire(Object holder) {
return UNSAFE.getDoubleAcquire(Objects.requireNonNull(receiverType.cast(holder)), fieldOffset);
}
static final VarForm FORM = new VarForm(FieldInstanceReadOnly.class, Object.class, double.class);
}
static final class FieldInstanceReadWrite extends FieldInstanceReadOnly {
FieldInstanceReadWrite(Class> receiverType, long fieldOffset) {
this(receiverType, fieldOffset, false);
}
private FieldInstanceReadWrite(Class> receiverType, long fieldOffset,
boolean exact) {
super(receiverType, fieldOffset, FieldInstanceReadWrite.FORM, exact);
}
@Override
public FieldInstanceReadWrite withInvokeExactBehavior() {
return hasInvokeExactBehavior()
? this
: new FieldInstanceReadWrite(receiverType, fieldOffset, true);
}
@Override
public FieldInstanceReadWrite withInvokeBehavior() {
return !hasInvokeExactBehavior()
? this
: new FieldInstanceReadWrite(receiverType, fieldOffset, false);
}
@ForceInline
static void set(VarHandle ob, Object holder, double value) {
FieldInstanceReadWrite handle = (FieldInstanceReadWrite)ob;
UNSAFE.putDouble(Objects.requireNonNull(handle.receiverType.cast(holder)),
handle.fieldOffset,
value);
}
// @Override
public void set(Object holder, double value) {
UNSAFE.putDouble(Objects.requireNonNull(receiverType.cast(holder)), fieldOffset,
value);
}
@ForceInline
static void setVolatile(VarHandle ob, Object holder, double value) {
FieldInstanceReadWrite handle = (FieldInstanceReadWrite)ob;
UNSAFE.putDoubleVolatile(Objects.requireNonNull(handle.receiverType.cast(holder)),
handle.fieldOffset,
value);
}
// @Override
public void setVolatile(Object holder, double value) {
UNSAFE.putDoubleVolatile(Objects.requireNonNull(receiverType.cast(holder)), fieldOffset,
value);
}
@ForceInline
static void setOpaque(VarHandle ob, Object holder, double value) {
FieldInstanceReadWrite handle = (FieldInstanceReadWrite)ob;
UNSAFE.putDoubleOpaque(Objects.requireNonNull(handle.receiverType.cast(holder)),
handle.fieldOffset,
value);
}
// @Override
public void setOpaque(Object holder, double value) {
UNSAFE.putDoubleOpaque(Objects.requireNonNull(receiverType.cast(holder)), fieldOffset,
value);
}
@ForceInline
static void setRelease(VarHandle ob, Object holder, double value) {
FieldInstanceReadWrite handle = (FieldInstanceReadWrite)ob;
UNSAFE.putDoubleRelease(Objects.requireNonNull(handle.receiverType.cast(holder)),
handle.fieldOffset,
value);
}
// @Override
public void setRelease(Object holder, double value) {
UNSAFE.putDoubleRelease(Objects.requireNonNull(receiverType.cast(holder)), fieldOffset,
value);
}
@ForceInline
static boolean compareAndSet(VarHandle ob, Object holder, double expected, double value) {
FieldInstanceReadWrite handle = (FieldInstanceReadWrite)ob;
return UNSAFE.compareAndSetDouble(Objects.requireNonNull(handle.receiverType.cast(holder)),
handle.fieldOffset,
expected,
value);
}
// @Override
public boolean compareAndSet(Object holder, double expected, double value) {
return UNSAFE.compareAndSetDouble(Objects.requireNonNull(receiverType.cast(holder)),
fieldOffset,
expected,
value);
}
@ForceInline
static double compareAndExchange(VarHandle ob, Object holder, double expected, double value) {
FieldInstanceReadWrite handle = (FieldInstanceReadWrite)ob;
return UNSAFE.compareAndExchangeDouble(Objects.requireNonNull(handle.receiverType.cast(holder)),
handle.fieldOffset,
expected,
value);
}
// @Override
public double compareAndExchange(Object holder, double expected, double value) {
return UNSAFE.compareAndExchangeDouble(Objects.requireNonNull(receiverType.cast(holder)),
fieldOffset,
expected,
value);
}
@ForceInline
static double compareAndExchangeAcquire(VarHandle ob, Object holder, double expected, double value) {
FieldInstanceReadWrite handle = (FieldInstanceReadWrite)ob;
return UNSAFE.compareAndExchangeDoubleAcquire(Objects.requireNonNull(handle.receiverType.cast(holder)),
handle.fieldOffset,
expected,
value);
}
// @Override
public double compareAndExchangeAcquire(Object holder, double expected, double value) {
return UNSAFE.compareAndExchangeDoubleAcquire(Objects.requireNonNull(receiverType.cast(holder)),
fieldOffset,
expected,
value);
}
@ForceInline
static double compareAndExchangeRelease(VarHandle ob, Object holder, double expected, double value) {
FieldInstanceReadWrite handle = (FieldInstanceReadWrite)ob;
return UNSAFE.compareAndExchangeDoubleRelease(Objects.requireNonNull(handle.receiverType.cast(holder)),
handle.fieldOffset,
expected,
value);
}
// @Override
public double compareAndExchangeRelease(Object holder, double expected, double value) {
return UNSAFE.compareAndExchangeDoubleRelease(Objects.requireNonNull(receiverType.cast(holder)),
fieldOffset,
expected,
value);
}
@ForceInline
static boolean weakCompareAndSetPlain(VarHandle ob, Object holder, double expected, double value) {
FieldInstanceReadWrite handle = (FieldInstanceReadWrite)ob;
return UNSAFE.weakCompareAndSetDoublePlain(Objects.requireNonNull(handle.receiverType.cast(holder)),
handle.fieldOffset,
expected,
value);
}
// @Override
public boolean weakCompareAndSetPlain(Object holder, double expected, double value) {
return UNSAFE.weakCompareAndSetDoublePlain(Objects.requireNonNull(receiverType.cast(holder)),
fieldOffset,
expected,
value);
}
@ForceInline
static boolean weakCompareAndSet(VarHandle ob, Object holder, double expected, double value) {
FieldInstanceReadWrite handle = (FieldInstanceReadWrite)ob;
return UNSAFE.weakCompareAndSetDouble(Objects.requireNonNull(handle.receiverType.cast(holder)),
handle.fieldOffset,
expected,
value);
}
// @Override
public boolean weakCompareAndSet(Object holder, double expected, double value) {
return UNSAFE.weakCompareAndSetDouble(Objects.requireNonNull(receiverType.cast(holder)),
fieldOffset,
expected,
value);
}
@ForceInline
static boolean weakCompareAndSetAcquire(VarHandle ob, Object holder, double expected, double value) {
FieldInstanceReadWrite handle = (FieldInstanceReadWrite)ob;
return UNSAFE.weakCompareAndSetDoubleAcquire(Objects.requireNonNull(handle.receiverType.cast(holder)),
handle.fieldOffset,
expected,
value);
}
// @Override
public boolean weakCompareAndSetAcquire(Object holder, double expected, double value) {
return UNSAFE.weakCompareAndSetDoubleAcquire(Objects.requireNonNull(receiverType.cast(holder)),
fieldOffset,
expected,
value);
}
@ForceInline
static boolean weakCompareAndSetRelease(VarHandle ob, Object holder, double expected, double value) {
FieldInstanceReadWrite handle = (FieldInstanceReadWrite)ob;
return UNSAFE.weakCompareAndSetDoubleRelease(Objects.requireNonNull(handle.receiverType.cast(holder)),
handle.fieldOffset,
expected,
value);
}
// @Override
public boolean weakCompareAndSetRelease(Object holder, double expected, double value) {
return UNSAFE.weakCompareAndSetDoubleRelease(Objects.requireNonNull(receiverType.cast(holder)),
fieldOffset,
expected,
value);
}
@ForceInline
static double getAndSet(VarHandle ob, Object holder, double value) {
FieldInstanceReadWrite handle = (FieldInstanceReadWrite)ob;
return UNSAFE.getAndSetDouble(Objects.requireNonNull(handle.receiverType.cast(holder)),
handle.fieldOffset,
value);
}
// @Override
public double getAndSet(Object holder, double value) {
return UNSAFE.getAndSetDouble(Objects.requireNonNull(receiverType.cast(holder)), fieldOffset,
value);
}
@ForceInline
static double getAndSetAcquire(VarHandle ob, Object holder, double value) {
FieldInstanceReadWrite handle = (FieldInstanceReadWrite)ob;
return UNSAFE.getAndSetDoubleAcquire(Objects.requireNonNull(handle.receiverType.cast(holder)),
handle.fieldOffset,
value);
}
// @Override
public double getAndSetAcquire(Object holder, double value) {
return UNSAFE.getAndSetDoubleAcquire(Objects.requireNonNull(receiverType.cast(holder)), fieldOffset,
value);
}
@ForceInline
static double getAndSetRelease(VarHandle ob, Object holder, double value) {
FieldInstanceReadWrite handle = (FieldInstanceReadWrite)ob;
return UNSAFE.getAndSetDoubleRelease(Objects.requireNonNull(handle.receiverType.cast(holder)),
handle.fieldOffset,
value);
}
// @Override
public double getAndSetRelease(Object holder, double value) {
return UNSAFE.getAndSetDoubleRelease(Objects.requireNonNull(receiverType.cast(holder)), fieldOffset,
value);
}
@ForceInline
static double getAndAdd(VarHandle ob, Object holder, double value) {
FieldInstanceReadWrite handle = (FieldInstanceReadWrite)ob;
return UNSAFE.getAndAddDouble(Objects.requireNonNull(handle.receiverType.cast(holder)),
handle.fieldOffset,
value);
}
// @Override
public double getAndAdd(Object holder, double value) {
return UNSAFE.getAndAddDouble(Objects.requireNonNull(receiverType.cast(holder)), fieldOffset, value);
}
@ForceInline
static double getAndAddAcquire(VarHandle ob, Object holder, double value) {
FieldInstanceReadWrite handle = (FieldInstanceReadWrite)ob;
return UNSAFE.getAndAddDoubleAcquire(Objects.requireNonNull(handle.receiverType.cast(holder)),
handle.fieldOffset,
value);
}
// @Override
public double getAndAddAcquire(Object holder, double value) {
return UNSAFE.getAndAddDoubleAcquire(Objects.requireNonNull(receiverType.cast(holder)), fieldOffset, value);
}
@ForceInline
static double getAndAddRelease(VarHandle ob, Object holder, double value) {
FieldInstanceReadWrite handle = (FieldInstanceReadWrite)ob;
return UNSAFE.getAndAddDoubleRelease(Objects.requireNonNull(handle.receiverType.cast(holder)),
handle.fieldOffset,
value);
}
// @Override
public double getAndAddRelease(Object holder, double value) {
return UNSAFE.getAndAddDoubleRelease(Objects.requireNonNull(receiverType.cast(holder)), fieldOffset, value);
}
static final VarForm FORM = new VarForm(FieldInstanceReadWrite.class, Object.class, double.class);
}
static class FieldStaticReadOnly extends VarHandle {
final Object base;
final long fieldOffset;
FieldStaticReadOnly(Object base, long fieldOffset) {
this(base, fieldOffset, FieldStaticReadOnly.FORM, false);
}
protected FieldStaticReadOnly(Object base, long fieldOffset,
VarForm form, boolean exact) {
super(form, exact);
this.base = base;
this.fieldOffset = fieldOffset;
}
@Override
public FieldStaticReadOnly withInvokeExactBehavior() {
return hasInvokeExactBehavior()
? this
: new FieldStaticReadOnly(base, fieldOffset, vform, true);
}
@Override
public FieldStaticReadOnly withInvokeBehavior() {
return !hasInvokeExactBehavior()
? this
: new FieldStaticReadOnly(base, fieldOffset, vform, false);
}
@Override
public Optional describeConstable() {
var fieldTypeRef = double.class.describeConstable();
if (!fieldTypeRef.isPresent())
return Optional.empty();
// Reflect on this VarHandle to extract the field name
var staticField = VarHandles.getStaticFieldFromBaseAndOffset(
base, fieldOffset, double.class);
var receiverTypeRef = staticField.getDeclaringClass().describeConstable();
if (!receiverTypeRef.isPresent())
return Optional.empty();
return Optional.of(VarHandleDesc.ofStaticField(receiverTypeRef.get(), staticField.getName(), fieldTypeRef.get()));
}
@Override
final MethodType accessModeTypeUncached(AccessType at) {
return at.accessModeType(null, double.class);
}
@ForceInline
static double get(VarHandle ob) {
FieldStaticReadOnly handle = (FieldStaticReadOnly)ob;
return UNSAFE.getDouble(handle.base,
handle.fieldOffset);
}
// @Override
public double get() {
return UNSAFE.getDouble(base, fieldOffset);
}
@ForceInline
static double getVolatile(VarHandle ob) {
FieldStaticReadOnly handle = (FieldStaticReadOnly)ob;
return UNSAFE.getDoubleVolatile(handle.base,
handle.fieldOffset);
}
// @Override
public double getVolatile() {
return UNSAFE.getDoubleVolatile(base, fieldOffset);
}
@ForceInline
static double getOpaque(VarHandle ob) {
FieldStaticReadOnly handle = (FieldStaticReadOnly)ob;
return UNSAFE.getDoubleOpaque(handle.base,
handle.fieldOffset);
}
// @Override
public double getOpaque() {
return UNSAFE.getDoubleOpaque(base, fieldOffset);
}
@ForceInline
static double getAcquire(VarHandle ob) {
FieldStaticReadOnly handle = (FieldStaticReadOnly)ob;
return UNSAFE.getDoubleAcquire(handle.base,
handle.fieldOffset);
}
// @Override
public double getAcquire() {
return UNSAFE.getDoubleAcquire(base, fieldOffset);
}
static final VarForm FORM = new VarForm(FieldStaticReadOnly.class, null, double.class);
}
static final class FieldStaticReadWrite extends FieldStaticReadOnly {
FieldStaticReadWrite(Object base, long fieldOffset) {
this(base, fieldOffset, false);
}
private FieldStaticReadWrite(Object base, long fieldOffset,
boolean exact) {
super(base, fieldOffset, FieldStaticReadWrite.FORM, exact);
}
@Override
public FieldStaticReadWrite withInvokeExactBehavior() {
return hasInvokeExactBehavior()
? this
: new FieldStaticReadWrite(base, fieldOffset, true);
}
@Override
public FieldStaticReadWrite withInvokeBehavior() {
return !hasInvokeExactBehavior()
? this
: new FieldStaticReadWrite(base, fieldOffset, false);
}
@ForceInline
static void set(VarHandle ob, double value) {
FieldStaticReadWrite handle = (FieldStaticReadWrite)ob;
UNSAFE.putDouble(handle.base,
handle.fieldOffset,
value);
}
// @Override
public void set(double value) {
UNSAFE.putDouble(base, fieldOffset, value);
}
@ForceInline
static void setVolatile(VarHandle ob, double value) {
FieldStaticReadWrite handle = (FieldStaticReadWrite)ob;
UNSAFE.putDoubleVolatile(handle.base,
handle.fieldOffset,
value);
}
// @Override
public void setVolatile(double value) {
UNSAFE.putDoubleVolatile(base, fieldOffset, value);
}
@ForceInline
static void setOpaque(VarHandle ob, double value) {
FieldStaticReadWrite handle = (FieldStaticReadWrite)ob;
UNSAFE.putDoubleOpaque(handle.base,
handle.fieldOffset,
value);
}
// @Override
public void setOpaque(double value) {
UNSAFE.putDoubleOpaque(base, fieldOffset, value);
}
@ForceInline
static void setRelease(VarHandle ob, double value) {
FieldStaticReadWrite handle = (FieldStaticReadWrite)ob;
UNSAFE.putDoubleRelease(handle.base,
handle.fieldOffset,
value);
}
// @Override
public void setRelease(double value) {
UNSAFE.putDoubleRelease(base, fieldOffset, value);
}
@ForceInline
static boolean compareAndSet(VarHandle ob, double expected, double value) {
FieldStaticReadWrite handle = (FieldStaticReadWrite)ob;
return UNSAFE.compareAndSetDouble(handle.base,
handle.fieldOffset,
expected,
value);
}
// @Override
public boolean compareAndSet(double expected, double value) {
return UNSAFE.compareAndSetDouble(base, fieldOffset,
expected,
value);
}
@ForceInline
static double compareAndExchange(VarHandle ob, double expected, double value) {
FieldStaticReadWrite handle = (FieldStaticReadWrite)ob;
return UNSAFE.compareAndExchangeDouble(handle.base,
handle.fieldOffset,
expected,
value);
}
// @Override
public double compareAndExchange(double expected, double value) {
return UNSAFE.compareAndExchangeDouble(base, fieldOffset,
expected,
value);
}
@ForceInline
static double compareAndExchangeAcquire(VarHandle ob, double expected, double value) {
FieldStaticReadWrite handle = (FieldStaticReadWrite)ob;
return UNSAFE.compareAndExchangeDoubleAcquire(handle.base,
handle.fieldOffset,
expected,
value);
}
// @Override
public double compareAndExchangeAcquire(double expected, double value) {
return UNSAFE.compareAndExchangeDoubleAcquire(base, fieldOffset,
expected,
value);
}
@ForceInline
static double compareAndExchangeRelease(VarHandle ob, double expected, double value) {
FieldStaticReadWrite handle = (FieldStaticReadWrite)ob;
return UNSAFE.compareAndExchangeDoubleRelease(handle.base,
handle.fieldOffset,
expected,
value);
}
// @Override
public double compareAndExchangeRelease(double expected, double value) {
return UNSAFE.compareAndExchangeDoubleRelease(base, fieldOffset,
expected,
value);
}
@ForceInline
static boolean weakCompareAndSetPlain(VarHandle ob, double expected, double value) {
FieldStaticReadWrite handle = (FieldStaticReadWrite)ob;
return UNSAFE.weakCompareAndSetDoublePlain(handle.base,
handle.fieldOffset,
expected,
value);
}
// @Override
public boolean weakCompareAndSetPlain(double expected, double value) {
return UNSAFE.weakCompareAndSetDoublePlain(base, fieldOffset,
expected,
value);
}
@ForceInline
static boolean weakCompareAndSet(VarHandle ob, double expected, double value) {
FieldStaticReadWrite handle = (FieldStaticReadWrite)ob;
return UNSAFE.weakCompareAndSetDouble(handle.base,
handle.fieldOffset,
expected,
value);
}
// @Override
public boolean weakCompareAndSet(double expected, double value) {
return UNSAFE.weakCompareAndSetDouble(base, fieldOffset,
expected,
value);
}
@ForceInline
static boolean weakCompareAndSetAcquire(VarHandle ob, double expected, double value) {
FieldStaticReadWrite handle = (FieldStaticReadWrite)ob;
return UNSAFE.weakCompareAndSetDoubleAcquire(handle.base,
handle.fieldOffset,
expected,
value);
}
// @Override
public boolean weakCompareAndSetAcquire(double expected, double value) {
return UNSAFE.weakCompareAndSetDoubleAcquire(base, fieldOffset,
expected,
value);
}
@ForceInline
static boolean weakCompareAndSetRelease(VarHandle ob, double expected, double value) {
FieldStaticReadWrite handle = (FieldStaticReadWrite)ob;
return UNSAFE.weakCompareAndSetDoubleRelease(handle.base,
handle.fieldOffset,
expected,
value);
}
// @Override
public boolean weakCompareAndSetRelease(double expected, double value) {
return UNSAFE.weakCompareAndSetDoubleRelease(base, fieldOffset,
expected,
value);
}
@ForceInline
static double getAndSet(VarHandle ob, double value) {
FieldStaticReadWrite handle = (FieldStaticReadWrite)ob;
return UNSAFE.getAndSetDouble(handle.base,
handle.fieldOffset,
value);
}
// @Override
public double getAndSet(double value) {
return UNSAFE.getAndSetDouble(base, fieldOffset, value);
}
@ForceInline
static double getAndSetAcquire(VarHandle ob, double value) {
FieldStaticReadWrite handle = (FieldStaticReadWrite)ob;
return UNSAFE.getAndSetDoubleAcquire(handle.base,
handle.fieldOffset,
value);
}
// @Override
public double getAndSetAcquire(double value) {
return UNSAFE.getAndSetDoubleAcquire(base, fieldOffset, value);
}
@ForceInline
static double getAndSetRelease(VarHandle ob, double value) {
FieldStaticReadWrite handle = (FieldStaticReadWrite)ob;
return UNSAFE.getAndSetDoubleRelease(handle.base,
handle.fieldOffset,
value);
}
// @Override
public double getAndSetRelease(double value) {
return UNSAFE.getAndSetDoubleRelease(base, fieldOffset, value);
}
@ForceInline
static double getAndAdd(VarHandle ob, double value) {
FieldStaticReadWrite handle = (FieldStaticReadWrite)ob;
return UNSAFE.getAndAddDouble(handle.base,
handle.fieldOffset,
value);
}
// @Override
public double getAndAdd(double value) {
return UNSAFE.getAndAddDouble(base, fieldOffset, value);
}
@ForceInline
static double getAndAddAcquire(VarHandle ob, double value) {
FieldStaticReadWrite handle = (FieldStaticReadWrite)ob;
return UNSAFE.getAndAddDoubleAcquire(handle.base,
handle.fieldOffset,
value);
}
// @Override
public double getAndAddAcquire(double value) {
return UNSAFE.getAndAddDoubleAcquire(base, fieldOffset, value);
}
@ForceInline
static double getAndAddRelease(VarHandle ob, double value) {
FieldStaticReadWrite handle = (FieldStaticReadWrite)ob;
return UNSAFE.getAndAddDoubleRelease(handle.base,
handle.fieldOffset,
value);
}
// @Override
public double getAndAddRelease(double value) {
return UNSAFE.getAndAddDoubleRelease(base, fieldOffset, value);
}
static final VarForm FORM = new VarForm(FieldStaticReadWrite.class, null, double.class);
}
static final class Array extends VarHandle {
final int abase;
final int ashift;
Array(int abase, int ashift) {
this(abase, ashift, false);
}
private Array(int abase, int ashift, boolean exact) {
super(Array.FORM, exact);
this.abase = abase;
this.ashift = ashift;
}
@Override
public Array withInvokeExactBehavior() {
return hasInvokeExactBehavior()
? this
: new Array(abase, ashift, true);
}
@Override
public Array withInvokeBehavior() {
return !hasInvokeExactBehavior()
? this
: new Array(abase, ashift, false);
}
@Override
public Optional describeConstable() {
var arrayTypeRef = double[].class.describeConstable();
if (!arrayTypeRef.isPresent())
return Optional.empty();
return Optional.of(VarHandleDesc.ofArray(arrayTypeRef.get()));
}
@Override
final MethodType accessModeTypeUncached(AccessType at) {
return at.accessModeType(double[].class, double.class, int.class);
}
@ForceInline
static double get(VarHandle ob, Object oarray, int index) {
Array handle = (Array)ob;
double[] array = (double[]) oarray;
return array[index];
}
// @Override
public double get(Object oarray, int index) {
double[] array = (double[]) oarray;
return array[index];
}
@ForceInline
static void set(VarHandle ob, Object oarray, int index, double value) {
Array handle = (Array)ob;
double[] array = (double[]) oarray;
array[index] = value;
}
// @Override
public void set(Object oarray, int index, double value) {
double[] array = (double[]) oarray;
array[index] = value;
}
@ForceInline
static double getVolatile(VarHandle ob, Object oarray, int index) {
Array handle = (Array)ob;
double[] array = (double[]) oarray;
return UNSAFE.getDoubleVolatile(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase);
}
// @Override
public double getVolatile(Object oarray, int index) {
double[] array = (double[]) oarray;
return UNSAFE.getDoubleVolatile(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << ashift) + abase);
}
@ForceInline
static void setVolatile(VarHandle ob, Object oarray, int index, double value) {
Array handle = (Array)ob;
double[] array = (double[]) oarray;
UNSAFE.putDoubleVolatile(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase,
value);
}
// @Override
public void setVolatile(Object oarray, int index, double value) {
double[] array = (double[]) oarray;
UNSAFE.putDoubleVolatile(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << ashift) + abase,
value);
}
@ForceInline
static double getOpaque(VarHandle ob, Object oarray, int index) {
Array handle = (Array)ob;
double[] array = (double[]) oarray;
return UNSAFE.getDoubleOpaque(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase);
}
// @Override
public double getOpaque(Object oarray, int index) {
double[] array = (double[]) oarray;
return UNSAFE.getDoubleOpaque(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << ashift) + abase);
}
@ForceInline
static void setOpaque(VarHandle ob, Object oarray, int index, double value) {
Array handle = (Array)ob;
double[] array = (double[]) oarray;
UNSAFE.putDoubleOpaque(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase,
value);
}
// @Override
public void setOpaque(Object oarray, int index, double value) {
double[] array = (double[]) oarray;
UNSAFE.putDoubleOpaque(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << ashift) + abase,
value);
}
@ForceInline
static double getAcquire(VarHandle ob, Object oarray, int index) {
Array handle = (Array)ob;
double[] array = (double[]) oarray;
return UNSAFE.getDoubleAcquire(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase);
}
// @Override
public double getAcquire(Object oarray, int index) {
double[] array = (double[]) oarray;
return UNSAFE.getDoubleAcquire(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << ashift) + abase);
}
@ForceInline
static void setRelease(VarHandle ob, Object oarray, int index, double value) {
Array handle = (Array)ob;
double[] array = (double[]) oarray;
UNSAFE.putDoubleRelease(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase,
value);
}
// @Override
public void setRelease(Object oarray, int index, double value) {
double[] array = (double[]) oarray;
UNSAFE.putDoubleRelease(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << ashift) + abase,
value);
}
@ForceInline
static boolean compareAndSet(VarHandle ob, Object oarray, int index, double expected, double value) {
Array handle = (Array)ob;
double[] array = (double[]) oarray;
return UNSAFE.compareAndSetDouble(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase,
expected,
value);
}
// @Override
public boolean compareAndSet(Object oarray, int index, double expected, double value) {
double[] array = (double[]) oarray;
return UNSAFE.compareAndSetDouble(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << ashift) + abase,
expected,
value);
}
@ForceInline
static double compareAndExchange(VarHandle ob, Object oarray, int index, double expected, double value) {
Array handle = (Array)ob;
double[] array = (double[]) oarray;
return UNSAFE.compareAndExchangeDouble(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase,
expected,
value);
}
// @Override
public double compareAndExchange(Object oarray, int index, double expected, double value) {
double[] array = (double[]) oarray;
return UNSAFE.compareAndExchangeDouble(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << ashift) + abase,
expected,
value);
}
@ForceInline
static double compareAndExchangeAcquire(VarHandle ob, Object oarray, int index, double expected, double value) {
Array handle = (Array)ob;
double[] array = (double[]) oarray;
return UNSAFE.compareAndExchangeDoubleAcquire(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase,
expected,
value);
}
// @Override
public double compareAndExchangeAcquire(Object oarray, int index, double expected, double value) {
double[] array = (double[]) oarray;
return UNSAFE.compareAndExchangeDoubleAcquire(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << ashift) + abase,
expected,
value);
}
@ForceInline
static double compareAndExchangeRelease(VarHandle ob, Object oarray, int index, double expected, double value) {
Array handle = (Array)ob;
double[] array = (double[]) oarray;
return UNSAFE.compareAndExchangeDoubleRelease(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase,
expected,
value);
}
// @Override
public double compareAndExchangeRelease(Object oarray, int index, double expected, double value) {
double[] array = (double[]) oarray;
return UNSAFE.compareAndExchangeDoubleRelease(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << ashift) + abase,
expected,
value);
}
@ForceInline
static boolean weakCompareAndSetPlain(VarHandle ob, Object oarray, int index, double expected, double value) {
Array handle = (Array)ob;
double[] array = (double[]) oarray;
return UNSAFE.weakCompareAndSetDoublePlain(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase,
expected,
value);
}
// @Override
public boolean weakCompareAndSetPlain(Object oarray, int index, double expected, double value) {
double[] array = (double[]) oarray;
return UNSAFE.weakCompareAndSetDoublePlain(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << ashift) + abase,
expected,
value);
}
@ForceInline
static boolean weakCompareAndSet(VarHandle ob, Object oarray, int index, double expected, double value) {
Array handle = (Array)ob;
double[] array = (double[]) oarray;
return UNSAFE.weakCompareAndSetDouble(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase,
expected,
value);
}
// @Override
public boolean weakCompareAndSet(Object oarray, int index, double expected, double value) {
double[] array = (double[]) oarray;
return UNSAFE.weakCompareAndSetDouble(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << ashift) + abase,
expected,
value);
}
@ForceInline
static boolean weakCompareAndSetAcquire(VarHandle ob, Object oarray, int index, double expected, double value) {
Array handle = (Array)ob;
double[] array = (double[]) oarray;
return UNSAFE.weakCompareAndSetDoubleAcquire(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase,
expected,
value);
}
// @Override
public boolean weakCompareAndSetAcquire(Object oarray, int index, double expected, double value) {
double[] array = (double[]) oarray;
return UNSAFE.weakCompareAndSetDoubleAcquire(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << ashift) + abase,
expected,
value);
}
@ForceInline
static boolean weakCompareAndSetRelease(VarHandle ob, Object oarray, int index, double expected, double value) {
Array handle = (Array)ob;
double[] array = (double[]) oarray;
return UNSAFE.weakCompareAndSetDoubleRelease(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase,
expected,
value);
}
// @Override
public boolean weakCompareAndSetRelease(Object oarray, int index, double expected, double value) {
double[] array = (double[]) oarray;
return UNSAFE.weakCompareAndSetDoubleRelease(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << ashift) + abase,
expected,
value);
}
@ForceInline
static double getAndSet(VarHandle ob, Object oarray, int index, double value) {
Array handle = (Array)ob;
double[] array = (double[]) oarray;
return UNSAFE.getAndSetDouble(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase,
value);
}
// @Override
public double getAndSet(Object oarray, int index, double value) {
double[] array = (double[]) oarray;
return UNSAFE.getAndSetDouble(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << ashift) + abase,
value);
}
@ForceInline
static double getAndSetAcquire(VarHandle ob, Object oarray, int index, double value) {
Array handle = (Array)ob;
double[] array = (double[]) oarray;
return UNSAFE.getAndSetDoubleAcquire(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase,
value);
}
// @Override
public double getAndSetAcquire(Object oarray, int index, double value) {
double[] array = (double[]) oarray;
return UNSAFE.getAndSetDoubleAcquire(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << ashift) + abase,
value);
}
@ForceInline
static double getAndSetRelease(VarHandle ob, Object oarray, int index, double value) {
Array handle = (Array)ob;
double[] array = (double[]) oarray;
return UNSAFE.getAndSetDoubleRelease(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase,
value);
}
// @Override
public double getAndSetRelease(Object oarray, int index, double value) {
double[] array = (double[]) oarray;
return UNSAFE.getAndSetDoubleRelease(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << ashift) + abase,
value);
}
@ForceInline
static double getAndAdd(VarHandle ob, Object oarray, int index, double value) {
Array handle = (Array)ob;
double[] array = (double[]) oarray;
return UNSAFE.getAndAddDouble(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase,
value);
}
// @Override
public double getAndAdd(Object oarray, int index, double value) {
double[] array = (double[]) oarray;
return UNSAFE.getAndAddDouble(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << ashift) + abase,
value);
}
@ForceInline
static double getAndAddAcquire(VarHandle ob, Object oarray, int index, double value) {
Array handle = (Array)ob;
double[] array = (double[]) oarray;
return UNSAFE.getAndAddDoubleAcquire(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase,
value);
}
// @Override
public double getAndAddAcquire(Object oarray, int index, double value) {
double[] array = (double[]) oarray;
return UNSAFE.getAndAddDoubleAcquire(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << ashift) + abase,
value);
}
@ForceInline
static double getAndAddRelease(VarHandle ob, Object oarray, int index, double value) {
Array handle = (Array)ob;
double[] array = (double[]) oarray;
return UNSAFE.getAndAddDoubleRelease(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase,
value);
}
// @Override
public double getAndAddRelease(Object oarray, int index, double value) {
double[] array = (double[]) oarray;
return UNSAFE.getAndAddDoubleRelease(array,
(((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << ashift) + abase,
value);
}
static final VarForm FORM = new VarForm(Array.class, double[].class, double.class, int.class);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy