164
165 // deopt support
166 ByteSize sp_offset_for_orig_pc() { return sp_offset_for_monitor_base(_num_monitors); }
167
168 static LIR_Opr as_opr(Register r) {
169 return LIR_OprFact::single_cpu(cpu_reg2rnr(r));
170 }
171 static LIR_Opr as_oop_opr(Register r) {
172 return LIR_OprFact::single_cpu_oop(cpu_reg2rnr(r));
173 }
174
175 static LIR_Opr as_metadata_opr(Register r) {
176 return LIR_OprFact::single_cpu_metadata(cpu_reg2rnr(r));
177 }
178
179 static LIR_Opr as_address_opr(Register r) {
180 return LIR_OprFact::single_cpu_address(cpu_reg2rnr(r));
181 }
182
183 FrameMap(ciMethod* method, int monitors, int reserved_argument_area_size);
184 bool finalize_frame(int nof_slots);
185
186 int reserved_argument_area_size () const { return _reserved_argument_area_size; }
187 int framesize () const { assert(_framesize != -1, "hasn't been calculated"); return _framesize; }
188 ByteSize framesize_in_bytes () const { return in_ByteSize(framesize() * 4); }
189 int num_monitors () const { return _num_monitors; }
190 int num_spills () const { assert(_num_spills >= 0, "not set"); return _num_spills; }
191 int argcount () const { assert(_argcount >= 0, "not set"); return _argcount; }
192
193 int oop_map_arg_count() const { return _oop_map_arg_count; }
194
195 CallingConvention* incoming_arguments() const { return _incoming_arguments; }
196
197 // convenience routines
198 Address address_for_slot(int index, int sp_adjust = 0) const {
199 return make_new_address(sp_offset_for_slot(index) + in_ByteSize(sp_adjust));
200 }
201 Address address_for_double_slot(int index, int sp_adjust = 0) const {
202 return make_new_address(sp_offset_for_double_slot(index) + in_ByteSize(sp_adjust));
203 }
204 Address address_for_monitor_lock(int monitor_index) const {
205 return make_new_address(sp_offset_for_monitor_lock(monitor_index));
206 }
207 Address address_for_monitor_object(int monitor_index) const {
208 return make_new_address(sp_offset_for_monitor_object(monitor_index));
209 }
210
211 // Creates Location describing desired slot and returns it via pointer
212 // to Location object. Returns true if the stack frame offset was legal
213 // (as defined by Location::legal_offset_in_bytes()), false otherwise.
214 // Do not use the returned location if this returns false.
215 bool location_for_sp_offset(ByteSize byte_offset_from_sp,
216 Location::Type loc_type, Location* loc) const;
217
218 bool location_for_monitor_lock (int monitor_index, Location* loc) const {
219 return location_for_sp_offset(sp_offset_for_monitor_lock(monitor_index), Location::normal, loc);
220 }
221 bool location_for_monitor_object(int monitor_index, Location* loc) const {
222 return location_for_sp_offset(sp_offset_for_monitor_object(monitor_index), Location::oop, loc);
223 }
224 bool locations_for_slot (int index, Location::Type loc_type,
225 Location* loc, Location* second = nullptr) const;
226
227 VMReg slot_regname(int index) const {
228 return sp_offset2vmreg(sp_offset_for_slot(index));
229 }
|
164
165 // deopt support
166 ByteSize sp_offset_for_orig_pc() { return sp_offset_for_monitor_base(_num_monitors); }
167
168 static LIR_Opr as_opr(Register r) {
169 return LIR_OprFact::single_cpu(cpu_reg2rnr(r));
170 }
171 static LIR_Opr as_oop_opr(Register r) {
172 return LIR_OprFact::single_cpu_oop(cpu_reg2rnr(r));
173 }
174
175 static LIR_Opr as_metadata_opr(Register r) {
176 return LIR_OprFact::single_cpu_metadata(cpu_reg2rnr(r));
177 }
178
179 static LIR_Opr as_address_opr(Register r) {
180 return LIR_OprFact::single_cpu_address(cpu_reg2rnr(r));
181 }
182
183 FrameMap(ciMethod* method, int monitors, int reserved_argument_area_size);
184 bool finalize_frame(int nof_slots, bool needs_stack_repair);
185
186 int reserved_argument_area_size () const { return _reserved_argument_area_size; }
187 int framesize () const { assert(_framesize != -1, "hasn't been calculated"); return _framesize; }
188 ByteSize framesize_in_bytes () const { return in_ByteSize(framesize() * 4); }
189 int num_monitors () const { return _num_monitors; }
190 int num_spills () const { assert(_num_spills >= 0, "not set"); return _num_spills; }
191 int argcount () const { assert(_argcount >= 0, "not set"); return _argcount; }
192
193 int oop_map_arg_count() const { return _oop_map_arg_count; }
194
195 CallingConvention* incoming_arguments() const { return _incoming_arguments; }
196
197 // convenience routines
198 Address address_for_slot(int index, int sp_adjust = 0) const {
199 return make_new_address(sp_offset_for_slot(index) + in_ByteSize(sp_adjust));
200 }
201 Address address_for_double_slot(int index, int sp_adjust = 0) const {
202 return make_new_address(sp_offset_for_double_slot(index) + in_ByteSize(sp_adjust));
203 }
204 Address address_for_monitor_lock(int monitor_index) const {
205 return make_new_address(sp_offset_for_monitor_lock(monitor_index));
206 }
207 Address address_for_monitor_object(int monitor_index) const {
208 return make_new_address(sp_offset_for_monitor_object(monitor_index));
209 }
210 Address address_for_orig_pc_addr() const {
211 return make_new_address(sp_offset_for_monitor_base(_num_monitors));
212 }
213
214 // Creates Location describing desired slot and returns it via pointer
215 // to Location object. Returns true if the stack frame offset was legal
216 // (as defined by Location::legal_offset_in_bytes()), false otherwise.
217 // Do not use the returned location if this returns false.
218 bool location_for_sp_offset(ByteSize byte_offset_from_sp,
219 Location::Type loc_type, Location* loc) const;
220
221 bool location_for_monitor_lock (int monitor_index, Location* loc) const {
222 return location_for_sp_offset(sp_offset_for_monitor_lock(monitor_index), Location::normal, loc);
223 }
224 bool location_for_monitor_object(int monitor_index, Location* loc) const {
225 return location_for_sp_offset(sp_offset_for_monitor_object(monitor_index), Location::oop, loc);
226 }
227 bool locations_for_slot (int index, Location::Type loc_type,
228 Location* loc, Location* second = nullptr) const;
229
230 VMReg slot_regname(int index) const {
231 return sp_offset2vmreg(sp_offset_for_slot(index));
232 }
|