< prev index next >

src/hotspot/cpu/aarch64/interpreterRT_aarch64.cpp

Print this page


   1 /*
   2  * Copyright (c) 2003, 2019, 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 #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/method.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 #define __ _masm->
  40 
  41 // Implementation of SignatureHandlerGenerator
  42 Register InterpreterRuntime::SignatureHandlerGenerator::from() { return rlocals; }
  43 Register InterpreterRuntime::SignatureHandlerGenerator::to()   { return sp; }
  44 Register InterpreterRuntime::SignatureHandlerGenerator::temp() { return rscratch1; }
  45 
  46 InterpreterRuntime::SignatureHandlerGenerator::SignatureHandlerGenerator(
  47       const methodHandle& method, CodeBuffer* buffer) : NativeSignatureIterator(method) {
  48   _masm = new MacroAssembler(buffer);
  49   _num_int_args = (method->is_static() ? 1 : 0);
  50   _num_fp_args = 0;
  51   _stack_offset = 0;


 400     switch (method()->result_type()) {
 401     case T_VOID:
 402       call_format |= MacroAssembler::ret_type_void;
 403       break;
 404     case T_FLOAT:
 405       call_format |= MacroAssembler::ret_type_float;
 406       break;
 407     case T_DOUBLE:
 408       call_format |= MacroAssembler::ret_type_double;
 409       break;
 410     default:
 411       call_format |= MacroAssembler::ret_type_integral;
 412       break;
 413     }
 414 
 415     return call_format;
 416   }
 417 };
 418 
 419 
 420 JRT_ENTRY(address,
 421           InterpreterRuntime::slow_signature_handler(JavaThread* thread,
 422                                                      Method* method,
 423                                                      intptr_t* from,
 424                                                      intptr_t* to))
 425   methodHandle m(thread, (Method*)method);
 426   assert(m->is_native(), "sanity check");
 427 
 428   // handle arguments
 429   SlowSignatureHandler ssh(m, (address)from, to);
 430   ssh.iterate(UCONST64(-1));
 431 
 432   // // set the call format
 433   // method->set_call_format(ssh.get_call_format());
 434 
 435   // return result handler
 436   return Interpreter::result_handler(m->result_type());
 437 JRT_END
   1 /*
   2  * Copyright (c) 2003, 2018, 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 #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/method.hpp"
  34 #include "oops/oop.inline.hpp"
  35 #include "runtime/handles.inline.hpp"
  36 #include "runtime/icache.hpp"
  37 #include "runtime/interfaceSupport.inline.hpp"
  38 #include "runtime/signature.hpp"
  39 
  40 #define __ _masm->
  41 
  42 // Implementation of SignatureHandlerGenerator
  43 Register InterpreterRuntime::SignatureHandlerGenerator::from() { return rlocals; }
  44 Register InterpreterRuntime::SignatureHandlerGenerator::to()   { return sp; }
  45 Register InterpreterRuntime::SignatureHandlerGenerator::temp() { return rscratch1; }
  46 
  47 InterpreterRuntime::SignatureHandlerGenerator::SignatureHandlerGenerator(
  48       const methodHandle& method, CodeBuffer* buffer) : NativeSignatureIterator(method) {
  49   _masm = new MacroAssembler(buffer);
  50   _num_int_args = (method->is_static() ? 1 : 0);
  51   _num_fp_args = 0;
  52   _stack_offset = 0;


 401     switch (method()->result_type()) {
 402     case T_VOID:
 403       call_format |= MacroAssembler::ret_type_void;
 404       break;
 405     case T_FLOAT:
 406       call_format |= MacroAssembler::ret_type_float;
 407       break;
 408     case T_DOUBLE:
 409       call_format |= MacroAssembler::ret_type_double;
 410       break;
 411     default:
 412       call_format |= MacroAssembler::ret_type_integral;
 413       break;
 414     }
 415 
 416     return call_format;
 417   }
 418 };
 419 
 420 
 421 IRT_ENTRY(address,
 422           InterpreterRuntime::slow_signature_handler(JavaThread* thread,
 423                                                      Method* method,
 424                                                      intptr_t* from,
 425                                                      intptr_t* to))
 426   methodHandle m(thread, (Method*)method);
 427   assert(m->is_native(), "sanity check");
 428 
 429   // handle arguments
 430   SlowSignatureHandler ssh(m, (address)from, to);
 431   ssh.iterate(UCONST64(-1));
 432 
 433   // // set the call format
 434   // method->set_call_format(ssh.get_call_format());
 435 
 436   // return result handler
 437   return Interpreter::result_handler(m->result_type());
 438 IRT_END
< prev index next >