< prev index next >

src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/BufferLayout.java

Print this page

  7  *  published by the Free Software Foundation.  Oracle designates this
  8  *  particular file as subject to the "Classpath" exception as provided
  9  *  by Oracle in the LICENSE file that accompanied this code.
 10  *
 11  *  This code is distributed in the hope that it will be useful, but WITHOUT
 12  *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 13  *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 14  *  version 2 for more details (a copy is included in the LICENSE file that
 15  *  accompanied this code).
 16  *
 17  *  You should have received a copy of the GNU General Public License version
 18  *  2 along with this work; if not, write to the Free Software Foundation,
 19  *  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 20  *
 21  *  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 22  *  or visit www.oracle.com if you need additional information or have any
 23  *  questions.
 24  */
 25 package jdk.internal.foreign.abi;
 26 
 27 import jdk.incubator.foreign.MemoryLayouts;
 28 import jdk.incubator.foreign.MemorySegment;

 29 import jdk.internal.foreign.MemoryAddressImpl;
 30 
 31 import java.io.PrintStream;
 32 import java.lang.invoke.VarHandle;
 33 import java.util.HashMap;
 34 import java.util.Map;
 35 
 36 class BufferLayout {
 37     static final VarHandle VH_LONG = MemoryLayouts.JAVA_LONG.varHandle(long.class);
 38 
 39     final long size;
 40     final long arguments_next_pc;
 41     final long stack_args_bytes;
 42     final long stack_args;
 43 
 44     // read by JNI
 45     final long[] input_type_offsets;
 46     final long[] output_type_offsets;
 47 
 48     private final Map<jdk.internal.foreign.abi.VMStorage, Long> argOffsets;
 49     private final Map<jdk.internal.foreign.abi.VMStorage, Long> retOffsets;
 50 
 51     private BufferLayout(long size, long arguments_next_pc, long stack_args_bytes, long stack_args,
 52                          long[] input_type_offsets, long[] output_type_offsets,
 53                          Map<jdk.internal.foreign.abi.VMStorage, Long> argOffsets, Map<jdk.internal.foreign.abi.VMStorage, Long> retOffsets) {
 54         this.size = size;
 55         this.arguments_next_pc = arguments_next_pc;
 56         this.stack_args_bytes = stack_args_bytes;
 57         this.stack_args = stack_args;

  7  *  published by the Free Software Foundation.  Oracle designates this
  8  *  particular file as subject to the "Classpath" exception as provided
  9  *  by Oracle in the LICENSE file that accompanied this code.
 10  *
 11  *  This code is distributed in the hope that it will be useful, but WITHOUT
 12  *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 13  *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 14  *  version 2 for more details (a copy is included in the LICENSE file that
 15  *  accompanied this code).
 16  *
 17  *  You should have received a copy of the GNU General Public License version
 18  *  2 along with this work; if not, write to the Free Software Foundation,
 19  *  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 20  *
 21  *  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 22  *  or visit www.oracle.com if you need additional information or have any
 23  *  questions.
 24  */
 25 package jdk.internal.foreign.abi;
 26 

 27 import jdk.incubator.foreign.MemorySegment;
 28 import jdk.incubator.foreign.ValueLayout;
 29 import jdk.internal.foreign.MemoryAddressImpl;
 30 
 31 import java.io.PrintStream;
 32 import java.lang.invoke.VarHandle;
 33 import java.util.HashMap;
 34 import java.util.Map;
 35 
 36 class BufferLayout {
 37     static final VarHandle VH_LONG = ValueLayout.JAVA_LONG.varHandle();
 38 
 39     final long size;
 40     final long arguments_next_pc;
 41     final long stack_args_bytes;
 42     final long stack_args;
 43 
 44     // read by JNI
 45     final long[] input_type_offsets;
 46     final long[] output_type_offsets;
 47 
 48     private final Map<jdk.internal.foreign.abi.VMStorage, Long> argOffsets;
 49     private final Map<jdk.internal.foreign.abi.VMStorage, Long> retOffsets;
 50 
 51     private BufferLayout(long size, long arguments_next_pc, long stack_args_bytes, long stack_args,
 52                          long[] input_type_offsets, long[] output_type_offsets,
 53                          Map<jdk.internal.foreign.abi.VMStorage, Long> argOffsets, Map<jdk.internal.foreign.abi.VMStorage, Long> retOffsets) {
 54         this.size = size;
 55         this.arguments_next_pc = arguments_next_pc;
 56         this.stack_args_bytes = stack_args_bytes;
 57         this.stack_args = stack_args;
< prev index next >