< prev index next >

src/hotspot/share/runtime/deoptimization.hpp

Print this page

159 #if INCLUDE_JVMCI
160   static address deoptimize_for_missing_exception_handler(CompiledMethod* cm);
161 #endif
162 
163   static oop get_cached_box(AutoBoxObjectValue* bv, frame* fr, RegisterMap* reg_map, TRAPS);
164 
165   private:
166   // Does the actual work for deoptimizing a single frame
167   static void deoptimize_single_frame(JavaThread* thread, frame fr, DeoptReason reason);
168 
169 #if COMPILER2_OR_JVMCI
170   // Deoptimize objects, that is reallocate and relock them, just before they
171   // escape through JVMTI.  The given vframes cover one physical frame.
172   static bool deoptimize_objects_internal(JavaThread* thread, GrowableArray<compiledVFrame*>* chunk,
173                                           bool& realloc_failures);
174 
175  public:
176 
177   // Support for restoring non-escaping objects
178   static bool realloc_objects(JavaThread* thread, frame* fr, RegisterMap* reg_map, GrowableArray<ScopeValue*>* objects, TRAPS);

179   static void reassign_type_array_elements(frame* fr, RegisterMap* reg_map, ObjectValue* sv, typeArrayOop obj, BasicType type);
180   static void reassign_object_array_elements(frame* fr, RegisterMap* reg_map, ObjectValue* sv, objArrayOop obj);
181   static void reassign_fields(frame* fr, RegisterMap* reg_map, GrowableArray<ScopeValue*>* objects, bool realloc_failures, bool skip_internal);

182   static bool relock_objects(JavaThread* thread, GrowableArray<MonitorInfo*>* monitors,
183                              JavaThread* deoptee_thread, frame& fr, int exec_mode, bool realloc_failures);
184   static void pop_frames_failed_reallocs(JavaThread* thread, vframeArray* array);
185 #endif // COMPILER2_OR_JVMCI
186 
187   public:
188   static vframeArray* create_vframeArray(JavaThread* thread, frame fr, RegisterMap *reg_map, GrowableArray<compiledVFrame*>* chunk, bool realloc_failures);
189 
190   // Interface used for unpacking deoptimized frames
191 
192   // UnrollBlock is returned by fetch_unroll_info() to the deoptimization handler (blob).
193   // This is only a CheapObj to ease debugging after a deopt failure
194   class UnrollBlock : public CHeapObj<mtCompiler> {
195     friend class VMStructs;
196     friend class JVMCIVMStructs;
197    private:
198     int       _size_of_deoptimized_frame; // Size, in bytes, of current deoptimized frame
199     int       _caller_adjustment;         // Adjustment, in bytes, to caller's SP by initial interpreted frame
200     int       _number_of_frames;          // Number frames to unroll
201     int       _total_frame_sizes;         // Total of number*sizes frames

159 #if INCLUDE_JVMCI
160   static address deoptimize_for_missing_exception_handler(CompiledMethod* cm);
161 #endif
162 
163   static oop get_cached_box(AutoBoxObjectValue* bv, frame* fr, RegisterMap* reg_map, TRAPS);
164 
165   private:
166   // Does the actual work for deoptimizing a single frame
167   static void deoptimize_single_frame(JavaThread* thread, frame fr, DeoptReason reason);
168 
169 #if COMPILER2_OR_JVMCI
170   // Deoptimize objects, that is reallocate and relock them, just before they
171   // escape through JVMTI.  The given vframes cover one physical frame.
172   static bool deoptimize_objects_internal(JavaThread* thread, GrowableArray<compiledVFrame*>* chunk,
173                                           bool& realloc_failures);
174 
175  public:
176 
177   // Support for restoring non-escaping objects
178   static bool realloc_objects(JavaThread* thread, frame* fr, RegisterMap* reg_map, GrowableArray<ScopeValue*>* objects, TRAPS);
179   static bool realloc_inline_type_result(InlineKlass* vk, const RegisterMap& map, GrowableArray<Handle>& return_oops, TRAPS);
180   static void reassign_type_array_elements(frame* fr, RegisterMap* reg_map, ObjectValue* sv, typeArrayOop obj, BasicType type);
181   static void reassign_object_array_elements(frame* fr, RegisterMap* reg_map, ObjectValue* sv, objArrayOop obj);
182   static void reassign_flat_array_elements(frame* fr, RegisterMap* reg_map, ObjectValue* sv, flatArrayOop obj, FlatArrayKlass* vak, bool skip_internal, TRAPS);
183   static void reassign_fields(frame* fr, RegisterMap* reg_map, GrowableArray<ScopeValue*>* objects, bool realloc_failures, bool skip_internal, TRAPS);
184   static bool relock_objects(JavaThread* thread, GrowableArray<MonitorInfo*>* monitors,
185                              JavaThread* deoptee_thread, frame& fr, int exec_mode, bool realloc_failures);
186   static void pop_frames_failed_reallocs(JavaThread* thread, vframeArray* array);
187 #endif // COMPILER2_OR_JVMCI
188 
189   public:
190   static vframeArray* create_vframeArray(JavaThread* thread, frame fr, RegisterMap *reg_map, GrowableArray<compiledVFrame*>* chunk, bool realloc_failures);
191 
192   // Interface used for unpacking deoptimized frames
193 
194   // UnrollBlock is returned by fetch_unroll_info() to the deoptimization handler (blob).
195   // This is only a CheapObj to ease debugging after a deopt failure
196   class UnrollBlock : public CHeapObj<mtCompiler> {
197     friend class VMStructs;
198     friend class JVMCIVMStructs;
199    private:
200     int       _size_of_deoptimized_frame; // Size, in bytes, of current deoptimized frame
201     int       _caller_adjustment;         // Adjustment, in bytes, to caller's SP by initial interpreted frame
202     int       _number_of_frames;          // Number frames to unroll
203     int       _total_frame_sizes;         // Total of number*sizes frames
< prev index next >