< prev index next >

src/hotspot/share/c1/c1_FrameMap.cpp

Print this page

169 
170   _argcount = method->arg_size();
171   _argument_locations = new intArray(_argcount, _argcount, -1);
172   _incoming_arguments = java_calling_convention(signature_type_array_for(method), false);
173   _oop_map_arg_count = _incoming_arguments->reserved_stack_slots();
174 
175   int java_index = 0;
176   for (int i = 0; i < _incoming_arguments->length(); i++) {
177     LIR_Opr opr = _incoming_arguments->at(i);
178     if (opr->is_address()) {
179       LIR_Address* address = opr->as_address_ptr();
180       _argument_locations->at_put(java_index, address->disp());
181       _incoming_arguments->args()->at_put(i, LIR_OprFact::stack(java_index, as_BasicType(as_ValueType(address->type()))));
182     }
183     java_index += type2size[opr->type()];
184   }
185 
186 }
187 
188 
189 bool FrameMap::finalize_frame(int nof_slots) {
190   assert(nof_slots >= 0, "must be positive");
191   assert(_num_spills == -1, "can only be set once");
192   _num_spills = nof_slots;
193   assert(_framesize == -1, "should only be calculated once");
194   _framesize =  align_up(in_bytes(sp_offset_for_monitor_base(0)) +
195                          _num_monitors * (int)sizeof(BasicObjectLock) +
196                          (int)sizeof(intptr_t) +                        // offset of deopt orig pc

197                          frame_pad_in_bytes,
198                          StackAlignmentInBytes) / 4;
199   int java_index = 0;
200   for (int i = 0; i < _incoming_arguments->length(); i++) {
201     LIR_Opr opr = _incoming_arguments->at(i);
202     if (opr->is_stack()) {
203       _argument_locations->at_put(java_index, in_bytes(framesize_in_bytes()) +
204                                   _argument_locations->at(java_index));
205     }
206     java_index += type2size[opr->type()];
207   }
208   // make sure it's expressible on the platform
209   return validate_frame();
210 }
211 
212 VMReg FrameMap::sp_offset2vmreg(ByteSize offset) const {
213   int offset_in_bytes = in_bytes(offset);
214   assert(offset_in_bytes % 4 == 0, "must be multiple of 4 bytes");
215   assert(offset_in_bytes / 4 < framesize() + oop_map_arg_count(), "out of range");
216   return VMRegImpl::stack2reg(offset_in_bytes / 4);

169 
170   _argcount = method->arg_size();
171   _argument_locations = new intArray(_argcount, _argcount, -1);
172   _incoming_arguments = java_calling_convention(signature_type_array_for(method), false);
173   _oop_map_arg_count = _incoming_arguments->reserved_stack_slots();
174 
175   int java_index = 0;
176   for (int i = 0; i < _incoming_arguments->length(); i++) {
177     LIR_Opr opr = _incoming_arguments->at(i);
178     if (opr->is_address()) {
179       LIR_Address* address = opr->as_address_ptr();
180       _argument_locations->at_put(java_index, address->disp());
181       _incoming_arguments->args()->at_put(i, LIR_OprFact::stack(java_index, as_BasicType(as_ValueType(address->type()))));
182     }
183     java_index += type2size[opr->type()];
184   }
185 
186 }
187 
188 
189 bool FrameMap::finalize_frame(int nof_slots, bool needs_stack_repair) {
190   assert(nof_slots >= 0, "must be positive");
191   assert(_num_spills == -1, "can only be set once");
192   _num_spills = nof_slots;
193   assert(_framesize == -1, "should only be calculated once");
194   _framesize =  align_up(in_bytes(sp_offset_for_monitor_base(0)) +
195                          _num_monitors * (int)sizeof(BasicObjectLock) +
196                          (int)sizeof(intptr_t) +                             // offset of deopt orig pc
197                          (needs_stack_repair ? (int)sizeof(intptr_t) : 0) +  // stack increment value
198                          frame_pad_in_bytes,
199                          StackAlignmentInBytes) / 4;
200   int java_index = 0;
201   for (int i = 0; i < _incoming_arguments->length(); i++) {
202     LIR_Opr opr = _incoming_arguments->at(i);
203     if (opr->is_stack()) {
204       _argument_locations->at_put(java_index, in_bytes(framesize_in_bytes()) +
205                                   _argument_locations->at(java_index));
206     }
207     java_index += type2size[opr->type()];
208   }
209   // make sure it's expressible on the platform
210   return validate_frame();
211 }
212 
213 VMReg FrameMap::sp_offset2vmreg(ByteSize offset) const {
214   int offset_in_bytes = in_bytes(offset);
215   assert(offset_in_bytes % 4 == 0, "must be multiple of 4 bytes");
216   assert(offset_in_bytes / 4 < framesize() + oop_map_arg_count(), "out of range");
217   return VMRegImpl::stack2reg(offset_in_bytes / 4);
< prev index next >