From 749a6caff23f2eaf3f331846ffc8b2a4d7c9ddd9 Mon Sep 17 00:00:00 2001 From: Maurizio Cimadamore Date: Wed, 15 May 2024 16:46:46 +0100 Subject: [PATCH] Drop spurious changes --- .../share/classes/java/lang/foreign/MemoryLayout.java | 6 ------ .../classes/jdk/internal/foreign/layout/ValueLayouts.java | 5 +---- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/java.base/share/classes/java/lang/foreign/MemoryLayout.java b/src/java.base/share/classes/java/lang/foreign/MemoryLayout.java index 7087ec94a7bac..fab37c85f47c1 100644 --- a/src/java.base/share/classes/java/lang/foreign/MemoryLayout.java +++ b/src/java.base/share/classes/java/lang/foreign/MemoryLayout.java @@ -631,12 +631,6 @@ public sealed interface MemoryLayout * {@code A} is the size of this layout and {@code S} is the size of the * accessed memory segment. Note that the size of this layout might be bigger * than the size of the accessed layout (e.g. when accessing a struct member). - *
  • The offset of the access operation (computed as above) must fall inside - * the spatial bounds of the accessed memory segment, or an - * {@link IndexOutOfBoundsException} is thrown. This is the case when - * {@code O + A <= S}, where {@code O} is the accessed offset (computed as above), - * {@code A} is the size of the selected layout and {@code S} is the size of the - * accessed memory segment.
  • *
  • If the provided layout path has an open path element whose size is {@code S}, * its corresponding trailing {@code long} coordinate value {@code I} must be * {@code 0 <= I < S}, or an {@link IndexOutOfBoundsException} is thrown.
  • diff --git a/src/java.base/share/classes/jdk/internal/foreign/layout/ValueLayouts.java b/src/java.base/share/classes/jdk/internal/foreign/layout/ValueLayouts.java index 1098c2e9a8e4e..672a4edcf40f7 100644 --- a/src/java.base/share/classes/jdk/internal/foreign/layout/ValueLayouts.java +++ b/src/java.base/share/classes/jdk/internal/foreign/layout/ValueLayouts.java @@ -38,11 +38,8 @@ import java.lang.foreign.ValueLayout; import java.lang.invoke.VarHandle; import java.nio.ByteOrder; -import java.util.Map; import java.util.Objects; import java.util.Optional; -import java.util.concurrent.ConcurrentHashMap; -import java.util.function.Function; /** * A value layout. A value layout is used to model the memory layout associated with values of basic data types, such as integral types @@ -162,7 +159,7 @@ static boolean isValidCarrier(Class carrier) { public final VarHandle varHandle() { if (handle == null) { // this store to stable field is safe, because return value of 'makeMemoryAccessVarHandle' has stable identity - handle = Utils.makeSegmentViewVarHandle((ValueLayout) this, false); + handle = Utils.makeSegmentViewVarHandle(self(), false); } return handle; }