Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8312522: Implementation of Foreign Function & Memory API #15103

Closed
wants to merge 65 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
cb37298
8308858: FFM API and strings
mcimadamore Jun 14, 2023
eb90646
8310048: Drop sequence layout factory with inferred count
mcimadamore Jun 14, 2023
6e2e397
8308293: A linker should expose the layouts it supports
mcimadamore Jun 19, 2023
d181366
8310362: Improve composability of handle derived from layouts
JornVernee Jun 23, 2023
201baf4
8310820: Remove MemorySegment::segmentOffset
mcimadamore Jun 26, 2023
e3d6c36
8310893: VarHandleTestExact fails
JornVernee Jun 26, 2023
3aa0e02
8311533: SegmentAllocator::allocateArray call can be ambiguous
mcimadamore Jul 12, 2023
a10c182
8312059: Clarify the documention for variadic functions
JornVernee Jul 14, 2023
e1a8192
8312186: TestStringEncodingFails for UTF-32
JornVernee Jul 17, 2023
854d26d
8312615: Ensure jdk_foreign tests pass on linux-x86
JornVernee Jul 25, 2023
d01ee34
8312981: Make the linker API required
JornVernee Jul 25, 2023
a59cdde
8313005: Ensure native access check can fold away
JornVernee Jul 25, 2023
a911f27
8313265: Move the FFM API out of preview
JornVernee Jul 28, 2023
b0a1aba
use immutable map for fallback linker canonical layouts
JornVernee Aug 1, 2023
e56cf1d
Merge branch 'master' into JEP22
JornVernee Aug 10, 2023
ff6c9ca
8313680: Disallow combining caputreCallState with isTrivial
JornVernee Aug 7, 2023
74bbe72
8313894: Rename isTrivial linker option to critical
JornVernee Aug 8, 2023
b1ea53c
make Arena::allocate abstract
JornVernee Aug 10, 2023
147e79d
enable fallback linker on linux x86 in GHA
JornVernee Aug 10, 2023
141096b
remove spurious imports
JornVernee Aug 11, 2023
5352dc0
Merge branch 'master' into JEP22
JornVernee Aug 16, 2023
fd0512f
Merge branch 'master' into JEP22
JornVernee Sep 4, 2023
efc5ef4
add test for unmodifiable canonical layouts map
JornVernee Sep 4, 2023
470fcb9
fix TestIllegalLink on x86
JornVernee Sep 4, 2023
ea3daae
remove unsupported linker test
JornVernee Sep 4, 2023
8fb5c09
Clarify javadoc w.r.t. exceptions thrown by a memory access var handle
mcimadamore Aug 18, 2023
f681a13
Clarify javadoc w.r.t. exceptions thrown by a memory access var handl…
mcimadamore Aug 21, 2023
51ffc41
Fix misc typos in FFM API javadoc
mcimadamore Sep 4, 2023
6278a01
Add missing @implSpec to AddressLayout
mcimadamore Sep 1, 2023
de3e747
8315096: Allowed access modes in memory segment should depend on layo…
mcimadamore Aug 30, 2023
5e439da
Fix typo in doc
JornVernee Sep 6, 2023
afcfa2b
Paul's review comments
JornVernee Sep 6, 2023
0d656db
Merge branch 'master' into JEP22
JornVernee Sep 6, 2023
b8bb791
PPC linker changes
JornVernee Sep 6, 2023
52df58f
remove reference to allocateArray
JornVernee Sep 6, 2023
9f7ac18
Fix javadoc issues in MemorySegment::copy
mcimadamore Sep 6, 2023
a48a77b
add name of SysV ABI
JornVernee Sep 7, 2023
5529652
Add support for sliced allocation
mcimadamore Aug 16, 2023
2f50adb
Split long throws clauses in `MemorySegment` javadoc
mcimadamore Sep 7, 2023
86a7e22
add code snippet
JornVernee Sep 7, 2023
dbf3eec
Merge branch 'master' into JEP22
JornVernee Sep 8, 2023
9de0e21
Merge branch 'master' into JEP22
JornVernee Sep 11, 2023
0e702f0
8315917: Passing struct by values seems under specified
JornVernee Sep 11, 2023
06f2aa8
Fix typo
JornVernee Sep 12, 2023
e68b95c
add missing space + reflow lines
JornVernee Sep 12, 2023
1f3248d
Avoid eager use of LibFallback in FallbackLinker static block
JornVernee Sep 18, 2023
6b24e88
8310659: The jar tool should support allowing access to restricted me…
JornVernee Jun 28, 2023
2bbce77
Merge branch 'master' into JEP22
JornVernee Sep 22, 2023
5b64181
remove unneeded benchmark flags
JornVernee Sep 22, 2023
1c24f33
review comments
JornVernee Sep 22, 2023
49bdd95
Split note about byte order/alignment out of header
JornVernee Sep 25, 2023
82a9125
Tweak support for restricted methods
mcimadamore Sep 25, 2023
0244845
fix typos
JornVernee Sep 25, 2023
e48cc96
Review comments
JornVernee Sep 27, 2023
f6ab4dc
Fix visibility issues
minborg Sep 26, 2023
a8f0a3f
Use abort instead of IEA when encountering wrong value for ENA attrib.
JornVernee Sep 27, 2023
ea1b9c5
Use IAE instead of UOE for unsupported char sets
JornVernee Sep 27, 2023
2bc0a65
drop unneeded @compile tags from jtreg tests
JornVernee Sep 27, 2023
72650c4
Merge branch 'master' into JEP22
JornVernee Sep 28, 2023
17dacbb
review @enablePreview from java/foreign/TestRestricted test
JornVernee Sep 28, 2023
cc89a51
Remove PIP annotation from jdk.incubator.vector
JornVernee Oct 2, 2023
e7dbce5
Merge branch 'master' into JEP22
JornVernee Oct 6, 2023
b4a7b7a
fix failing RestrictedMethods test
JornVernee Oct 6, 2023
35ca192
update copyright years
JornVernee Oct 10, 2023
5cf9e75
adjust misformatted copyright headers
JornVernee Oct 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@
* </ul>
*
* @implSpec
* This class is immutable, thread-safe and <a href="{@docRoot}/java.base/java/lang/doc-files/ValueBased.html">value-based</a>.
* Implementations of this interface are immutable, thread-safe and <a href="{@docRoot}/java.base/java/lang/doc-files/ValueBased.html">value-based</a>.
*
* @see #ADDRESS
* @see #ADDRESS_UNALIGNED
Original file line number Diff line number Diff line change
@@ -436,11 +436,11 @@ default MethodHandle byteOffsetHandle(PathElement... elements) {
* in which the open path elements occur in the provided layout path.
* </ul>
* <p>
* If the provided layout path {@code P} contains no dereference elements, then the offset of the access operation is
* computed as follows:
* If the provided layout path {@code P} contains no dereference elements, then the offset {@code O} of the access
* operation is computed as follows:
*
* {@snippet lang = "java":
* offset = this.offsetHandle(P).invokeExact(B, I1, I2, ... In);
* O = this.offsetHandle(P).invokeExact(B, I1, I2, ... In);
* }
* <p>
* Accessing a memory segment using the var handle returned by this method is subject to the following checks:
@@ -533,7 +533,7 @@ default VarHandle varHandle(PathElement... elements) {
* elements occur in the provided layout path.
* </ul>
* <p>
* The offset of the returned segment is computed as if by a call to a
* The offset {@code O} of the returned segment is computed as if by a call to a
* {@linkplain #byteOffsetHandle(PathElement...) byte offset handle} constructed using the given path elements.
* <p>
* Computing a slice of a memory segment using the method handle returned by this method is subject to the following checks:
Original file line number Diff line number Diff line change
@@ -26,8 +26,6 @@
package java.lang.invoke;

import jdk.internal.access.SharedSecrets;
import jdk.internal.foreign.Utils;
import jdk.internal.javac.PreviewFeature;
import jdk.internal.misc.Unsafe;
import jdk.internal.misc.VM;
import jdk.internal.org.objectweb.asm.ClassReader;
@@ -45,10 +43,6 @@
import sun.security.util.SecurityConstants;

import java.lang.constant.ConstantDescs;
import java.lang.foreign.GroupLayout;
import java.lang.foreign.MemoryLayout;
import java.lang.foreign.MemorySegment;
import java.lang.foreign.ValueLayout;
import java.lang.invoke.LambdaForm.BasicType;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
Original file line number Diff line number Diff line change
@@ -42,7 +42,6 @@ public static String read(MemorySegment segment, long offset, Charset charset) {
case SINGLE_BYTE -> readFast_byte(segment, offset, charset);
case DOUBLE_BYTE -> readFast_short(segment, offset, charset);
case QUAD_BYTE -> readFast_int(segment, offset, charset);
default -> throw new UnsupportedOperationException("Unsupported charset: " + charset);
};
}

@@ -51,7 +50,6 @@ public static void write(MemorySegment segment, long offset, Charset charset, St
case SINGLE_BYTE -> writeFast_byte(segment, offset, charset, string);
case DOUBLE_BYTE -> writeFast_short(segment, offset, charset, string);
case QUAD_BYTE -> writeFast_int(segment, offset, charset, string);
default -> throw new UnsupportedOperationException("Unsupported charset: " + charset);
}
}
private static String readFast_byte(MemorySegment segment, long offset, Charset charset) {
Original file line number Diff line number Diff line change
@@ -39,8 +39,6 @@
*
* @implSpec
* This class is immutable, thread-safe and <a href="{@docRoot}/java.base/java/lang/doc-files/ValueBased.html">value-based</a>.
*
* @since 19
*/
public sealed abstract class AbstractGroupLayout<L extends AbstractGroupLayout<L> & MemoryLayout>
extends AbstractLayout<L>