< prev index next >

src/share/vm/c1/c1_FrameMap.cpp

Print this page
rev 10555 : imported patch primitive arrays
rev 10556 : imported patch update dates
   1 /*
   2  * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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  *


 147 //               FrameMap
 148 //--------------------------------------------------------
 149 
 150 bool      FrameMap::_init_done = false;
 151 Register  FrameMap::_cpu_rnr2reg [FrameMap::nof_cpu_regs];
 152 int       FrameMap::_cpu_reg2rnr [FrameMap::nof_cpu_regs];
 153 
 154 
 155 FrameMap::FrameMap(ciMethod* method, int monitors, int reserved_argument_area_size) {
 156   assert(_init_done, "should already be completed");
 157 
 158   _framesize = -1;
 159   _num_spills = -1;
 160 
 161   assert(monitors >= 0, "not set");
 162   _num_monitors = monitors;
 163   assert(reserved_argument_area_size >= 0, "not set");
 164   _reserved_argument_area_size = MAX2(4, reserved_argument_area_size) * BytesPerWord;
 165 
 166   _argcount = method->arg_size();
 167   _argument_locations = new intArray(_argcount, -1);
 168   _incoming_arguments = java_calling_convention(signature_type_array_for(method), false);
 169   _oop_map_arg_count = _incoming_arguments->reserved_stack_slots();
 170 
 171   int java_index = 0;
 172   for (int i = 0; i < _incoming_arguments->length(); i++) {
 173     LIR_Opr opr = _incoming_arguments->at(i);
 174     if (opr->is_address()) {
 175       LIR_Address* address = opr->as_address_ptr();
 176       _argument_locations->at_put(java_index, address->disp() - STACK_BIAS);
 177       _incoming_arguments->args()->at_put(i, LIR_OprFact::stack(java_index, as_BasicType(as_ValueType(address->type()))));
 178     }
 179     java_index += type2size[opr->type()];
 180   }
 181 
 182 }
 183 
 184 
 185 bool FrameMap::finalize_frame(int nof_slots) {
 186   assert(nof_slots >= 0, "must be positive");
 187   assert(_num_spills == -1, "can only be set once");


   1 /*
   2  * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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  *


 147 //               FrameMap
 148 //--------------------------------------------------------
 149 
 150 bool      FrameMap::_init_done = false;
 151 Register  FrameMap::_cpu_rnr2reg [FrameMap::nof_cpu_regs];
 152 int       FrameMap::_cpu_reg2rnr [FrameMap::nof_cpu_regs];
 153 
 154 
 155 FrameMap::FrameMap(ciMethod* method, int monitors, int reserved_argument_area_size) {
 156   assert(_init_done, "should already be completed");
 157 
 158   _framesize = -1;
 159   _num_spills = -1;
 160 
 161   assert(monitors >= 0, "not set");
 162   _num_monitors = monitors;
 163   assert(reserved_argument_area_size >= 0, "not set");
 164   _reserved_argument_area_size = MAX2(4, reserved_argument_area_size) * BytesPerWord;
 165 
 166   _argcount = method->arg_size();
 167   _argument_locations = new intArray(_argcount, _argcount, -1);
 168   _incoming_arguments = java_calling_convention(signature_type_array_for(method), false);
 169   _oop_map_arg_count = _incoming_arguments->reserved_stack_slots();
 170 
 171   int java_index = 0;
 172   for (int i = 0; i < _incoming_arguments->length(); i++) {
 173     LIR_Opr opr = _incoming_arguments->at(i);
 174     if (opr->is_address()) {
 175       LIR_Address* address = opr->as_address_ptr();
 176       _argument_locations->at_put(java_index, address->disp() - STACK_BIAS);
 177       _incoming_arguments->args()->at_put(i, LIR_OprFact::stack(java_index, as_BasicType(as_ValueType(address->type()))));
 178     }
 179     java_index += type2size[opr->type()];
 180   }
 181 
 182 }
 183 
 184 
 185 bool FrameMap::finalize_frame(int nof_slots) {
 186   assert(nof_slots >= 0, "must be positive");
 187   assert(_num_spills == -1, "can only be set once");


< prev index next >