70 Reason_profile_predicate, // compiler generated predicate moved from frequent branch in a loop failed |
71 Reason_profile_predicate, // compiler generated predicate moved from frequent branch in a loop failed |
71 |
72 |
72 // recorded per method |
73 // recorded per method |
73 Reason_unloaded, // unloaded class or constant pool entry |
74 Reason_unloaded, // unloaded class or constant pool entry |
74 Reason_uninitialized, // bad class state (uninitialized) |
75 Reason_uninitialized, // bad class state (uninitialized) |
|
76 Reason_initialized, // class has been fully initialized |
75 Reason_unreached, // code is not reached, compiler |
77 Reason_unreached, // code is not reached, compiler |
76 Reason_unhandled, // arbitrary compiler limitation |
78 Reason_unhandled, // arbitrary compiler limitation |
77 Reason_constraint, // arbitrary runtime constraint violated |
79 Reason_constraint, // arbitrary runtime constraint violated |
78 Reason_div0_check, // a null_check due to division by zero |
80 Reason_div0_check, // a null_check due to division by zero |
79 Reason_age, // nmethod too old; tier threshold reached |
81 Reason_age, // nmethod too old; tier threshold reached |
139 |
141 |
140 private: |
142 private: |
141 // Checks all compiled methods. Invalid methods are deleted and |
143 // Checks all compiled methods. Invalid methods are deleted and |
142 // corresponding activations are deoptimized. |
144 // corresponding activations are deoptimized. |
143 static int deoptimize_dependents(); |
145 static int deoptimize_dependents(); |
144 static void revoke_using_handshake(JavaThread* thread, frame fr, RegisterMap* map); |
146 |
145 static void revoke_using_safepoint(JavaThread* thread, frame fr, RegisterMap* map); |
147 // Revoke biased locks at deopt. |
146 static void deopt_thread(bool in_handshake, JavaThread* thread, frame fr, RegisterMap *map, DeoptReason reason); |
148 static void revoke_from_deopt_handler(JavaThread* thread, frame fr, RegisterMap* map); |
147 |
149 |
148 public: |
150 public: |
149 // Deoptimizes a frame lazily. nmethod gets patched deopt happens on return to the frame |
151 // Deoptimizes a frame lazily. nmethod gets patched deopt happens on return to the frame |
150 static void deoptimize(JavaThread* thread, frame fr, RegisterMap *map, bool in_handshake = false); |
152 static void deoptimize(JavaThread* thread, frame fr, RegisterMap *reg_map, DeoptReason reason = Reason_constraint); |
151 static void deoptimize(JavaThread* thread, frame fr, RegisterMap *reg_map, DeoptReason reason); |
|
152 |
153 |
153 #if INCLUDE_JVMCI |
154 #if INCLUDE_JVMCI |
154 static address deoptimize_for_missing_exception_handler(CompiledMethod* cm); |
155 static address deoptimize_for_missing_exception_handler(CompiledMethod* cm); |
|
156 static oop get_cached_box(AutoBoxObjectValue* bv, frame* fr, RegisterMap* reg_map, TRAPS); |
155 #endif |
157 #endif |
156 |
158 |
157 private: |
159 private: |
158 // Does the actual work for deoptimizing a single frame |
160 // Does the actual work for deoptimizing a single frame |
159 static void deoptimize_single_frame(JavaThread* thread, frame fr, DeoptReason reason); |
161 static void deoptimize_single_frame(JavaThread* thread, frame fr, DeoptReason reason); |
160 |
162 |
161 // Helper function to revoke biases of all monitors in frame if UseBiasedLocking |
|
162 // is enabled |
|
163 static void revoke_biases_of_monitors(JavaThread* thread, frame fr, RegisterMap* map) { |
|
164 revoke_using_safepoint(thread, fr, map); |
|
165 } |
|
166 |
|
167 #if COMPILER2_OR_JVMCI |
163 #if COMPILER2_OR_JVMCI |
168 JVMCI_ONLY(public:) |
164 public: |
169 |
165 |
170 // Support for restoring non-escaping objects |
166 // Support for restoring non-escaping objects |
171 static bool realloc_objects(JavaThread* thread, frame* fr, GrowableArray<ScopeValue*>* objects, TRAPS); |
167 static bool realloc_objects(JavaThread* thread, frame* fr, RegisterMap* reg_map, GrowableArray<ScopeValue*>* objects, TRAPS); |
172 static void reassign_type_array_elements(frame* fr, RegisterMap* reg_map, ObjectValue* sv, typeArrayOop obj, BasicType type); |
168 static void reassign_type_array_elements(frame* fr, RegisterMap* reg_map, ObjectValue* sv, typeArrayOop obj, BasicType type); |
173 static void reassign_object_array_elements(frame* fr, RegisterMap* reg_map, ObjectValue* sv, objArrayOop obj); |
169 static void reassign_object_array_elements(frame* fr, RegisterMap* reg_map, ObjectValue* sv, objArrayOop obj); |
174 static void reassign_fields(frame* fr, RegisterMap* reg_map, GrowableArray<ScopeValue*>* objects, bool realloc_failures, bool skip_internal); |
170 static void reassign_fields(frame* fr, RegisterMap* reg_map, GrowableArray<ScopeValue*>* objects, bool realloc_failures, bool skip_internal); |
175 static void relock_objects(GrowableArray<MonitorInfo*>* monitors, JavaThread* thread, bool realloc_failures); |
171 static void relock_objects(GrowableArray<MonitorInfo*>* monitors, JavaThread* thread, bool realloc_failures); |
176 static void pop_frames_failed_reallocs(JavaThread* thread, vframeArray* array); |
172 static void pop_frames_failed_reallocs(JavaThread* thread, vframeArray* array); |