< prev index next >

src/java.base/share/classes/java/lang/invoke/X-VarHandle.java.template

Print this page

        

*** 204,216 **** value); } @ForceInline static $type$ addAndGet(FieldInstanceReadWrite handle, Object holder, $type$ value) { ! return UNSAFE.getAndAdd$Type$(Objects.requireNonNull(handle.receiverType.cast(holder)), handle.fieldOffset, ! value) + value; } #end[AtomicAdd] static final VarForm FORM = new VarForm(FieldInstanceReadWrite.class, Object.class, $type$.class); } --- 204,216 ---- value); } @ForceInline static $type$ addAndGet(FieldInstanceReadWrite handle, Object holder, $type$ value) { ! return {#if[ShorterThanInt]?($type$)}(UNSAFE.getAndAdd$Type$(Objects.requireNonNull(handle.receiverType.cast(holder)), handle.fieldOffset, ! value) + value); } #end[AtomicAdd] static final VarForm FORM = new VarForm(FieldInstanceReadWrite.class, Object.class, $type$.class); }
*** 386,398 **** value); } @ForceInline static $type$ addAndGet(FieldStaticReadWrite handle, $type$ value) { ! return UNSAFE.getAndAdd$Type$(handle.base, handle.fieldOffset, ! value) + value; } #end[AtomicAdd] static final VarForm FORM = new VarForm(FieldStaticReadWrite.class, null, $type$.class); } --- 386,398 ---- value); } @ForceInline static $type$ addAndGet(FieldStaticReadWrite handle, $type$ value) { ! return {#if[ShorterThanInt]?($type$)}(UNSAFE.getAndAdd$Type$(handle.base, handle.fieldOffset, ! value) + value); } #end[AtomicAdd] static final VarForm FORM = new VarForm(FieldStaticReadWrite.class, null, $type$.class); }
*** 647,659 **** #if[Object] Object[] array = (Object[]) handle.arrayType.cast(oarray); #else[Object] $type$[] array = ($type$[]) oarray; #end[Object] ! return UNSAFE.getAndAdd$Type$(array, (((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase, ! value) + value; } #end[AtomicAdd] static final VarForm FORM = new VarForm(Array.class, {#if[Object]?Object[].class:$type$[].class}, {#if[Object]?Object.class:$type$.class}, int.class); } --- 647,659 ---- #if[Object] Object[] array = (Object[]) handle.arrayType.cast(oarray); #else[Object] $type$[] array = ($type$[]) oarray; #end[Object] ! return {#if[ShorterThanInt]?($type$)}(UNSAFE.getAndAdd$Type$(array, (((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase, ! value) + value); } #end[AtomicAdd] static final VarForm FORM = new VarForm(Array.class, {#if[Object]?Object[].class:$type$[].class}, {#if[Object]?Object.class:$type$.class}, int.class); }
< prev index next >