< prev index next >

src/hotspot/share/code/compiledMethod.hpp

Print this page

179 public:
180   // Only used by unit test.
181   CompiledMethod() {}
182 
183   virtual bool is_compiled() const                { return true; }
184 
185   template<typename T>
186   T* gc_data() const                              { return reinterpret_cast<T*>(_gc_data); }
187   template<typename T>
188   void set_gc_data(T* gc_data)                    { _gc_data = reinterpret_cast<void*>(gc_data); }
189 
190   bool  has_unsafe_access() const                 { return _has_unsafe_access; }
191   void  set_has_unsafe_access(bool z)             { _has_unsafe_access = z; }
192 
193   bool  has_method_handle_invokes() const         { return _has_method_handle_invokes; }
194   void  set_has_method_handle_invokes(bool z)     { _has_method_handle_invokes = z; }
195 
196   bool  has_wide_vectors() const                  { return _has_wide_vectors; }
197   void  set_has_wide_vectors(bool z)              { _has_wide_vectors = z; }
198 










199   enum { not_installed = -1, // in construction, only the owner doing the construction is
200                              // allowed to advance state
201          in_use        = 0,  // executable nmethod
202          not_used      = 1,  // not entrant, but revivable
203          not_entrant   = 2,  // marked for deoptimization but activations may still exist,
204                              // will be transformed to zombie when all activations are gone
205          unloaded      = 3,  // there should be no activations, should not be called, will be
206                              // transformed to zombie by the sweeper, when not "locked in vm".
207          zombie        = 4   // no activations exist, nmethod is ready for purge
208   };
209 
210   virtual bool  is_in_use() const = 0;
211   virtual int   comp_level() const = 0;
212   virtual int   compile_id() const = 0;
213 
214   virtual address verified_entry_point() const = 0;


215   virtual void log_identity(xmlStream* log) const = 0;
216   virtual void log_state_change() const = 0;
217   virtual bool make_not_used() = 0;
218   virtual bool make_not_entrant() = 0;
219   virtual bool make_entrant() = 0;
220   virtual address entry_point() const = 0;

221   virtual bool make_zombie() = 0;
222   virtual bool is_osr_method() const = 0;
223   virtual int osr_entry_bci() const = 0;
224   Method* method() const                          { return _method; }
225   virtual void print_pcs() = 0;
226   bool is_native_method() const { return _method != NULL && _method->is_native(); }
227   bool is_java_method() const { return _method != NULL && !_method->is_native(); }
228 
229   // ScopeDesc retrieval operation
230   PcDesc* pc_desc_at(address pc)   { return find_pc_desc(pc, false); }
231   // pc_desc_near returns the first PcDesc at or after the given pc.
232   PcDesc* pc_desc_near(address pc) { return find_pc_desc(pc, true); }
233 
234   // ScopeDesc for an instruction
235   ScopeDesc* scope_desc_at(address pc);
236   ScopeDesc* scope_desc_near(address pc);
237 
238   bool is_at_poll_return(address pc);
239   bool is_at_poll_or_poll_return(address pc);
240 

179 public:
180   // Only used by unit test.
181   CompiledMethod() {}
182 
183   virtual bool is_compiled() const                { return true; }
184 
185   template<typename T>
186   T* gc_data() const                              { return reinterpret_cast<T*>(_gc_data); }
187   template<typename T>
188   void set_gc_data(T* gc_data)                    { _gc_data = reinterpret_cast<void*>(gc_data); }
189 
190   bool  has_unsafe_access() const                 { return _has_unsafe_access; }
191   void  set_has_unsafe_access(bool z)             { _has_unsafe_access = z; }
192 
193   bool  has_method_handle_invokes() const         { return _has_method_handle_invokes; }
194   void  set_has_method_handle_invokes(bool z)     { _has_method_handle_invokes = z; }
195 
196   bool  has_wide_vectors() const                  { return _has_wide_vectors; }
197   void  set_has_wide_vectors(bool z)              { _has_wide_vectors = z; }
198 
199   bool  needs_stack_repair() const {
200     if (is_compiled_by_c1()) {
201       return method()->c1_needs_stack_repair();
202     } else if (is_compiled_by_c2()) {
203       return method()->c2_needs_stack_repair();
204     } else {
205       return false;
206     }
207   }
208 
209   enum { not_installed = -1, // in construction, only the owner doing the construction is
210                              // allowed to advance state
211          in_use        = 0,  // executable nmethod
212          not_used      = 1,  // not entrant, but revivable
213          not_entrant   = 2,  // marked for deoptimization but activations may still exist,
214                              // will be transformed to zombie when all activations are gone
215          unloaded      = 3,  // there should be no activations, should not be called, will be
216                              // transformed to zombie by the sweeper, when not "locked in vm".
217          zombie        = 4   // no activations exist, nmethod is ready for purge
218   };
219 
220   virtual bool  is_in_use() const = 0;
221   virtual int   comp_level() const = 0;
222   virtual int   compile_id() const = 0;
223 
224   virtual address verified_entry_point() const = 0;
225   virtual address verified_inline_entry_point() const = 0;
226   virtual address verified_inline_ro_entry_point() const = 0;
227   virtual void log_identity(xmlStream* log) const = 0;
228   virtual void log_state_change() const = 0;
229   virtual bool make_not_used() = 0;
230   virtual bool make_not_entrant() = 0;
231   virtual bool make_entrant() = 0;
232   virtual address entry_point() const = 0;
233   virtual address inline_entry_point() const = 0;
234   virtual bool make_zombie() = 0;
235   virtual bool is_osr_method() const = 0;
236   virtual int osr_entry_bci() const = 0;
237   Method* method() const                          { return _method; }
238   virtual void print_pcs() = 0;
239   bool is_native_method() const { return _method != NULL && _method->is_native(); }
240   bool is_java_method() const { return _method != NULL && !_method->is_native(); }
241 
242   // ScopeDesc retrieval operation
243   PcDesc* pc_desc_at(address pc)   { return find_pc_desc(pc, false); }
244   // pc_desc_near returns the first PcDesc at or after the given pc.
245   PcDesc* pc_desc_near(address pc) { return find_pc_desc(pc, true); }
246 
247   // ScopeDesc for an instruction
248   ScopeDesc* scope_desc_at(address pc);
249   ScopeDesc* scope_desc_near(address pc);
250 
251   bool is_at_poll_return(address pc);
252   bool is_at_poll_or_poll_return(address pc);
253 
< prev index next >