Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JDK 11 java.base.jmod - Base Module
JDK 11 java.base.jmod is the JMOD file for JDK 11 Base module.
JDK 11 Base module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\java.base.jmod.
JDK 11 Base module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 Base module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\java.base.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ java/lang/invoke/VarHandleByteArrayAsFloats.java
/* * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package java.lang.invoke; import jdk.internal.misc.Unsafe; import jdk.internal.util.Preconditions; import jdk.internal.vm.annotation.ForceInline; import java.nio.ByteBuffer; import java.nio.ReadOnlyBufferException; import java.util.Objects; import static java.lang.invoke.MethodHandleStatics.UNSAFE; // -- This file was mechanically generated: Do not edit! -- // final class VarHandleByteArrayAsFloats extends VarHandleByteArrayBase { static final int ALIGN = Float.BYTES - 1; @ForceInline static int convEndian(boolean big, float v) { int rv = Float.floatToRawIntBits(v); return big == BE ? rv : Integer.reverseBytes(rv); } @ForceInline static float convEndian(boolean big, int rv) { rv = big == BE ? rv : Integer.reverseBytes(rv); return Float.intBitsToFloat(rv); } private static abstract class ByteArrayViewVarHandle extends VarHandle { final boolean be; ByteArrayViewVarHandle(VarForm form, boolean be) { super(form); this.be = be; } } static final class ArrayHandle extends ByteArrayViewVarHandle { ArrayHandle(boolean be) { super(ArrayHandle.FORM, be); } @Override final MethodType accessModeTypeUncached(AccessMode accessMode) { return accessMode.at.accessModeType(byte[].class, float.class, int.class); } @ForceInline static int index(byte[] ba, int index) { return Preconditions.checkIndex(index, ba.length - ALIGN, null); } @ForceInline static long address(byte[] ba, int index) { long address = ((long) index) + Unsafe.ARRAY_BYTE_BASE_OFFSET; if ((address & ALIGN) != 0) throw newIllegalStateExceptionForMisalignedAccess(index); return address; } @ForceInline static float get(ArrayHandle handle, Object oba, int index) { byte[] ba = (byte[]) oba; int rawValue = UNSAFE.getIntUnaligned( ba, ((long) index(ba, index)) + Unsafe.ARRAY_BYTE_BASE_OFFSET, handle.be); return Float.intBitsToFloat(rawValue); } @ForceInline static void set(ArrayHandle handle, Object oba, int index, float value) { byte[] ba = (byte[]) oba; UNSAFE.putIntUnaligned( ba, ((long) index(ba, index)) + Unsafe.ARRAY_BYTE_BASE_OFFSET, Float.floatToRawIntBits(value), handle.be); } @ForceInline static float getVolatile(ArrayHandle handle, Object oba, int index) { byte[] ba = (byte[]) oba; return convEndian(handle.be, UNSAFE.getIntVolatile( ba, address(ba, index(ba, index)))); } @ForceInline static void setVolatile(ArrayHandle handle, Object oba, int index, float value) { byte[] ba = (byte[]) oba; UNSAFE.putIntVolatile( ba, address(ba, index(ba, index)), convEndian(handle.be, value)); } @ForceInline static float getAcquire(ArrayHandle handle, Object oba, int index) { byte[] ba = (byte[]) oba; return convEndian(handle.be, UNSAFE.getIntAcquire( ba, address(ba, index(ba, index)))); } @ForceInline static void setRelease(ArrayHandle handle, Object oba, int index, float value) { byte[] ba = (byte[]) oba; UNSAFE.putIntRelease( ba, address(ba, index(ba, index)), convEndian(handle.be, value)); } @ForceInline static float getOpaque(ArrayHandle handle, Object oba, int index) { byte[] ba = (byte[]) oba; return convEndian(handle.be, UNSAFE.getIntOpaque( ba, address(ba, index(ba, index)))); } @ForceInline static void setOpaque(ArrayHandle handle, Object oba, int index, float value) { byte[] ba = (byte[]) oba; UNSAFE.putIntOpaque( ba, address(ba, index(ba, index)), convEndian(handle.be, value)); } @ForceInline static boolean compareAndSet(ArrayHandle handle, Object oba, int index, float expected, float value) { byte[] ba = (byte[]) oba; return UNSAFE.compareAndSetInt( ba, address(ba, index(ba, index)), convEndian(handle.be, expected), convEndian(handle.be, value)); } @ForceInline static float compareAndExchange(ArrayHandle handle, Object oba, int index, float expected, float value) { byte[] ba = (byte[]) oba; return convEndian(handle.be, UNSAFE.compareAndExchangeInt( ba, address(ba, index(ba, index)), convEndian(handle.be, expected), convEndian(handle.be, value))); } @ForceInline static float compareAndExchangeAcquire(ArrayHandle handle, Object oba, int index, float expected, float value) { byte[] ba = (byte[]) oba; return convEndian(handle.be, UNSAFE.compareAndExchangeIntAcquire( ba, address(ba, index(ba, index)), convEndian(handle.be, expected), convEndian(handle.be, value))); } @ForceInline static float compareAndExchangeRelease(ArrayHandle handle, Object oba, int index, float expected, float value) { byte[] ba = (byte[]) oba; return convEndian(handle.be, UNSAFE.compareAndExchangeIntRelease( ba, address(ba, index(ba, index)), convEndian(handle.be, expected), convEndian(handle.be, value))); } @ForceInline static boolean weakCompareAndSetPlain(ArrayHandle handle, Object oba, int index, float expected, float value) { byte[] ba = (byte[]) oba; return UNSAFE.weakCompareAndSetIntPlain( ba, address(ba, index(ba, index)), convEndian(handle.be, expected), convEndian(handle.be, value)); } @ForceInline static boolean weakCompareAndSet(ArrayHandle handle, Object oba, int index, float expected, float value) { byte[] ba = (byte[]) oba; return UNSAFE.weakCompareAndSetInt( ba, address(ba, index(ba, index)), convEndian(handle.be, expected), convEndian(handle.be, value)); } @ForceInline static boolean weakCompareAndSetAcquire(ArrayHandle handle, Object oba, int index, float expected, float value) { byte[] ba = (byte[]) oba; return UNSAFE.weakCompareAndSetIntAcquire( ba, address(ba, index(ba, index)), convEndian(handle.be, expected), convEndian(handle.be, value)); } @ForceInline static boolean weakCompareAndSetRelease(ArrayHandle handle, Object oba, int index, float expected, float value) { byte[] ba = (byte[]) oba; return UNSAFE.weakCompareAndSetIntRelease( ba, address(ba, index(ba, index)), convEndian(handle.be, expected), convEndian(handle.be, value)); } @ForceInline static float getAndSet(ArrayHandle handle, Object oba, int index, float value) { byte[] ba = (byte[]) oba; return convEndian(handle.be, UNSAFE.getAndSetInt( ba, address(ba, index(ba, index)), convEndian(handle.be, value))); } @ForceInline static float getAndSetAcquire(ArrayHandle handle, Object oba, int index, float value) { byte[] ba = (byte[]) oba; return convEndian(handle.be, UNSAFE.getAndSetIntAcquire( ba, address(ba, index(ba, index)), convEndian(handle.be, value))); } @ForceInline static float getAndSetRelease(ArrayHandle handle, Object oba, int index, float value) { byte[] ba = (byte[]) oba; return convEndian(handle.be, UNSAFE.getAndSetIntRelease( ba, address(ba, index(ba, index)), convEndian(handle.be, value))); } static final VarForm FORM = new VarForm(ArrayHandle.class, byte[].class, float.class, int.class); } static final class ByteBufferHandle extends ByteArrayViewVarHandle { ByteBufferHandle(boolean be) { super(ByteBufferHandle.FORM, be); } @Override final MethodType accessModeTypeUncached(AccessMode accessMode) { return accessMode.at.accessModeType(ByteBuffer.class, float.class, int.class); } @ForceInline static int index(ByteBuffer bb, int index) { return Preconditions.checkIndex(index, UNSAFE.getInt(bb, BUFFER_LIMIT) - ALIGN, null); } @ForceInline static int indexRO(ByteBuffer bb, int index) { if (UNSAFE.getBoolean(bb, BYTE_BUFFER_IS_READ_ONLY)) throw new ReadOnlyBufferException(); return Preconditions.checkIndex(index, UNSAFE.getInt(bb, BUFFER_LIMIT) - ALIGN, null); } @ForceInline static long address(ByteBuffer bb, int index) { long address = ((long) index) + UNSAFE.getLong(bb, BUFFER_ADDRESS); if ((address & ALIGN) != 0) throw newIllegalStateExceptionForMisalignedAccess(index); return address; } @ForceInline static float get(ByteBufferHandle handle, Object obb, int index) { ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); int rawValue = UNSAFE.getIntUnaligned( UNSAFE.getObject(bb, BYTE_BUFFER_HB), ((long) index(bb, index)) + UNSAFE.getLong(bb, BUFFER_ADDRESS), handle.be); return Float.intBitsToFloat(rawValue); } @ForceInline static void set(ByteBufferHandle handle, Object obb, int index, float value) { ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); UNSAFE.putIntUnaligned( UNSAFE.getObject(bb, BYTE_BUFFER_HB), ((long) indexRO(bb, index)) + UNSAFE.getLong(bb, BUFFER_ADDRESS), Float.floatToRawIntBits(value), handle.be); } @ForceInline static float getVolatile(ByteBufferHandle handle, Object obb, int index) { ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); return convEndian(handle.be, UNSAFE.getIntVolatile( UNSAFE.getObject(bb, BYTE_BUFFER_HB), address(bb, index(bb, index)))); } @ForceInline static void setVolatile(ByteBufferHandle handle, Object obb, int index, float value) { ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); UNSAFE.putIntVolatile( UNSAFE.getObject(bb, BYTE_BUFFER_HB), address(bb, indexRO(bb, index)), convEndian(handle.be, value)); } @ForceInline static float getAcquire(ByteBufferHandle handle, Object obb, int index) { ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); return convEndian(handle.be, UNSAFE.getIntAcquire( UNSAFE.getObject(bb, BYTE_BUFFER_HB), address(bb, index(bb, index)))); } @ForceInline static void setRelease(ByteBufferHandle handle, Object obb, int index, float value) { ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); UNSAFE.putIntRelease( UNSAFE.getObject(bb, BYTE_BUFFER_HB), address(bb, indexRO(bb, index)), convEndian(handle.be, value)); } @ForceInline static float getOpaque(ByteBufferHandle handle, Object obb, int index) { ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); return convEndian(handle.be, UNSAFE.getIntOpaque( UNSAFE.getObject(bb, BYTE_BUFFER_HB), address(bb, index(bb, index)))); } @ForceInline static void setOpaque(ByteBufferHandle handle, Object obb, int index, float value) { ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); UNSAFE.putIntOpaque( UNSAFE.getObject(bb, BYTE_BUFFER_HB), address(bb, indexRO(bb, index)), convEndian(handle.be, value)); } @ForceInline static boolean compareAndSet(ByteBufferHandle handle, Object obb, int index, float expected, float value) { ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); return UNSAFE.compareAndSetInt( UNSAFE.getObject(bb, BYTE_BUFFER_HB), address(bb, indexRO(bb, index)), convEndian(handle.be, expected), convEndian(handle.be, value)); } @ForceInline static float compareAndExchange(ByteBufferHandle handle, Object obb, int index, float expected, float value) { ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); return convEndian(handle.be, UNSAFE.compareAndExchangeInt( UNSAFE.getObject(bb, BYTE_BUFFER_HB), address(bb, indexRO(bb, index)), convEndian(handle.be, expected), convEndian(handle.be, value))); } @ForceInline static float compareAndExchangeAcquire(ByteBufferHandle handle, Object obb, int index, float expected, float value) { ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); return convEndian(handle.be, UNSAFE.compareAndExchangeIntAcquire( UNSAFE.getObject(bb, BYTE_BUFFER_HB), address(bb, indexRO(bb, index)), convEndian(handle.be, expected), convEndian(handle.be, value))); } @ForceInline static float compareAndExchangeRelease(ByteBufferHandle handle, Object obb, int index, float expected, float value) { ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); return convEndian(handle.be, UNSAFE.compareAndExchangeIntRelease( UNSAFE.getObject(bb, BYTE_BUFFER_HB), address(bb, indexRO(bb, index)), convEndian(handle.be, expected), convEndian(handle.be, value))); } @ForceInline static boolean weakCompareAndSetPlain(ByteBufferHandle handle, Object obb, int index, float expected, float value) { ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); return UNSAFE.weakCompareAndSetIntPlain( UNSAFE.getObject(bb, BYTE_BUFFER_HB), address(bb, indexRO(bb, index)), convEndian(handle.be, expected), convEndian(handle.be, value)); } @ForceInline static boolean weakCompareAndSet(ByteBufferHandle handle, Object obb, int index, float expected, float value) { ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); return UNSAFE.weakCompareAndSetInt( UNSAFE.getObject(bb, BYTE_BUFFER_HB), address(bb, indexRO(bb, index)), convEndian(handle.be, expected), convEndian(handle.be, value)); } @ForceInline static boolean weakCompareAndSetAcquire(ByteBufferHandle handle, Object obb, int index, float expected, float value) { ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); return UNSAFE.weakCompareAndSetIntAcquire( UNSAFE.getObject(bb, BYTE_BUFFER_HB), address(bb, indexRO(bb, index)), convEndian(handle.be, expected), convEndian(handle.be, value)); } @ForceInline static boolean weakCompareAndSetRelease(ByteBufferHandle handle, Object obb, int index, float expected, float value) { ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); return UNSAFE.weakCompareAndSetIntRelease( UNSAFE.getObject(bb, BYTE_BUFFER_HB), address(bb, indexRO(bb, index)), convEndian(handle.be, expected), convEndian(handle.be, value)); } @ForceInline static float getAndSet(ByteBufferHandle handle, Object obb, int index, float value) { ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); return convEndian(handle.be, UNSAFE.getAndSetInt( UNSAFE.getObject(bb, BYTE_BUFFER_HB), address(bb, indexRO(bb, index)), convEndian(handle.be, value))); } @ForceInline static float getAndSetAcquire(ByteBufferHandle handle, Object obb, int index, float value) { ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); return convEndian(handle.be, UNSAFE.getAndSetIntAcquire( UNSAFE.getObject(bb, BYTE_BUFFER_HB), address(bb, indexRO(bb, index)), convEndian(handle.be, value))); } @ForceInline static float getAndSetRelease(ByteBufferHandle handle, Object obb, int index, float value) { ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); return convEndian(handle.be, UNSAFE.getAndSetIntRelease( UNSAFE.getObject(bb, BYTE_BUFFER_HB), address(bb, indexRO(bb, index)), convEndian(handle.be, value))); } static final VarForm FORM = new VarForm(ByteBufferHandle.class, ByteBuffer.class, float.class, int.class); } }
⏎ java/lang/invoke/VarHandleByteArrayAsFloats.java
Or download all of them as a single archive file:
File name: java.base-11.0.1-src.zip File size: 8740354 bytes Release date: 2018-11-04 Download
2020-05-29, 203847👍, 0💬
Popular Posts:
iText is an ideal library for developers looking to enhance web- and other applications with dynamic...
How to display XML element type information with the jaxp\TypeInfoWriter.java provided in the Apache...
How to run "javac" command from JDK tools.jar file? "javac" is the Java compiler command that allows...
JDK 11 jdk.charsets.jmod is the JMOD file for JDK 11 Charsets module. JDK 11 Charsets module compile...
Apache Ant Source Code Files are inside the Apache Ant source package file like apache-ant-1.10.10-s...