< prev index next >

src/hotspot/share/c1/c1_FrameMap.cpp

Print this page

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

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);

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