135 Unpack_uncommon_trap = 2, // redo last byte code (C2 only) |
135 Unpack_uncommon_trap = 2, // redo last byte code (C2 only) |
136 Unpack_reexecute = 3, // reexecute bytecode (C1 only) |
136 Unpack_reexecute = 3, // reexecute bytecode (C1 only) |
137 Unpack_LIMIT = 4 |
137 Unpack_LIMIT = 4 |
138 }; |
138 }; |
139 |
139 |
|
140 static void deoptimize_all_marked(); |
|
141 |
|
142 private: |
140 // Checks all compiled methods. Invalid methods are deleted and |
143 // Checks all compiled methods. Invalid methods are deleted and |
141 // corresponding activations are deoptimized. |
144 // corresponding activations are deoptimized. |
142 static int deoptimize_dependents(); |
145 static int deoptimize_dependents(); |
143 |
146 |
|
147 // Revoke biased locks at deopt. |
|
148 static void revoke_from_deopt_handler(JavaThread* thread, frame fr, RegisterMap* map); |
|
149 |
|
150 public: |
144 // 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 |
145 static void deoptimize(JavaThread* thread, frame fr, RegisterMap *reg_map); |
152 static void deoptimize(JavaThread* thread, frame fr, RegisterMap *reg_map, DeoptReason reason = Reason_constraint); |
146 static void deoptimize(JavaThread* thread, frame fr, RegisterMap *reg_map, DeoptReason reason); |
|
147 |
153 |
148 #if INCLUDE_JVMCI |
154 #if INCLUDE_JVMCI |
149 static address deoptimize_for_missing_exception_handler(CompiledMethod* cm); |
155 static address deoptimize_for_missing_exception_handler(CompiledMethod* cm); |
150 static oop get_cached_box(AutoBoxObjectValue* bv, frame* fr, RegisterMap* reg_map, TRAPS); |
156 static oop get_cached_box(AutoBoxObjectValue* bv, frame* fr, RegisterMap* reg_map, TRAPS); |
151 #endif |
157 #endif |
152 |
158 |
153 private: |
159 private: |
154 // Does the actual work for deoptimizing a single frame |
160 // Does the actual work for deoptimizing a single frame |
155 static void deoptimize_single_frame(JavaThread* thread, frame fr, DeoptReason reason); |
161 static void deoptimize_single_frame(JavaThread* thread, frame fr, DeoptReason reason); |
156 |
162 |
157 // Helper function to revoke biases of all monitors in frame if UseBiasedLocking |
|
158 // is enabled |
|
159 static void revoke_biases_of_monitors(JavaThread* thread, frame fr, RegisterMap* map); |
|
160 |
|
161 #if COMPILER2_OR_JVMCI |
163 #if COMPILER2_OR_JVMCI |
162 JVMCI_ONLY(public:) |
164 public: |
163 |
165 |
164 // Support for restoring non-escaping objects |
166 // Support for restoring non-escaping objects |
165 static bool realloc_objects(JavaThread* thread, frame* fr, RegisterMap* reg_map, GrowableArray<ScopeValue*>* objects, TRAPS); |
167 static bool realloc_objects(JavaThread* thread, frame* fr, RegisterMap* reg_map, GrowableArray<ScopeValue*>* objects, TRAPS); |
166 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); |
167 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); |