src/cpu/x86/vm/c1_Runtime1_x86.cpp

Print this page




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












  27 
  28 
  29 // Implementation of StubAssembler
  30 
  31 int StubAssembler::call_RT(Register oop_result1, Register oop_result2, address entry, int args_size) {
  32   // setup registers
  33   const Register thread = NOT_LP64(rdi) LP64_ONLY(r15_thread); // is callee-saved register (Visual C++ calling conventions)
  34   assert(!(oop_result1->is_valid() || oop_result2->is_valid()) || oop_result1 != oop_result2, "registers must be different");
  35   assert(oop_result1 != thread && oop_result2 != thread, "registers must be different");
  36   assert(args_size >= 0, "illegal args_size");
  37 
  38 #ifdef _LP64
  39   mov(c_rarg0, thread);
  40   set_num_rt_args(0); // Nothing on stack
  41 #else
  42   set_num_rt_args(1 + args_size);
  43 
  44   // push java thread (becomes first argument of C function)
  45   get_thread(thread);
  46   push(thread);




   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "c1/c1_Defs.hpp"
  27 #include "c1/c1_MacroAssembler.hpp"
  28 #include "c1/c1_Runtime1.hpp"
  29 #include "interpreter/interpreter.hpp"
  30 #include "nativeInst_x86.hpp"
  31 #include "oops/compiledICHolderOop.hpp"
  32 #include "oops/oop.inline.hpp"
  33 #include "prims/jvmtiExport.hpp"
  34 #include "register_x86.hpp"
  35 #include "runtime/sharedRuntime.hpp"
  36 #include "runtime/signature.hpp"
  37 #include "runtime/vframeArray.hpp"
  38 #include "vmreg_x86.inline.hpp"
  39 
  40 
  41 // Implementation of StubAssembler
  42 
  43 int StubAssembler::call_RT(Register oop_result1, Register oop_result2, address entry, int args_size) {
  44   // setup registers
  45   const Register thread = NOT_LP64(rdi) LP64_ONLY(r15_thread); // is callee-saved register (Visual C++ calling conventions)
  46   assert(!(oop_result1->is_valid() || oop_result2->is_valid()) || oop_result1 != oop_result2, "registers must be different");
  47   assert(oop_result1 != thread && oop_result2 != thread, "registers must be different");
  48   assert(args_size >= 0, "illegal args_size");
  49 
  50 #ifdef _LP64
  51   mov(c_rarg0, thread);
  52   set_num_rt_args(0); // Nothing on stack
  53 #else
  54   set_num_rt_args(1 + args_size);
  55 
  56   // push java thread (becomes first argument of C function)
  57   get_thread(thread);
  58   push(thread);