< prev index next >

src/hotspot/share/c1/c1_FrameMap.hpp

Print this page

124 
125   void update_reserved_argument_area_size (int size) {
126     assert(size >= 0, "check");
127     _reserved_argument_area_size = MAX2(_reserved_argument_area_size, size);
128   }
129 
130  protected:
131 #ifndef PRODUCT
132   static void cpu_range_check (int rnr)          { assert(0 <= rnr && rnr < nof_cpu_regs, "cpu register number is too big"); }
133   static void fpu_range_check (int rnr)          { assert(0 <= rnr && rnr < nof_fpu_regs, "fpu register number is too big"); }
134 #endif
135 
136 
137   ByteSize sp_offset_for_monitor_base(const int idx) const;
138 
139   Address make_new_address(ByteSize sp_offset) const;
140 
141   ByteSize sp_offset_for_slot(const int idx) const;
142   ByteSize sp_offset_for_double_slot(const int idx) const;
143   ByteSize sp_offset_for_spill(const int idx) const;
144   ByteSize sp_offset_for_monitor_lock(int monitor_index) const;
145   ByteSize sp_offset_for_monitor_object(int monitor_index) const;
146 
147   VMReg sp_offset2vmreg(ByteSize offset) const;
148 
149   // platform dependent hook used to check that frame is properly
150   // addressable on the platform.  Used by arm, ppc to verify that all
151   // stack addresses are valid.
152   bool validate_frame();
153 
154   static LIR_Opr map_to_opr(BasicType type, VMRegPair* reg, bool incoming);
155 
156  public:
157   // Opr representing the stack_pointer on this platform
158   static LIR_Opr stack_pointer();
159 
160   // JSR 292
161   static LIR_Opr method_handle_invoke_SP_save_opr();
162 
163   static BasicTypeArray*     signature_type_array_for(const ciMethod* method);
164 

