src/cpu/sparc/vm/c1_FrameMap_sparc.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_sparc.cpp.incl"



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




   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_sparc.inline.hpp"
  30 
  31 
  32 const int FrameMap::pd_c_runtime_reserved_arg_size = 7;
  33 
  34 
  35 LIR_Opr FrameMap::map_to_opr(BasicType type, VMRegPair* reg, bool outgoing) {
  36   LIR_Opr opr = LIR_OprFact::illegalOpr;
  37   VMReg r_1 = reg->first();
  38   VMReg r_2 = reg->second();
  39   if (r_1->is_stack()) {
  40     // Convert stack slot to an SP offset
  41     // The calling convention does not count the SharedRuntime::out_preserve_stack_slots() value
  42     // so we must add it in here.
  43     int st_off = (r_1->reg2stack() + SharedRuntime::out_preserve_stack_slots()) * VMRegImpl::stack_slot_size;
  44     opr = LIR_OprFact::address(new LIR_Address(SP_opr, st_off + STACK_BIAS, type));
  45   } else if (r_1->is_Register()) {
  46     Register reg = r_1->as_Register();
  47     if (outgoing) {
  48       assert(!reg->is_in(), "should be using I regs");
  49     } else {