< prev index next >

src/hotspot/cpu/s390/jniTypes_s390.hpp

Print this page


   1 /*
   2  * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright (c) 2016 SAP SE. 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_S390_VM_JNITYPES_S390_HPP
  27 #define CPU_S390_VM_JNITYPES_S390_HPP
  28 
  29 // This file holds platform-dependent routines used to write primitive
  30 // jni types to the array of arguments passed into JavaCalls::call.
  31 

  32 #include "memory/allocation.hpp"
  33 #include "oops/oop.hpp"
  34 #include "prims/jni.h"
  35 
  36 class JNITypes : AllStatic {
  37   // These functions write a java primitive type (in native format) to
  38   // a java stack slot array to be passed as an argument to
  39   // JavaCalls:calls. I.e., they are functionally 'push' operations
  40   // if they have a 'pos' formal parameter. Note that jlongs and
  41   // jdoubles are written _in reverse_ of the order in which they
  42   // appear in the interpreter stack. This is because call stubs (see
  43   // stubGenerator_s390.cpp) reverse the argument list constructed by
  44   // JavaCallArguments (see 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) {
  49     *(jint*) to = from;
  50   }
  51 
  52   static inline void put_int(jint  from, intptr_t *to, int& pos) {
  53     *(jint*) (to + pos++) = from;
  54   }


   1 /*
   2  * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright (c) 2016 SAP SE. 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_S390_VM_JNITYPES_S390_HPP
  27 #define CPU_S390_VM_JNITYPES_S390_HPP
  28 
  29 // This file holds platform-dependent routines used to write primitive
  30 // jni types to the array of arguments passed into JavaCalls::call.
  31 
  32 #include "jni.h"
  33 #include "memory/allocation.hpp"
  34 #include "oops/oop.hpp"

  35 
  36 class JNITypes : AllStatic {
  37   // These functions write a java primitive type (in native format) to
  38   // a java stack slot array to be passed as an argument to
  39   // JavaCalls:calls. I.e., they are functionally 'push' operations
  40   // if they have a 'pos' formal parameter. Note that jlongs and
  41   // jdoubles are written _in reverse_ of the order in which they
  42   // appear in the interpreter stack. This is because call stubs (see
  43   // stubGenerator_s390.cpp) reverse the argument list constructed by
  44   // JavaCallArguments (see 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) {
  49     *(jint*) to = from;
  50   }
  51 
  52   static inline void put_int(jint  from, intptr_t *to, int& pos) {
  53     *(jint*) (to + pos++) = from;
  54   }


< prev index next >