189   bool finalize_frame(int nof_slots);
190 
191   int   reserved_argument_area_size () const     { return _reserved_argument_area_size; }
192   int   framesize                   () const     { assert(_framesize != -1, "hasn't been calculated"); return _framesize; }
193   ByteSize framesize_in_bytes       () const     { return in_ByteSize(framesize() * 4); }
194   int   num_monitors                () const     { return _num_monitors; }
195   int   num_spills                  () const     { assert(_num_spills >= 0, "not set"); return _num_spills; }
196   int   argcount              () const     { assert(_argcount >= 0, "not set"); return _argcount; }
197 
198   int oop_map_arg_count() const { return _oop_map_arg_count; }
199 
200   CallingConvention* incoming_arguments() const  { return _incoming_arguments; }
201 
202   // convenience routines
203   Address address_for_slot(int index, int sp_adjust = 0) const {
204     return make_new_address(sp_offset_for_slot(index) + in_ByteSize(sp_adjust));
205   }
206   Address address_for_double_slot(int index, int sp_adjust = 0) const {
207     return make_new_address(sp_offset_for_double_slot(index) + in_ByteSize(sp_adjust));
208   }
209   Address address_for_monitor_lock(int monitor_index) const {
210     return make_new_address(sp_offset_for_monitor_lock(monitor_index));
211   }
212   Address address_for_monitor_object(int monitor_index) const {
213     return make_new_address(sp_offset_for_monitor_object(monitor_index));
214   }
215 
216   // Creates Location describing desired slot and returns it via pointer
217   // to Location object. Returns true if the stack frame offset was legal
218   // (as defined by Location::legal_offset_in_bytes()), false otherwise.
219   // Do not use the returned location if this returns false.
220   bool location_for_sp_offset(ByteSize byte_offset_from_sp,
221                               Location::Type loc_type, Location* loc) const;
222 
223   bool location_for_monitor_lock  (int monitor_index, Location* loc) const {
224     return location_for_sp_offset(sp_offset_for_monitor_lock(monitor_index), Location::normal, loc);
225   }
226   bool location_for_monitor_object(int monitor_index, Location* loc) const {
227     return location_for_sp_offset(sp_offset_for_monitor_object(monitor_index), Location::oop, loc);
228   }
229   bool locations_for_slot  (int index, Location::Type loc_type,
230                             Location* loc, Location* second = NULL) const;
231 
232   VMReg slot_regname(int index) const {
233     return sp_offset2vmreg(sp_offset_for_slot(index));
234   }
235   VMReg monitor_object_regname(int monitor_index) const {
236     return sp_offset2vmreg(sp_offset_for_monitor_object(monitor_index));
237   }
238   VMReg regname(LIR_Opr opr) const;
239 
240   static LIR_Opr caller_save_cpu_reg_at(int i) {
241     assert(i >= 0 && i < max_nof_caller_save_cpu_regs, "out of bounds");
242     return _caller_save_cpu_regs[i];
243   }
244 
245   static LIR_Opr caller_save_fpu_reg_at(int i) {

124 
125   void update_reserved_argument_area_size (int size) {
126     assert(size >= 0, "check");
127     _reserved_argument_area_size = MAX2(_reserved_argument_area_size, size);
128   }
129 
130  protected:
131 #ifndef PRODUCT
132   static void cpu_range_check (int rnr)          { assert(0 <= rnr && rnr < nof_cpu_regs, "cpu register number is too big"); }
133   static void fpu_range_check (int rnr)          { assert(0 <= rnr && rnr < nof_fpu_regs, "fpu register number is too big"); }
134 #endif
135 
136 
137   ByteSize sp_offset_for_monitor_base(const int idx) const;
138 
139   Address make_new_address(ByteSize sp_offset) const;
140 
141   ByteSize sp_offset_for_slot(const int idx) const;
142   ByteSize sp_offset_for_double_slot(const int idx) const;
143   ByteSize sp_offset_for_spill(const int idx) const;

144   ByteSize sp_offset_for_monitor_object(int monitor_index) const;
145 
146   VMReg sp_offset2vmreg(ByteSize offset) const;
147 
148   // platform dependent hook used to check that frame is properly
149   // addressable on the platform.  Used by arm, ppc to verify that all
150   // stack addresses are valid.
151   bool validate_frame();
152 
153   static LIR_Opr map_to_opr(BasicType type, VMRegPair* reg, bool incoming);
154 
155  public:
156   // Opr representing the stack_pointer on this platform
157   static LIR_Opr stack_pointer();
158 
159   // JSR 292
160   static LIR_Opr method_handle_invoke_SP_save_opr();
161 
162   static BasicTypeArray*     signature_type_array_for(const ciMethod* method);
163 

188   bool finalize_frame(int nof_slots);
189 
190   int   reserved_argument_area_size () const     { return _reserved_argument_area_size; }
191   int   framesize                   () const     { assert(_framesize != -1, "hasn't been calculated"); return _framesize; }
192   ByteSize framesize_in_bytes       () const     { return in_ByteSize(framesize() * 4); }
193   int   num_monitors                () const     { return _num_monitors; }
194   int   num_spills                  () const     { assert(_num_spills >= 0, "not set"); return _num_spills; }
195   int   argcount              () const     { assert(_argcount >= 0, "not set"); return _argcount; }
196 
197   int oop_map_arg_count() const { return _oop_map_arg_count; }
198 
199   CallingConvention* incoming_arguments() const  { return _incoming_arguments; }
200 
201   // convenience routines
202   Address address_for_slot(int index, int sp_adjust = 0) const {
203     return make_new_address(sp_offset_for_slot(index) + in_ByteSize(sp_adjust));
204   }
205   Address address_for_double_slot(int index, int sp_adjust = 0) const {
206     return make_new_address(sp_offset_for_double_slot(index) + in_ByteSize(sp_adjust));
207   }



208   Address address_for_monitor_object(int monitor_index) const {
209     return make_new_address(sp_offset_for_monitor_object(monitor_index));
210   }
211 
212   // Creates Location describing desired slot and returns it via pointer
213   // to Location object. Returns true if the stack frame offset was legal
214   // (as defined by Location::legal_offset_in_bytes()), false otherwise.
215   // Do not use the returned location if this returns false.
216   bool location_for_sp_offset(ByteSize byte_offset_from_sp,
217                               Location::Type loc_type, Location* loc) const;
218 



219   bool location_for_monitor_object(int monitor_index, Location* loc) const {
220     return location_for_sp_offset(sp_offset_for_monitor_object(monitor_index), Location::oop, loc);
221   }
222   bool locations_for_slot  (int index, Location::Type loc_type,
223                             Location* loc, Location* second = NULL) const;
224 
225   VMReg slot_regname(int index) const {
226     return sp_offset2vmreg(sp_offset_for_slot(index));
227   }
228   VMReg monitor_object_regname(int monitor_index) const {
229     return sp_offset2vmreg(sp_offset_for_monitor_object(monitor_index));
230   }
231   VMReg regname(LIR_Opr opr) const;
232 
233   static LIR_Opr caller_save_cpu_reg_at(int i) {
234     assert(i >= 0 && i < max_nof_caller_save_cpu_regs, "out of bounds");
235     return _caller_save_cpu_regs[i];
236   }
237 
238   static LIR_Opr caller_save_fpu_reg_at(int i) {
< prev index next >