< prev index next >

src/hotspot/cpu/aarch64/jniTypes_aarch64.hpp

Print this page


   1 /*
   2  * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright (c) 2014, Red Hat Inc. All rights reserved.
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 #ifndef CPU_AARCH64_VM_JNITYPES_AARCH64_HPP
  27 #define CPU_AARCH64_VM_JNITYPES_AARCH64_HPP
  28 

  29 #include "memory/allocation.hpp"
  30 #include "oops/oop.hpp"
  31 #include "prims/jni.h"
  32 
  33 // This file holds platform-dependent routines used to write primitive jni
  34 // types to the array of arguments passed into JavaCalls::call
  35 
  36 class JNITypes : AllStatic {
  37   // These functions write a java primitive type (in native format)
  38   // to a java stack slot array to be passed as an argument to JavaCalls:calls.
  39   // I.e., they are functionally 'push' operations if they have a 'pos'
  40   // formal parameter.  Note that jlong's and jdouble's are written
  41   // _in reverse_ of the order in which they appear in the interpreter
  42   // stack.  This is because call stubs (see stubGenerator_sparc.cpp)
  43   // reverse the argument list constructed by JavaCallArguments (see
  44   // javaCalls.hpp).
  45 
  46 public:
  47   // Ints are stored in native format in one JavaCallArgument slot at *to.
  48   static inline void    put_int(jint  from, intptr_t *to)           { *(jint *)(to +   0  ) =  from; }
  49   static inline void    put_int(jint  from, intptr_t *to, int& pos) { *(jint *)(to + pos++) =  from; }
  50   static inline void    put_int(jint *from, intptr_t *to, int& pos) { *(jint *)(to + pos++) = *from; }
  51 


   1 /*
   2  * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright (c) 2014, Red Hat Inc. All rights reserved.
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 #ifndef CPU_AARCH64_VM_JNITYPES_AARCH64_HPP
  27 #define CPU_AARCH64_VM_JNITYPES_AARCH64_HPP
  28 
  29 #include "jni.h"
  30 #include "memory/allocation.hpp"
  31 #include "oops/oop.hpp"

  32 
  33 // This file holds platform-dependent routines used to write primitive jni
  34 // types to the array of arguments passed into JavaCalls::call
  35 
  36 class JNITypes : AllStatic {
  37   // These functions write a java primitive type (in native format)
  38   // to a java stack slot array to be passed as an argument to JavaCalls:calls.
  39   // I.e., they are functionally 'push' operations if they have a 'pos'
  40   // formal parameter.  Note that jlong's and jdouble's are written
  41   // _in reverse_ of the order in which they appear in the interpreter
  42   // stack.  This is because call stubs (see stubGenerator_sparc.cpp)
  43   // reverse the argument list constructed by JavaCallArguments (see
  44   // javaCalls.hpp).
  45 
  46 public:
  47   // Ints are stored in native format in one JavaCallArgument slot at *to.
  48   static inline void    put_int(jint  from, intptr_t *to)           { *(jint *)(to +   0  ) =  from; }
  49   static inline void    put_int(jint  from, intptr_t *to, int& pos) { *(jint *)(to + pos++) =  from; }
  50   static inline void    put_int(jint *from, intptr_t *to, int& pos) { *(jint *)(to + pos++) = *from; }
  51 


< prev index next >