src/cpu/x86/vm/c1_FrameMap_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_FrameMap_x86.cpp.incl"



  27 
  28 const int FrameMap::pd_c_runtime_reserved_arg_size = 0;
  29 
  30 LIR_Opr FrameMap::map_to_opr(BasicType type, VMRegPair* reg, bool) {
  31   LIR_Opr opr = LIR_OprFact::illegalOpr;
  32   VMReg r_1 = reg->first();
  33   VMReg r_2 = reg->second();
  34   if (r_1->is_stack()) {
  35     // Convert stack slot to an SP offset
  36     // The calling convention does not count the SharedRuntime::out_preserve_stack_slots() value
  37     // so we must add it in here.
  38     int st_off = (r_1->reg2stack() + SharedRuntime::out_preserve_stack_slots()) * VMRegImpl::stack_slot_size;
  39     opr = LIR_OprFact::address(new LIR_Address(rsp_opr, st_off, type));
  40   } else if (r_1->is_Register()) {
  41     Register reg = r_1->as_Register();
  42     if (r_2->is_Register() && (type == T_LONG || type == T_DOUBLE)) {
  43       Register reg2 = r_2->as_Register();
  44 #ifdef _LP64
  45       assert(reg2 == reg, "must be same register");
  46       opr = as_long_opr(reg);




   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_FrameMap.hpp"
  27 #include "c1/c1_LIR.hpp"
  28 #include "runtime/sharedRuntime.hpp"
  29 #include "vmreg_x86.inline.hpp"
  30 
  31 const int FrameMap::pd_c_runtime_reserved_arg_size = 0;
  32 
  33 LIR_Opr FrameMap::map_to_opr(BasicType type, VMRegPair* reg, bool) {
  34   LIR_Opr opr = LIR_OprFact::illegalOpr;
  35   VMReg r_1 = reg->first();
  36   VMReg r_2 = reg->second();
  37   if (r_1->is_stack()) {
  38     // Convert stack slot to an SP offset
  39     // The calling convention does not count the SharedRuntime::out_preserve_stack_slots() value
  40     // so we must add it in here.
  41     int st_off = (r_1->reg2stack() + SharedRuntime::out_preserve_stack_slots()) * VMRegImpl::stack_slot_size;
  42     opr = LIR_OprFact::address(new LIR_Address(rsp_opr, st_off, type));
  43   } else if (r_1->is_Register()) {
  44     Register reg = r_1->as_Register();
  45     if (r_2->is_Register() && (type == T_LONG || type == T_DOUBLE)) {
  46       Register reg2 = r_2->as_Register();
  47 #ifdef _LP64
  48       assert(reg2 == reg, "must be same register");
  49       opr = as_long_opr(reg);