< prev index next >

src/hotspot/share/code/compiledMethod.hpp

Print this page

142   friend class VMStructs;
143   friend class DeoptimizationScope;
144   void init_defaults();
145 protected:
146   enum DeoptimizationStatus : u1 {
147     not_marked,
148     deoptimize,
149     deoptimize_noupdate,
150     deoptimize_done
151   };
152 
153   volatile DeoptimizationStatus _deoptimization_status; // Used for stack deoptimization
154   // Used to track in which deoptimize handshake this method will be deoptimized.
155   uint64_t                      _deoptimization_generation;
156 
157   // set during construction
158   unsigned int _has_unsafe_access:1;         // May fault due to unsafe access.
159   unsigned int _has_method_handle_invokes:1; // Has this method MethodHandle invokes?
160   unsigned int _has_wide_vectors:1;          // Preserve wide vectors at safepoints
161   unsigned int _has_monitors:1;              // Fastpath monitor detection for continuations


162 
163   Method*   _method;
164   address _scopes_data_begin;
165   // All deoptee's will resume execution at this location described by
166   // this address.
167   address _deopt_handler_begin;
168   // All deoptee's at a MethodHandle call site will resume execution
169   // at this location described by this offset.
170   address _deopt_mh_handler_begin;
171 
172   PcDescContainer _pc_desc_container;
173   ExceptionCache * volatile _exception_cache;
174 
175   void* _gc_data;
176 
177   virtual void purge(bool free_code_cache_data, bool unregister_nmethod) = 0;
178 
179 private:
180   DeoptimizationStatus deoptimization_status() const {
181     return Atomic::load(&_deoptimization_status);

189   // Only used by unit test.
190   CompiledMethod() {}
191 
192   template<typename T>
193   T* gc_data() const                              { return reinterpret_cast<T*>(_gc_data); }
194   template<typename T>
195   void set_gc_data(T* gc_data)                    { _gc_data = reinterpret_cast<void*>(gc_data); }
196 
197   bool  has_unsafe_access() const                 { return _has_unsafe_access; }
198   void  set_has_unsafe_access(bool z)             { _has_unsafe_access = z; }
199 
200   bool  has_monitors() const                      { return _has_monitors; }
201   void  set_has_monitors(bool z)                  { _has_monitors = z; }
202 
203   bool  has_method_handle_invokes() const         { return _has_method_handle_invokes; }
204   void  set_has_method_handle_invokes(bool z)     { _has_method_handle_invokes = z; }
205 
206   bool  has_wide_vectors() const                  { return _has_wide_vectors; }
207   void  set_has_wide_vectors(bool z)              { _has_wide_vectors = z; }
208 






209   enum : signed char { 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   };
215 
216   virtual bool  is_in_use() const = 0;
217   virtual int   comp_level() const = 0;
218   virtual int   compile_id() const = 0;

219 
220   virtual address verified_entry_point() const = 0;
221   virtual void log_identity(xmlStream* log) const = 0;
222   virtual void log_state_change() const = 0;
223   virtual bool make_not_used() = 0;
224   virtual bool make_not_entrant() = 0;
225   virtual bool make_entrant() = 0;
226   virtual address entry_point() const = 0;
227   virtual bool is_osr_method() const = 0;
228   virtual int osr_entry_bci() const = 0;
229   Method* method() const                          { return _method; }
230   virtual void print_pcs_on(outputStream* st) = 0;
231   bool is_native_method() const { return _method != nullptr && _method->is_native(); }
232   bool is_java_method() const { return _method != nullptr && !_method->is_native(); }
233 
234   // ScopeDesc retrieval operation
235   PcDesc* pc_desc_at(address pc)   { return find_pc_desc(pc, false); }
236   // pc_desc_near returns the first PcDesc at or after the given pc.
237   PcDesc* pc_desc_near(address pc) { return find_pc_desc(pc, true); }
238 
239   // ScopeDesc for an instruction
240   ScopeDesc* scope_desc_at(address pc);
241   ScopeDesc* scope_desc_near(address pc);
242 
243   bool is_at_poll_return(address pc);
244   bool is_at_poll_or_poll_return(address pc);

142   friend class VMStructs;
143   friend class DeoptimizationScope;
144   void init_defaults();
145 protected:
146   enum DeoptimizationStatus : u1 {
147     not_marked,
148     deoptimize,
149     deoptimize_noupdate,
150     deoptimize_done
151   };
152 
153   volatile DeoptimizationStatus _deoptimization_status; // Used for stack deoptimization
154   // Used to track in which deoptimize handshake this method will be deoptimized.
155   uint64_t                      _deoptimization_generation;
156 
157   // set during construction
158   unsigned int _has_unsafe_access:1;         // May fault due to unsafe access.
159   unsigned int _has_method_handle_invokes:1; // Has this method MethodHandle invokes?
160   unsigned int _has_wide_vectors:1;          // Preserve wide vectors at safepoints
161   unsigned int _has_monitors:1;              // Fastpath monitor detection for continuations
162   unsigned int _preloaded:1;
163   unsigned int _has_clinit_barriers:1;
164 
165   Method*   _method;
166   address _scopes_data_begin;
167   // All deoptee's will resume execution at this location described by
168   // this address.
169   address _deopt_handler_begin;
170   // All deoptee's at a MethodHandle call site will resume execution
171   // at this location described by this offset.
172   address _deopt_mh_handler_begin;
173 
174   PcDescContainer _pc_desc_container;
175   ExceptionCache * volatile _exception_cache;
176 
177   void* _gc_data;
178 
179   virtual void purge(bool free_code_cache_data, bool unregister_nmethod) = 0;
180 
181 private:
182   DeoptimizationStatus deoptimization_status() const {
183     return Atomic::load(&_deoptimization_status);

191   // Only used by unit test.
192   CompiledMethod() {}
193 
194   template<typename T>
195   T* gc_data() const                              { return reinterpret_cast<T*>(_gc_data); }
196   template<typename T>
197   void set_gc_data(T* gc_data)                    { _gc_data = reinterpret_cast<void*>(gc_data); }
198 
199   bool  has_unsafe_access() const                 { return _has_unsafe_access; }
200   void  set_has_unsafe_access(bool z)             { _has_unsafe_access = z; }
201 
202   bool  has_monitors() const                      { return _has_monitors; }
203   void  set_has_monitors(bool z)                  { _has_monitors = z; }
204 
205   bool  has_method_handle_invokes() const         { return _has_method_handle_invokes; }
206   void  set_has_method_handle_invokes(bool z)     { _has_method_handle_invokes = z; }
207 
208   bool  has_wide_vectors() const                  { return _has_wide_vectors; }
209   void  set_has_wide_vectors(bool z)              { _has_wide_vectors = z; }
210 
211   bool  has_clinit_barriers() const               { return _has_clinit_barriers; }
212   void  set_has_clinit_barriers(bool z)           { _has_clinit_barriers = z; }
213 
214   bool  preloaded() const                         { return _preloaded; }
215   void  set_preloaded(bool z)                     { _preloaded = z; }
216 
217   enum : signed char { not_installed = -1, // in construction, only the owner doing the construction is
218                                            // allowed to advance state
219                        in_use        = 0,  // executable nmethod
220                        not_used      = 1,  // not entrant, but revivable
221                        not_entrant   = 2,  // marked for deoptimization but activations may still exist
222   };
223 
224   virtual bool  is_in_use() const = 0;
225   virtual int   comp_level() const = 0;
226   virtual int   compile_id() const = 0;
227   virtual bool  is_scc() const = 0;
228 
229   virtual address verified_entry_point() const = 0;
230   virtual void log_identity(xmlStream* log) const = 0;
231   virtual void log_state_change() const = 0;
232   virtual bool make_not_used() = 0;
233   virtual bool make_not_entrant(bool make_not_entrant = true) = 0;
234   virtual bool make_entrant() = 0;
235   virtual address entry_point() const = 0;
236   virtual bool is_osr_method() const = 0;
237   virtual int osr_entry_bci() const = 0;
238   Method* method() const                          { return _method; }
239   virtual void print_pcs_on(outputStream* st) = 0;
240   bool is_native_method() const { return _method != nullptr && _method->is_native(); }
241   bool is_java_method() const { return _method != nullptr && !_method->is_native(); }
242 
243   // ScopeDesc retrieval operation
244   PcDesc* pc_desc_at(address pc)   { return find_pc_desc(pc, false); }
245   // pc_desc_near returns the first PcDesc at or after the given pc.
246   PcDesc* pc_desc_near(address pc) { return find_pc_desc(pc, true); }
247 
248   // ScopeDesc for an instruction
249   ScopeDesc* scope_desc_at(address pc);
250   ScopeDesc* scope_desc_near(address pc);
251 
252   bool is_at_poll_return(address pc);
253   bool is_at_poll_or_poll_return(address pc);
< prev index next >