< prev index next >

src/hotspot/cpu/s390/interpreterRT_s390.cpp

Print this page


   1 /*
   2  * Copyright (c) 2016, 2019, 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 #include "precompiled.hpp"
  27 #include "asm/macroAssembler.inline.hpp"
  28 #include "interpreter/interp_masm.hpp"
  29 #include "interpreter/interpreter.hpp"
  30 #include "interpreter/interpreterRuntime.hpp"
  31 #include "memory/allocation.inline.hpp"

  32 #include "oops/oop.inline.hpp"
  33 #include "runtime/handles.inline.hpp"
  34 #include "runtime/icache.hpp"
  35 #include "runtime/interfaceSupport.inline.hpp"
  36 #include "runtime/signature.hpp"
  37 
  38 // Access macros for Java and C arguments.
  39 // First Java argument is at index-1.
  40 #define locals_j_arg_at(index) Address(Z_R1/*locals*/, in_ByteSize((-(index)*wordSize)))
  41 
  42 #define __ _masm->
  43 
  44 static int sp_c_int_arg_offset(int arg_nr, int fp_arg_nr) {
  45   int int_arg_nr = arg_nr-fp_arg_nr;
  46 
  47   // arg_nr, fp_arg_nr start with 1 => int_arg_nr starts with 0
  48   if (int_arg_nr < 5) {
  49     return int_arg_nr * wordSize + _z_abi(carg_1);
  50   }
  51   int offset = int_arg_nr - 5 + (fp_arg_nr > 4 ? fp_arg_nr - 4 : 0);


 133   }
 134 }
 135 
 136 
 137 void InterpreterRuntime::SignatureHandlerGenerator::generate(uint64_t fingerprint) {
 138   __ z_lgr(Z_R1, Z_ARG1); // Z_R1 is used in locals_j_arg_at(index) macro.
 139 
 140   // Generate code to handle arguments.
 141   iterate(fingerprint);
 142   __ load_const_optimized(Z_RET, AbstractInterpreter::result_handler(method()->result_type()));
 143   __ z_br(Z_R14);
 144   __ flush();
 145 }
 146 
 147 #undef  __
 148 
 149 // Implementation of SignatureHandlerLibrary
 150 
 151 void SignatureHandlerLibrary::pd_set_handler(address handler) {}
 152 
 153 JRT_ENTRY(address, InterpreterRuntime::get_signature(JavaThread* thread, Method* method))
 154   methodHandle m(thread, method);
 155   assert(m->is_native(), "sanity check");
 156   Symbol *s = m->signature();
 157   return (address) s->base();
 158 JRT_END
 159 
 160 JRT_ENTRY(address, InterpreterRuntime::get_result_handler(JavaThread* thread, Method* method))
 161   methodHandle m(thread, method);
 162   assert(m->is_native(), "sanity check");
 163   return AbstractInterpreter::result_handler(m->result_type());
 164 JRT_END
   1 /*
   2  * Copyright (c) 2016, 2018, 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 #include "precompiled.hpp"
  27 #include "asm/macroAssembler.inline.hpp"
  28 #include "interpreter/interp_masm.hpp"
  29 #include "interpreter/interpreter.hpp"
  30 #include "interpreter/interpreterRuntime.hpp"
  31 #include "memory/allocation.inline.hpp"
  32 #include "memory/universe.hpp"
  33 #include "oops/oop.inline.hpp"
  34 #include "runtime/handles.inline.hpp"
  35 #include "runtime/icache.hpp"
  36 #include "runtime/interfaceSupport.inline.hpp"
  37 #include "runtime/signature.hpp"
  38 
  39 // Access macros for Java and C arguments.
  40 // First Java argument is at index-1.
  41 #define locals_j_arg_at(index) Address(Z_R1/*locals*/, in_ByteSize((-(index)*wordSize)))
  42 
  43 #define __ _masm->
  44 
  45 static int sp_c_int_arg_offset(int arg_nr, int fp_arg_nr) {
  46   int int_arg_nr = arg_nr-fp_arg_nr;
  47 
  48   // arg_nr, fp_arg_nr start with 1 => int_arg_nr starts with 0
  49   if (int_arg_nr < 5) {
  50     return int_arg_nr * wordSize + _z_abi(carg_1);
  51   }
  52   int offset = int_arg_nr - 5 + (fp_arg_nr > 4 ? fp_arg_nr - 4 : 0);


 134   }
 135 }
 136 
 137 
 138 void InterpreterRuntime::SignatureHandlerGenerator::generate(uint64_t fingerprint) {
 139   __ z_lgr(Z_R1, Z_ARG1); // Z_R1 is used in locals_j_arg_at(index) macro.
 140 
 141   // Generate code to handle arguments.
 142   iterate(fingerprint);
 143   __ load_const_optimized(Z_RET, AbstractInterpreter::result_handler(method()->result_type()));
 144   __ z_br(Z_R14);
 145   __ flush();
 146 }
 147 
 148 #undef  __
 149 
 150 // Implementation of SignatureHandlerLibrary
 151 
 152 void SignatureHandlerLibrary::pd_set_handler(address handler) {}
 153 
 154 IRT_ENTRY(address, InterpreterRuntime::get_signature(JavaThread* thread, Method* method))
 155   methodHandle m(thread, method);
 156   assert(m->is_native(), "sanity check");
 157   Symbol *s = m->signature();
 158   return (address) s->base();
 159 IRT_END
 160 
 161 IRT_ENTRY(address, InterpreterRuntime::get_result_handler(JavaThread* thread, Method* method))
 162   methodHandle m(thread, method);
 163   assert(m->is_native(), "sanity check");
 164   return AbstractInterpreter::result_handler(m->result_type());
 165 IRT_END
< prev index next >