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 17 jdk.incubator.foreign.jmod - JDK Incubator Foreign
JDK 17 jdk.incubator.foreign.jmod is the JMOD file for JDK 17 HTTP Server module.
JDK 17 Incubator Foreign module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\jdk.incubator.foreign.jmod.
JDK 17 Incubator Foreign module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 Incubator Foreign module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\jdk.incubator.foreign.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/internal/foreign/abi/aarch64/macos/MacOsAArch64VaList.java
/* * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021, Arm Limited. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package jdk.internal.foreign.abi.aarch64.macos; import jdk.incubator.foreign.*; import jdk.incubator.foreign.CLinker.VaList; import jdk.internal.foreign.ResourceScopeImpl; import jdk.internal.foreign.abi.SharedUtils; import jdk.internal.foreign.abi.SharedUtils.SimpleVaArg; import jdk.internal.foreign.abi.aarch64.*; import java.lang.invoke.VarHandle; import java.util.ArrayList; import java.util.List; import java.util.Objects; import static jdk.internal.foreign.PlatformLayouts.AArch64.C_POINTER; import static jdk.internal.foreign.abi.SharedUtils.alignUp; /** * Simplified va_list implementation used on macOS where all variadic * parameters are passed on the stack and the type of va_list decays to * char* instead of the structure defined in the AAPCS. */ public non-sealed class MacOsAArch64VaList implements VaList { public static final Class<?> CARRIER = MemoryAddress.class; private static final long VA_SLOT_SIZE_BYTES = 8; private static final VarHandle VH_address = MemoryHandles.asAddressVarHandle(C_POINTER.varHandle(long.class)); private static final VaList EMPTY = new SharedUtils.EmptyVaList(MemoryAddress.NULL); private MemorySegment segment; private final ResourceScope scope; private MacOsAArch64VaList(MemorySegment segment, ResourceScope scope) { this.segment = segment; this.scope = scope; } public static final VaList empty() { return EMPTY; } @Override public int vargAsInt(MemoryLayout layout) { return (int) read(int.class, layout); } @Override public long vargAsLong(MemoryLayout layout) { return (long) read(long.class, layout); } @Override public double vargAsDouble(MemoryLayout layout) { return (double) read(double.class, layout); } @Override public MemoryAddress vargAsAddress(MemoryLayout layout) { return (MemoryAddress) read(MemoryAddress.class, layout); } @Override public MemorySegment vargAsSegment(MemoryLayout layout, SegmentAllocator allocator) { Objects.requireNonNull(allocator); return (MemorySegment) read(MemorySegment.class, layout, allocator); } @Override public MemorySegment vargAsSegment(MemoryLayout layout, ResourceScope scope) { return vargAsSegment(layout, SegmentAllocator.ofScope(scope)); } private Object read(Class<?> carrier, MemoryLayout layout) { return read(carrier, layout, SharedUtils.THROWING_ALLOCATOR); } private Object read(Class<?> carrier, MemoryLayout layout, SegmentAllocator allocator) { Objects.requireNonNull(layout); SharedUtils.checkCompatibleType(carrier, layout, MacOsAArch64Linker.ADDRESS_SIZE); Object res; if (carrier == MemorySegment.class) { TypeClass typeClass = TypeClass.classifyLayout(layout); res = switch (typeClass) { case STRUCT_REFERENCE -> { MemoryAddress structAddr = (MemoryAddress) VH_address.get(segment); MemorySegment struct = structAddr.asSegment(layout.byteSize(), scope()); MemorySegment seg = allocator.allocate(layout); seg.copyFrom(struct); segment = segment.asSlice(VA_SLOT_SIZE_BYTES); yield seg; } case STRUCT_REGISTER, STRUCT_HFA -> { MemorySegment struct = allocator.allocate(layout); struct.copyFrom(segment.asSlice(0L, layout.byteSize())); segment = segment.asSlice(alignUp(layout.byteSize(), VA_SLOT_SIZE_BYTES)); yield struct; } default -> throw new IllegalStateException("Unexpected TypeClass: " + typeClass); }; } else { VarHandle reader = SharedUtils.vhPrimitiveOrAddress(carrier, layout); res = reader.get(segment); segment = segment.asSlice(VA_SLOT_SIZE_BYTES); } return res; } @Override public void skip(MemoryLayout... layouts) { Objects.requireNonNull(layouts); for (MemoryLayout layout : layouts) { Objects.requireNonNull(layout); segment = segment.asSlice(switch (TypeClass.classifyLayout(layout)) { case STRUCT_REGISTER, STRUCT_HFA -> alignUp(layout.byteSize(), VA_SLOT_SIZE_BYTES); default -> VA_SLOT_SIZE_BYTES; }); } } static MacOsAArch64VaList ofAddress(MemoryAddress addr, ResourceScope scope) { MemorySegment segment = addr.asSegment(Long.MAX_VALUE, scope); return new MacOsAArch64VaList(segment, scope); } static Builder builder(ResourceScope scope) { return new Builder(scope); } @Override public ResourceScope scope() { return scope; } @Override public VaList copy() { ((ResourceScopeImpl)scope).checkValidStateSlow(); return new MacOsAArch64VaList(segment, scope); } @Override public MemoryAddress address() { return segment.address(); } public static non-sealed class Builder implements VaList.Builder { private final ResourceScope scope; private final List<SimpleVaArg> args = new ArrayList<>(); public Builder(ResourceScope scope) { ((ResourceScopeImpl)scope).checkValidStateSlow(); this.scope = scope; } private Builder arg(Class<?> carrier, MemoryLayout layout, Object value) { Objects.requireNonNull(layout); Objects.requireNonNull(value); SharedUtils.checkCompatibleType(carrier, layout, MacOsAArch64Linker.ADDRESS_SIZE); args.add(new SimpleVaArg(carrier, layout, value)); return this; } @Override public Builder vargFromInt(ValueLayout layout, int value) { return arg(int.class, layout, value); } @Override public Builder vargFromLong(ValueLayout layout, long value) { return arg(long.class, layout, value); } @Override public Builder vargFromDouble(ValueLayout layout, double value) { return arg(double.class, layout, value); } @Override public Builder vargFromAddress(ValueLayout layout, Addressable value) { return arg(MemoryAddress.class, layout, value.address()); } @Override public Builder vargFromSegment(GroupLayout layout, MemorySegment value) { return arg(MemorySegment.class, layout, value); } public VaList build() { if (args.isEmpty()) { return EMPTY; } SegmentAllocator allocator = SegmentAllocator.arenaAllocator(scope); // Each argument may occupy up to four slots MemorySegment segment = allocator.allocate(VA_SLOT_SIZE_BYTES * args.size() * 4); List<MemorySegment> attachedSegments = new ArrayList<>(); attachedSegments.add(segment); MemorySegment cursor = segment; for (SimpleVaArg arg : args) { if (arg.carrier == MemorySegment.class) { MemorySegment msArg = ((MemorySegment) arg.value); TypeClass typeClass = TypeClass.classifyLayout(arg.layout); switch (typeClass) { case STRUCT_REFERENCE -> { MemorySegment copy = allocator.allocate(arg.layout); copy.copyFrom(msArg); // by-value attachedSegments.add(copy); VH_address.set(cursor, copy.address()); cursor = cursor.asSlice(VA_SLOT_SIZE_BYTES); } case STRUCT_REGISTER, STRUCT_HFA -> { cursor.copyFrom(msArg.asSlice(0, arg.layout.byteSize())); cursor = cursor.asSlice(alignUp(arg.layout.byteSize(), VA_SLOT_SIZE_BYTES)); } default -> throw new IllegalStateException("Unexpected TypeClass: " + typeClass); } } else { VarHandle writer = arg.varHandle(); writer.set(cursor, arg.value); cursor = cursor.asSlice(VA_SLOT_SIZE_BYTES); } } return new MacOsAArch64VaList(segment, scope); } } }
⏎ jdk/internal/foreign/abi/aarch64/macos/MacOsAArch64VaList.java
Or download all of them as a single archive file:
File name: jdk.incubator.foreign-17.0.5-src.zip File size: 168767 bytes Release date: 2022-09-13 Download
⇒ JDK 17 jdk.incubator.vector.jmod - JDK Incubator Vector
2023-10-04, 3876👍, 0💬
Popular Posts:
What Is poi-3.5.jar - Part 2? poi-3.5.jar is one of the JAR files for Apache POI 3.5, which provides...
JDK 11 jdk.charsets.jmod is the JMOD file for JDK 11 Charsets module. JDK 11 Charsets module compile...
How to download and install JDK (Java Development Kit) 5? If you want to write Java applications, yo...
JSP(tm) Standard Tag Library 1.0 implementation - Jakarta Taglibs hosts the Standard Taglib 1.0, an ...
How to download and install Apache XMLBeans-2.6.0.zip? If you want to try the XMLBeans Java library,...