185 bool FrameMap::finalize_frame(int nof_slots) { |
185 bool FrameMap::finalize_frame(int nof_slots) { |
186 assert(nof_slots >= 0, "must be positive"); |
186 assert(nof_slots >= 0, "must be positive"); |
187 assert(_num_spills == -1, "can only be set once"); |
187 assert(_num_spills == -1, "can only be set once"); |
188 _num_spills = nof_slots; |
188 _num_spills = nof_slots; |
189 assert(_framesize == -1, "should only be calculated once"); |
189 assert(_framesize == -1, "should only be calculated once"); |
190 _framesize = round_to(in_bytes(sp_offset_for_monitor_base(0)) + |
190 _framesize = align_up(in_bytes(sp_offset_for_monitor_base(0)) + |
191 _num_monitors * sizeof(BasicObjectLock) + |
191 _num_monitors * (int)sizeof(BasicObjectLock) + |
192 sizeof(intptr_t) + // offset of deopt orig pc |
192 (int)sizeof(intptr_t) + // offset of deopt orig pc |
193 frame_pad_in_bytes, |
193 frame_pad_in_bytes, |
194 StackAlignmentInBytes) / 4; |
194 StackAlignmentInBytes) / 4; |
195 int java_index = 0; |
195 int java_index = 0; |
196 for (int i = 0; i < _incoming_arguments->length(); i++) { |
196 for (int i = 0; i < _incoming_arguments->length(); i++) { |
197 LIR_Opr opr = _incoming_arguments->at(i); |
197 LIR_Opr opr = _incoming_arguments->at(i); |
268 } |
268 } |
269 |
269 |
270 |
270 |
271 ByteSize FrameMap::sp_offset_for_spill(const int index) const { |
271 ByteSize FrameMap::sp_offset_for_spill(const int index) const { |
272 assert(index >= 0 && index < _num_spills, "out of range"); |
272 assert(index >= 0 && index < _num_spills, "out of range"); |
273 int offset = round_to(first_available_sp_in_frame + _reserved_argument_area_size, sizeof(double)) + |
273 int offset = align_up(first_available_sp_in_frame + _reserved_argument_area_size, (int)sizeof(double)) + |
274 index * spill_slot_size_in_bytes; |
274 index * spill_slot_size_in_bytes; |
275 return in_ByteSize(offset); |
275 return in_ByteSize(offset); |
276 } |
276 } |
277 |
277 |
278 ByteSize FrameMap::sp_offset_for_monitor_base(const int index) const { |
278 ByteSize FrameMap::sp_offset_for_monitor_base(const int index) const { |
279 int end_of_spills = round_to(first_available_sp_in_frame + _reserved_argument_area_size, sizeof(double)) + |
279 int end_of_spills = align_up(first_available_sp_in_frame + _reserved_argument_area_size, (int)sizeof(double)) + |
280 _num_spills * spill_slot_size_in_bytes; |
280 _num_spills * spill_slot_size_in_bytes; |
281 int offset = (int) round_to(end_of_spills, HeapWordSize) + index * sizeof(BasicObjectLock); |
281 int offset = align_up(end_of_spills, HeapWordSize) + index * (int)sizeof(BasicObjectLock); |
282 return in_ByteSize(offset); |
282 return in_ByteSize(offset); |
283 } |
283 } |
284 |
284 |
285 ByteSize FrameMap::sp_offset_for_monitor_lock(int index) const { |
285 ByteSize FrameMap::sp_offset_for_monitor_lock(int index) const { |
286 check_monitor_index(index); |
286 check_monitor_index(index); |